Changeset 3d4fb8f for tools/tracertstats


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

Location:
tools/tracertstats
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tools/tracertstats/output_csv.c

    re3b0188 r3d4fb8f  
    4646
    4747struct output_type_t output_csv = {
    48 name: "csv",
    49 init: output_csv_init,
    50 flush: output_csv_flush,
    51 destroy: output_csv_destroy,
     48.name= "csv",
     49.init= output_csv_init,
     50.flush= output_csv_flush,
     51.destroy= output_csv_destroy,
    5252};
  • tools/tracertstats/output_html.c

    re3b0188 r3d4fb8f  
    6565
    6666struct output_type_t output_html = {
    67 name: "html",
    68 init: output_html_init,
    69 flush: output_html_flush,
    70 destroy: output_html_destroy,
     67.name= "html",
     68.init= output_html_init,
     69.flush= output_html_flush,
     70.destroy= output_html_destroy,
    7171};
  • tools/tracertstats/output_png.c

    re3b0188 r3d4fb8f  
    7676
    7777struct output_type_t output_png = {
    78         name: "png",
    79         init: output_png_init,
    80         flush: output_png_flush,
    81         destroy: output_png_destroy,
     78        .name= "png",
     79        .init= output_png_init,
     80        .flush= output_png_flush,
     81        .destroy= output_png_destroy,
    8282};
  • tools/tracertstats/output_txt.c

    re3b0188 r3d4fb8f  
    44#include <inttypes.h>
    55#include <lt_inttypes.h>
     6#include <string.h>
    67
    78#define COLWIDTH 11
     
    5354
    5455struct output_type_t output_txt = {
    55 name: "txt",
    56 init: output_txt_init,
    57 flush: output_txt_flush,
    58 destroy: output_txt_destroy,
     56.name= "txt",
     57.init= output_txt_init,
     58.flush= output_txt_flush,
     59.destroy= output_txt_destroy,
    5960};
  • 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.