Changeset 91e016c


Ignore:
Timestamp:
03/30/15 11:36:51 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
ac65c9f
Parents:
652d720
Message:

Fix bug introduced by reseting stat counters after pause.

We were using accepted_packets to mark packet order, however
combiners expect this number to be increasing and not reset
after pause.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_int.h

    rc63bcdf r91e016c  
    301301        size_t snaplen;                 
    302302        /** Count of the number of packets returned to the libtrace user */
    303         uint64_t accepted_packets;     
     303        uint64_t accepted_packets;
    304304        /** Count of the number of packets filtered by libtrace */
    305         uint64_t filtered_packets;     
     305        uint64_t filtered_packets;
     306        /** The sequence is like accepted_packets but we don't reset this after a pause. */
     307        uint64_t sequence_number;
    306308        /** The filename from the uri for the trace */
    307309        char *uridata;
     
    318320        /** Use to control pausing threads and finishing threads etc always used with libtrace_lock */
    319321        pthread_cond_t perpkt_cond;
    320         /* Keep track of counts of threads in any given state */
     322        /** Keeps track of counts of threads in any given state */
    321323        int perpkt_thread_states[THREAD_STATE_MAX];
    322324
  • lib/trace.c

    rf50515e r91e016c  
    284284        libtrace->stats = NULL;
    285285        libtrace->pread = NULL;
     286        libtrace->sequence_number = 0;
    286287        ZERO_USER_CONFIG(libtrace->config);
    287288        memset(&libtrace->combiner, 0, sizeof(libtrace->combiner));
     
    401402        libtrace->stats = NULL;
    402403        libtrace->pread = NULL;
     404        libtrace->sequence_number = 0;
    403405        ZERO_USER_CONFIG(libtrace->config);
    404406        memset(&libtrace->combiner, 0, sizeof(libtrace->combiner));
     
    900902                                                libtrace->snaplen);
    901903                        }
    902                         trace_packet_set_order(packet, libtrace->accepted_packets);
     904                        trace_packet_set_order(packet, libtrace->sequence_number);
    903905                        ++libtrace->accepted_packets;
     906                        ++libtrace->sequence_number;
    904907                        return ret;
    905908                } while(1);
Note: See TracChangeset for help on using the changeset viewer.