Changeset f625817 for lib/libtrace.h.in


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/libtrace.h.in

    rd420777 rf625817  
    252252/** Opaque structure holding information about libtrace thread */
    253253typedef struct libtrace_thread_t libtrace_thread_t;
     254
     255/** Opaque structure holding callback functions for libtrace threads */
     256typedef struct callback_set libtrace_callback_set_t;
    254257
    255258/** If the packet has allocated its own memory the buffer_control should be
     
    14801483DLLEXPORT void trace_destroy_output(libtrace_out_t *trace);
    14811484
     1485/** Create a callback set that can be used to define callbacks for parallel
     1486  * libtrace threads.
     1487  *
     1488  * @return A pointer to a freshly allocated callback set.
     1489  */
     1490DLLEXPORT libtrace_callback_set_t *trace_create_callback_set();
     1491
     1492/** Destroys a callback set, freeing up an resources it was using.
     1493 *
     1494 * @param cbset         The callback set to be destroyed.
     1495 */
     1496DLLEXPORT void trace_destroy_callback_set(libtrace_callback_set_t *cbset);
     1497
     1498
    14821499/** Check (and clear) the current error state of an input trace
    14831500 * @param trace         The input trace to check the error state on
Note: See TracChangeset for help on using the changeset viewer.