Ignore:
Timestamp:
09/11/15 15:00:27 (6 years ago)
Author:
Shane Alcock <salcock@…>
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:
322c516
Parents:
8c7490fe
Message:

Reworked callback API and removed old per_msg and reporter functions

Updated tracertstats to use the new callback API.

Extended the callback approach to the reporter thread as well as the per
packet threads.

Added libtrace_callback_set_t structure, which is used to register the
user callback functions.

Added callback functionality for MESSAGE_RESULT (needed now that reporter
threads also do callbacks) and MESSAGE_USER (for user-defined messages). The
MESSAGE_USER callback is essentially the same as the old per_msg function
style.

Updated combiners to use send_message to pass results to the reporter thread.
send_message itself is now no longer static, so that combiners can use it.

Disabled building of tracestats_parallel as it was using the older version
of the callback API. Will update in a future commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/combiner_ordered.c

    r3dd5acc rf625817  
    6565                                libtrace_generic_t gt = {.res = &r};
    6666                                ASSERT_RET (libtrace_deque_pop_front(v, (void *) &r), == 1);
    67                                 trace->reporter(trace, MESSAGE_RESULT, gt, &trace->reporter_thread);
     67                                send_message(trace, &trace->reporter_thread,
     68                                                MESSAGE_RESULT, gt,
     69                                                &trace->reporter_thread);
    6870                                return 0;
    6971                        }
     
    8890                                libtrace_generic_t gt = {.res = &r};
    8991                                ASSERT_RET (libtrace_deque_pop_front(v, (void *) &r), == 1);
    90                                 trace->reporter(trace, MESSAGE_RESULT, gt, &trace->reporter_thread);
     92                                send_message(trace, &trace->reporter_thread,
     93                                                MESSAGE_RESULT, gt,
     94                                                &trace->reporter_thread);
    9195                                return 0;
    9296                        }
     
    152156
    153157                ASSERT_RET (libtrace_deque_pop_front(&queues[min_queue], (void *) &r), == 1);
    154                 trace->reporter(trace, MESSAGE_RESULT, gt, &trace->reporter_thread);
     158                send_message(trace, &trace->reporter_thread,
     159                                MESSAGE_RESULT, gt,
     160                                NULL);
    155161
    156162                // Now update the one we just removed
Note: See TracChangeset for help on using the changeset viewer.