Ignore:
Timestamp:
02/13/15 18:35:14 (7 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:
3e89670
Parents:
1ebc4bd
Message:

For linux formats int/ring also use dev stats from /proc/net/dev to report
dropped packets.

This accounts for packets that dont even reach the kernel. The drop count
now matches 100% with sent packets.

There could be some slight discrepancies caused packets received between
opening/closing the socket and when we make our call to /proc/net/dev.
However this is a lot more realistic than previous numbers.

We might also be able to caclulate filtered packets from these numbers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_common.h

    r6cf3ca0 red6304c5  
    172172};
    173173
     174
     175/* A structure we use to hold statistic counters from the network cards
     176 * as accessed via the /proc/net/dev
     177 */
     178struct linux_dev_stats {
     179        char if_name[IF_NAMESIZE];
     180        uint64_t rx_bytes;
     181        uint64_t rx_packets;
     182        uint64_t rx_errors;
     183        uint64_t rx_drops;
     184        uint64_t rx_fifo;
     185        uint64_t rx_frame;
     186        uint64_t rx_compressed;
     187        uint64_t rx_multicast;
     188        uint64_t tx_bytes;
     189        uint64_t tx_packets;
     190        uint64_t tx_errors;
     191        uint64_t tx_drops;
     192        uint64_t tx_fifo;
     193        uint64_t tx_colls;
     194        uint64_t tx_carrier;
     195        uint64_t tx_compressed;
     196};
     197
    174198/* Note that this structure is passed over the wire in rt encapsulation, and
    175199 * thus we need to be careful with data sizes.  timeval's and timespec's
     
    188212        /* Statistics for the capture process, e.g. dropped packet counts */
    189213        struct tpacket_stats stats;
     214        /* Statistics for the NIC rather than the socket */
     215        struct linux_dev_stats dev_stats;
    190216        /* Flag indicating whether the statistics are current or not */
    191217        int stats_valid;
Note: See TracChangeset for help on using the changeset viewer.