Changeset c70f59f for lib/format_rt.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/format_rt.c

    r90e8d92 rc70f59f  
    780780                        if (packet->type == TRACE_RT_END_DATA)
    781781                                event.type = TRACE_EVENT_TERMINATE;
    782                         else
     782                        else {
    783783                                /* Since several RT messages can have zero-byte
    784784                                 * length (once the framing is removed), an
     
    786786                                 * PACKET event */
    787787                                event.type = TRACE_EVENT_PACKET;
     788                                trace->accepted_packets ++;
     789                        }
    788790
    789791                }       
    790792                else {
    791793                        event.type = TRACE_EVENT_PACKET;
     794                        trace->accepted_packets ++;
    792795                }
    793796
     
    795798                        if (!trace_apply_filter(trace->filter, packet)) {
    796799                                trace_clear_cache(packet);
    797                                 continue;
     800                                trace->filtered_packets ++;
     801                                continue;
    798802                        }
    799803                }
Note: See TracChangeset for help on using the changeset viewer.