Changeset 7be3cc4 for tools/tracereport


Ignore:
Timestamp:
04/21/07 15:25:12 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, 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:
4df814d
Parents:
171cc28
Message:

Add start time, end time, duration, packets and packets per second reports.
Fixes #236
Make the default "all reports" instead of "no reports" for less surprise
value.

Location:
tools/tracereport
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • tools/tracereport/Makefile.am

    r051618c r7be3cc4  
    1616        error_report.c\
    1717        flow_report.c\
     18        misc_report.c\
    1819        port_report.c\
    1920        protocol_report.c\
  • tools/tracereport/report.h

    r051618c r7be3cc4  
    55void error_per_packet(struct libtrace_packet_t *packet);
    66void flow_per_packet(struct libtrace_packet_t *packet);
     7void misc_per_packet(struct libtrace_packet_t *packet);
    78void port_per_packet(struct libtrace_packet_t *packet);
    89void protocol_per_packet(struct libtrace_packet_t *packet);
     
    1819void error_report(void);
    1920void flow_report(void);
     21void misc_report(void);
    2022void port_report(void);
    2123void protocol_report(void);
  • tools/tracereport/tracereport.1

    r634089d r7be3cc4  
    77[ \fB-e \fR| \fB --error \fR]
    88[ \fB-F \fR| \fB --flow \fR]
     9[ \fB-m \fR| \fB --misc \fR]
    910[ \fB-P \fR| \fB --protocol \fR]
    1011[ \fB-p \fR| \fB --port \fR]
     
    4950.BI \-\^\-flow
    5051Produces a report on the number of flows observed in the trace
     52
     53.TP
     54.PD 0
     55.BI \-m
     56.TP
     57.PD 0
     58.BI \-\^\-misc
     59Provides a report listing the time of the first packet, and the time of the
     60last packet in the trace, the duration, the total number of packets in the
     61trace, and the average number of packets per second.
    5162
    5263.TP
  • tools/tracereport/tracereport.c

    r051618c r7be3cc4  
    8484                        break;
    8585                }
     86                if (reports_required & REPORT_TYPE_MISC)
     87                        misc_per_packet(packet);
    8688                if (reports_required & REPORT_TYPE_ERROR)
    8789                        error_per_packet(packet);
     
    119121        "-e --error             Report packet errors (e.g. checksum failures, rxerrors)\n"
    120122        "-F --flow              Report flows\n"
     123        "-m --misc              Report misc information (start/end times, duration, pps)\n"
    121124        "-P --protocol          Report transport protocols\n"
    122125        "-p --port              Report port numbers\n"
     
    151154                        { "protocol",           0, 0, 'P' },
    152155                        { "port",               0, 0, 'p' },
     156                        { "misc",               0, 0, 'm' },
    153157                        { "tos",                0, 0, 'T' },
    154158                        { "ttl",                0, 0, 't' },
     
    161165                        { NULL,                 0, 0, 0 }
    162166                };
    163                 opt = getopt_long(argc, argv, "f:HeFPpTtOondCs", long_options,
     167                opt = getopt_long(argc, argv, "f:HeFmPpTtOondCs", long_options,
    164168                                &option_index);
    165169                if (opt == -1)
     
    194198                                reports_required |= REPORT_TYPE_SYNOPT;
    195199                                break;
     200                        case 'm':
     201                                reports_required |= REPORT_TYPE_MISC;
     202                                break;
    196203                        case 'P':
    197204                                reports_required |= REPORT_TYPE_PROTO;
     
    213220                }
    214221        }
     222
     223        /* Default to all reports, instead of no reports at all.  It's annoying
     224         * waiting for 10 minutes for a trace to process then discover you
     225         * forgot to ask for any reports!
     226         */
     227        if (reports_required == 0)
     228                reports_required = ~0;
    215229
    216230        if (filterstring) {
     
    227241        }
    228242
     243        if (reports_required & REPORT_TYPE_MISC)
     244                misc_report();
    229245        if (reports_required & REPORT_TYPE_ERROR)
    230246                error_report();
  • tools/tracereport/tracereport.h

    r051618c r7be3cc4  
    1919        REPORT_TYPE_ECN = 1 << 9,
    2020        REPORT_TYPE_TCPSEG = 1 << 10,
    21         REPORT_TYPE_SYNOPT = 1 << 11
     21        REPORT_TYPE_SYNOPT = 1 << 11,
     22        REPORT_TYPE_MISC = 1 << 12
    2223} report_type_t;
    2324
Note: See TracChangeset for help on using the changeset viewer.