Ignore:
Timestamp:
02/24/15 17:18:21 (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:
116f970
Parents:
10c47a0
Message:

Move the accepted packet count to dispatching packets for threads.
Accounting for the doubled count when using a single threaded format.

Rework statistics logic slightly to remove duplicated code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_common.c

    re4f27d1 r526d9d0  
    596596
    597597        /* filtered count == dev received - socket received */
    598         if (FORMAT_DATA->filter == NULL) {
    599                 stat->filtered_valid = 1;
    600                 stat->filtered = 0;
    601         } else if (FORMAT_DATA->stats_valid && dev_stats.if_name[0]) {
    602                 stat->filtered_valid = 1;
    603                 stat->filtered = DEV_DIFF(rx_packets) -
    604                                  FORMAT_DATA->stats.tp_packets;
    605                 if (stat->filtered > UINT64_MAX - 100000) {
    606                         stat->filtered = 0;
     598        if (FORMAT_DATA->filter != NULL &&
     599            FORMAT_DATA->stats_valid &&
     600            dev_stats.if_name[0]) {
     601                uint64_t filtered = DEV_DIFF(rx_packets) -
     602                                    FORMAT_DATA->stats.tp_packets;
     603                /* Check the value is sane, due to timing it could be below 0 */
     604                if (filtered < UINT64_MAX - 100000) {
     605                        stat->filtered += filtered;
    607606                }
    608607        }
Note: See TracChangeset for help on using the changeset viewer.