Ignore:
Timestamp:
03/13/06 11:01:18 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
32f365f
Parents:
8f80e87
Message:

Cleanup the tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracertstats/tracertstats.c

    rd56089a r3d4fb8f  
    2929 */
    3030
    31 //
    32 // This program takes a series of traces and bpf filters and outputs how many
    33 // bytes/packets every time interval
     31/* This program takes a series of traces and bpf filters and outputs how many
     32 * bytes/packets every time interval
     33 */
    3434
    3535#include <stdio.h>
     
    9898        double ts = 0;
    9999
    100         output=output_init(uri,output_format?:"txt");
    101         output_add_column(output,"unix_time");
     100        output=output_init(uri,output_format?output_format:"txt");
     101        output_add_column(output,"ts");
    102102        output_add_column(output,"packets");
    103103        output_add_column(output,"bytes");
     
    113113
    114114        trace = trace_create(uri);
     115        if (trace_is_err(trace)) {
     116                trace_perror(trace,"trace_create");
     117                trace_destroy(trace);
     118                output_destroy(output);
     119                return;
     120        }
     121        if (trace_start(trace)==-1) {
     122                trace_perror(trace,"trace_start");
     123                trace_destroy(trace);
     124                output_destroy(output);
     125                return;
     126        }
    115127
    116128        for (;;) {
     
    141153                }
    142154
    143                 if (count > packet_count) {
     155                if (count >= packet_count) {
    144156                        report_results(ts,count,bytes);
    145157                        count=0;
Note: See TracChangeset for help on using the changeset viewer.