Changeset d994324 for tools/traceanon


Ignore:
Timestamp:
09/17/14 13:45:29 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
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:
9e429e8
Parents:
2498008
Message:

Remove anything to do with the combiner from set configuration and removes any options/storage related to these such as the next expected packet.

Instead this is done using trace_set_combiner now, and the for the built-in combiners.h header. This is a lot more flexible and allows the users to specify there own combiner, and any number of options for it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/traceanon/traceanon_parallel.c

    r2498008 rd994324  
    11#define _GNU_SOURCE
    22#include "libtrace.h"
     3#include "data-struct/vector.h"
     4#include "data-struct/message_queue.h"
     5#include "combiners.h"
    36#include <stdio.h>
    47#include <unistd.h>
     
    1114#include <assert.h>
    1215#include "ipenc.h"
    13 #include <data-struct/vector.h>
    14 #include <data-struct/message_queue.h>
    1516#include <signal.h>
    1617
     
    155156static void* per_packet(libtrace_t *trace, libtrace_packet_t *pkt, libtrace_message_t *mesg, UNUSED libtrace_thread_t *t)
    156157{
    157        
    158158        if (pkt) {
    159159                struct libtrace_ip *ipptr;
     
    190190                //libtrace_packet_t * packet_copy = trace_result_packet(trace, pkt);
    191191                //trace_publish_result(trace, trace_packet_get_order(pkt), pkt);
    192                 trace_publish_result(trace, t, trace_packet_get_order(pkt), pkt, RESULT_PACKET);
     192
     193                trace_publish_result(trace, t, trace_packet_get_order(pkt), (libtrace_generic_types_t){.pkt=pkt}, RESULT_PACKET);
    193194                //return ;
    194195        }
     
    200201                        break;
    201202                        case MESSAGE_TICK:
    202                                 trace_publish_result(trace, t, mesg->additional.uint64, NULL, RESULT_TICK);
     203                                trace_publish_result(trace, t, mesg->additional.uint64, (libtrace_generic_types_t){.pkt=NULL}, RESULT_TICK);
    203204                }
    204205        }
     
    213214        if (result) {
    214215                if (result->type == RESULT_PACKET) {
    215                         libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(result);
     216                        libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(result).pkt;
    216217                        assert(libtrace_result_get_key(result) == packet_count++);
    217218                        if (trace_write_packet(writer,packet)==-1) {
     
    422423         
    423424        int i = 1;
    424         trace_parallel_config(trace, TRACE_OPTION_ORDERED, &i);
     425        trace_set_combiner(trace, &combiner_ordered, (libtrace_generic_types_t){0});
    425426        trace_parallel_config(trace, TRACE_OPTION_SET_CONFIG, &uc);
     427
    426428        //trace_set_hasher(trace, HASHER_CUSTOM, rand_hash, NULL);
    427429       
Note: See TracChangeset for help on using the changeset viewer.