Ignore:
Timestamp:
02/07/07 16:46:43 (15 years ago)
Author:
Shane Alcock <salcock@…>
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:
43ab7b3
Parents:
205809b
Message:

Some of tracesummary's bpf filters were incorrect - however the new correct filters don't work so well with the output format so that will need fixing at some point
Improved error reporting for bpf filters
tracestats will now ignore a filter that fails and print a single warning. It also no longer increments the counter for filters that fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracestats/tracestats.c

    rd5a27e8 rd242ea8  
    100100
    101101                for(i=0;i<filter_count;++i) {
    102                         if(trace_apply_filter(filters[i].filter,packet)) {
     102                        if (filters[i].filter == NULL)
     103                                continue;
     104                        if(trace_apply_filter(filters[i].filter,packet) > 0) {
    103105                                ++filters[i].count;
    104106                                filters[i].bytes+=trace_get_wire_length(packet);
     107                        }
     108                        if (trace_is_err(trace)) {
     109                                trace_perror(trace, "trace_apply_filter");
     110                                fprintf(stderr, "Removing filter from filterlist\n");
     111                                filters[i].filter = NULL;
    105112                        }
    106113                }
     
    110117        }
    111118
     119        printf("%-30s\t%12s\t%12s\t%7s\n","filter","count","bytes","%");
    112120        for(i=0;i<filter_count;++i) {
    113121                printf("%30s:\t%12"PRIu64"\t%12"PRIu64"\t%7.03f\n",filters[i].expr,filters[i].count,filters[i].bytes,filters[i].count*100.0/count);
     
    165173        }
    166174
    167         printf("%-30s\t%12s\t%12s\t%7s\n","filter","count","bytes","%");
    168175        for(i=optind;i<argc;++i) {
    169176                run_trace(argv[i]);
Note: See TracChangeset for help on using the changeset viewer.