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
  • lib/combiner_sorted.c

    r2498008 rd994324  
    3636}
    3737
    38 
    39 /** Used below in trace_make_results_packets_safe*/
    40 static void do_copy_result_packet(void *data)
    41 {
    42         libtrace_result_t *res = (libtrace_result_t *)data;
    43         if (res->type == RESULT_PACKET) {
    44                 // Duplicate the packet in standard malloc'd memory and free the
    45                 // original, This is a 1:1 exchange so is ocache count remains unchanged.
    46                 libtrace_packet_t *oldpkt, *dup;
    47                 oldpkt = (libtrace_packet_t *) res->value;
    48                 dup = trace_copy_packet(oldpkt);
    49                 res->value = (void *)dup;
    50                 trace_destroy_packet(oldpkt);
    51         }
    52 }
    53 
    5438static void pause(libtrace_t *trace, libtrace_combine_t *c) {
    5539        libtrace_vector_t *queues = c->queues;
    5640        int i;
    5741        for (i = 0; i < libtrace_get_perpkt_count(trace); ++i) {
    58                 libtrace_vector_apply_function(&queues[i], &do_copy_result_packet);
     42                libtrace_vector_apply_function(&queues[i], (vector_data_fn) libtrace_make_result_safe);
    5943        }
    6044}
     
    9276}
    9377
    94 const libtrace_combine_t combiner_sorted = {
     78DLLEXPORT const libtrace_combine_t combiner_sorted = {
    9579    init_combiner,      /* initialise */
    9680        destroy,                /* destroy */
     
    10084    pause,                      /* pause */
    10185    NULL,                       /* queues */
    102     0                           /* opts */
     86    {0}                         /* opts */
    10387};
Note: See TracChangeset for help on using the changeset viewer.