Changeset 5478d3d for tools/tracesplit


Ignore:
Timestamp:
09/15/15 17:16:51 (5 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/tracesplit/tracesplit.c

    r17f954f r5478d3d  
    8282static int per_packet(libtrace_packet_t *packet) {
    8383
    84         if (trace_get_link_type(packet) == ~0U) {
     84        if (trace_get_link_type(packet) == -1) {
    8585                fprintf(stderr, "Halted due to being unable to determine linktype - input trace may be corrupt.\n");
    8686                return -1;
     
    387387
    388388        if (verbose) {
    389                 uint64_t f;
    390                 f=trace_get_received_packets(input);
    391                 if (f!=UINT64_MAX)
    392                         fprintf(stderr,"%" PRIu64 " packets on input\n",f);
    393                 f=trace_get_filtered_packets(input);
    394                 if (f!=UINT64_MAX)
    395                         fprintf(stderr,"%" PRIu64 " packets filtered\n",f);
    396                 f=trace_get_dropped_packets(input);
    397                 if (f!=UINT64_MAX)
    398                         fprintf(stderr,"%" PRIu64 " packets dropped\n",f);
    399                 f=trace_get_accepted_packets(input);
    400                 if (f!=UINT64_MAX)
    401                         fprintf(stderr,"%" PRIu64 " packets accepted\n",f);
    402         }
     389                libtrace_stat_t *stat;
     390               
     391                stat = trace_create_statistics();
     392                trace_get_statistics(input, stat);
     393
     394                if (stat->received_valid)
     395                        fprintf(stderr,"%" PRIu64 " packets on input\n",
     396                                        stat->received);
     397                if (stat->filtered_valid)
     398                        fprintf(stderr,"%" PRIu64 " packets filtered\n",
     399                                        stat->filtered);
     400                if (stat->dropped_valid)
     401                        fprintf(stderr,"%" PRIu64 " packets dropped\n",
     402                                        stat->dropped);
     403                if (stat->accepted_valid)
     404                        fprintf(stderr,"%" PRIu64 " packets accepted\n",
     405                                        stat->accepted);
     406                free(stat);
     407        }
    403408       
    404409        if (output)
Note: See TracChangeset for help on using the changeset viewer.