Ignore:
Timestamp:
11/09/18 09:03:00 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
2f07199
Parents:
6984c96
Message:

Fixes to offline trace proccessing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/tutorial/ipdist-parallel.c

    r6984c96 r3687ca2  
    143143        struct addr_local *local = (struct addr_local *)tls;
    144144
     145        /* If this is the first packet set the lastkey to the packets timestamp */
     146        if(local->lastkey == 0) {
     147                local->lastkey = trace_get_erf_timestamp(packet);
     148        }
     149
    145150        /* Increment the packet count */
    146151        local->packets += 1;
     
    171176                uint64_t timestamp = trace_get_erf_timestamp(packet);
    172177
    173                 /* We only want to call per_tick if we are due to output something */
     178                /* We only want to call per_tick if we are due to output something
     179                 * Right shifting these converts them to seconds */
    174180                if((timestamp >> 32) >= (local->lastkey >> 32) + (tickrate/1000)) {
    175181                        per_tick(trace, thread,global, local, timestamp);
     
    194200        for(i=0;i<256;i++) {
    195201                result->src[i] = local->src[i];
    196                 result->src[i] = local->src[i];
     202                result->dst[i] = local->dst[i];
    197203        }
    198204        result->packets = local->packets;
    199205
    200         /* This will not cause the result to be printed but will atleast end up going into our tally
    201          * The reporter thread can then deal with it when it closes */
     206        /* Send the final results to the combiner */
    202207        trace_publish_result(trace, thread, 0, (libtrace_generic_t){.ptr=result}, RESULT_USER);
    203208
     
    318323        /* If there is any remaining data in the tally plot it */
    319324        if(tally->packets > 0) {
    320                 plot_results(tally, (tally->lastkey >> 32) + tickrate);
     325                plot_results(tally, (tally->lastkey >> 32) + 1);
    321326        }
    322327        /* Cleanup tally results*/
Note: See TracChangeset for help on using the changeset viewer.