Changeset 3d4fb8f for tools/tracedump


Ignore:
Timestamp:
03/13/06 11:01:18 (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:
32f365f
Parents:
8f80e87
Message:

Cleanup the tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracedump/tracedump.cc

    rd56089a r3d4fb8f  
    1313        "-f --filter=expr       BPF filter specification, quoted\n"
    1414        "-c --count=num         terminate after num packets\n"
    15         ,argv0);
     15                ,argv0);
    1616        exit(0);
    1717}
     
    6161                trace = trace_create(argv[optind]);
    6262                numpackets = 0;
    63                 if (!trace) {
    64                         errx(1,"Failed to open trace");
     63                if (trace_is_err(trace)) {
     64                        trace_perror(trace,"trace_create");
     65                        trace_destroy(trace);
     66                        continue;
    6567                }
    6668
     69                trace_start(trace);
    6770                while(trace_read_packet(trace,packet)> 0 ){
    6871                        if (filter && !trace_bpf_filter(filter,packet))
     
    7073
    7174                        trace_dump_packet(packet);
     75
    7276                        if(count) {
    7377                                numpackets++;
Note: See TracChangeset for help on using the changeset viewer.