Changeset 8e11beb for tools/tracemerge


Ignore:
Timestamp:
07/03/17 16:37:48 (4 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
568a341
Parents:
ed5b2ce
Message:

Update tools to properly ignore meta records and missing timestamps

pcapng introduces a lot of meta records that we should preserve as
long as possible. Since we aren't automatically discarding them,
we need to make sure that our tools do not try to treat them as
"real" packets, i.e. try to get a timestamp or capture length from
them.

Similarly, simple pcapng packet records do not have a timestamp
so we need to make sure the tools do the right thing when
trace_get_seconds() returns a timestamp of zero on a packet. For
starters, we don't want to set our "first" packet time to zero
in that case!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracemerge/tracemerge.c

    ree6e802 r8e11beb  
    213213        while(1) {
    214214                uint64_t oldest_ts=0;
     215                uint64_t this_ts = 0;
    215216                int oldest=-1;
    216217                int curr_dir;
     
    234235                                        live[i]=true;
    235236                        }
    236                         if (live[i] &&
    237                                 (oldest==-1 ||
    238                                  oldest_ts>trace_get_erf_timestamp(packet[i]))) {
    239                                 oldest=i;
    240                                 oldest_ts=trace_get_erf_timestamp(packet[i]);
    241                         }
     237                        if (live[i]) {
     238                                this_ts = trace_get_erf_timestamp(packet[i]);
     239                                if (this_ts != 0 && (oldest==-1 ||
     240                                                oldest_ts>this_ts)) {
     241                                        oldest=i;
     242                                        oldest_ts=this_ts;
     243                                }
     244                        }
    242245                }
    243246                /* We have run out of packets! */
Note: See TracChangeset for help on using the changeset viewer.