Changeset c70f59f for lib/trace.c


Ignore:
Timestamp:
08/25/14 11:33:39 (7 years ago)
Author:
Shane Alcock <salcock@…>
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:
7fda5c5
Parents:
a79eae41
Message:

Don't increment accepted_packets in trace_event

For formats that use the normal trace_event_device and
trace_event_trace functions to implement trace_event functionality,
this was resulting in accepted_packets being incremented twice:
once in the call to trace_read_packet within the standard event
function and once again in trace_event.

Removed the increment from trace_event and updated all formats
that provide a custom trace_event implementation to make sure they
either call trace_read_packet themselves or update the counters
properly (with the former preferred wherever possible).

Thanks to Alistair King for finding this bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rb8d8186 rc70f59f  
    11191119
    11201120        if (packet->trace->format->trace_event) {
    1121                 event=packet->trace->format->trace_event(trace,packet);
    1122                 if (event.type == TRACE_EVENT_PACKET) {
    1123                         ++trace->accepted_packets;
    1124                 }
     1121                /* Note: incrementing accepted, filtered etc. packet
     1122                 * counters is handled by the format-specific
     1123                 * function so don't increment them here.
     1124                 */
     1125                event=packet->trace->format->trace_event(trace,packet);
    11251126        }
    11261127        return event;
Note: See TracChangeset for help on using the changeset viewer.