Ignore:
Timestamp:
09/20/11 14:23:33 (10 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:
979a84f4
Parents:
c0506ea
Message:
  • Updated libtrace tools to use trace_interrupt where appropriate
  • Halved the number of calls to trace_get_wire_length in tracestats
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracestats/tracestats.c

    rec0f8f1 rc0ccccd  
    6464        (void)signal;
    6565        done=1;
     66        trace_interrupt();
    6667}
    6768
     
    102103        for (;;) {
    103104                int psize;
     105                int wlen;
    104106                if ((psize = trace_read_packet(trace, packet)) <1) {
    105107                        break;
     
    108110                if (done)
    109111                        break;
     112                wlen = trace_get_wire_length(packet);
    110113
    111114                for(i=0;i<filter_count;++i) {
     
    114117                        if(trace_apply_filter(filters[i].filter,packet) > 0) {
    115118                                ++filters[i].count;
    116                                 filters[i].bytes+=trace_get_wire_length(packet);
     119                                filters[i].bytes+=wlen;
    117120                        }
    118121                        if (trace_is_err(trace)) {
     
    124127
    125128                ++count;
    126                 bytes+=trace_get_wire_length(packet);
     129                bytes+=wlen;
    127130        }
    128131
Note: See TracChangeset for help on using the changeset viewer.