Ignore:
Timestamp:
09/15/15 17:16:51 (6 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:
8decff7
Parents:
624c2da
Message:

Fix all outstanding warnings

Implemented trace_get_statistics for formats that were missing it, so
we no longer need to use the deprecated trace_get_dropped_packets anywhere
within libtrace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracereport/drops_report.c

    r4423dc7 r5478d3d  
    44#include <time.h>
    55#include <string.h>
     6#include <stdlib.h>
    67#include "libtrace.h"
    78#include "tracereport.h"
     
    2021void drops_per_trace(libtrace_t *trace)
    2122{
    22         uint64_t packets;
     23        libtrace_stat_t *stat;
    2324
    24         packets = trace_get_received_packets(trace);
    25         if (packets != UINT64_MAX) {
    26                 received_packets+=packets;
     25        stat = trace_create_statistics();
     26
     27        trace_get_statistics(trace, stat);
     28
     29        if (stat->received_valid) {
     30                received_packets+=stat->received;
    2731                has_received=true;
    2832        }
    2933
    30         packets = trace_get_filtered_packets(trace);
    31         if (packets != UINT64_MAX) {
    32                 filtered_packets+=packets;
     34        if (stat->filtered_valid) {
     35                filtered_packets+=stat->filtered;
    3336                has_filtered=true;
    3437        }
    3538
    36         packets = trace_get_dropped_packets(trace);
    37         if (packets != UINT64_MAX) {
    38                 dropped_packets+=packets;
     39        if (stat->dropped_valid) {
     40                dropped_packets+=stat->dropped;
    3941                has_dropped=true;
    4042        }
    4143
    42         packets = trace_get_accepted_packets(trace);
    43         if (packets != UINT64_MAX) {
    44                 accepted_packets+=packets;
     44        if (stat->accepted_valid) {
     45                accepted_packets+=stat->accepted;
    4546                has_accepted=true;
    4647        }
     48        free(stat);
    4749}
    4850
Note: See TracChangeset for help on using the changeset viewer.