Ignore:
Timestamp:
01/08/19 09:40:10 (22 months ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
3c828b8
Parents:
f47025d
Message:

Add callback for meta packets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    rc22a4bb r62b2d97  
    135135         */
    136136        MESSAGE_PACKET,
     137
     138        /** A libtrace meta packet is ready, this will trigger the meta packet
     139         *  callback for the processing threads.
     140         */
     141        MESSAGE_META_PACKET,
    137142
    138143        /** A libtrace result is ready, this will trigger the result callback
     
    519524
    520525/**
     526 * A callback function triggered when a processing thread receives a meta packet.
     527 *
     528 * @param libtrace The parallel trace.
     529 * @param t The thread that is running
     530 * @param global The global storage.
     531 * @param tls The thread local storage.
     532 * @param packet The packet to be processed.
     533 *
     534 * @return either the packet itself if it is not being published as a result
     535 *   or NULL otherwise. If returning NULL, it is the user's responsibility
     536 *   to ensure the packet is freed when the reporter thread is finished with it.
     537 */
     538typedef libtrace_packet_t* (*fn_cb_meta_packet)(libtrace_t *libtrace,
     539                                           libtrace_thread_t *t,
     540                                           void *global,
     541                                           void *tls,
     542                                           libtrace_packet_t *packet);
     543
     544/**
    521545 * Callback for handling a result message. Should only be required by the
    522546 * reporter thread.
     
    599623DLLEXPORT int trace_set_packet_cb(libtrace_callback_set_t *cbset,
    600624                fn_cb_packet handler);
     625
     626/**
     627 * Registers a meta packet callback against a callback set.
     628 *
     629 * @param cbset The callback set.
     630 * @param handler The meta packet callback funtion.
     631 * @return 0 if successful, -1 otherwise.
     632 */
     633DLLEXPORT int trace_set_meta_packet_cb(libtrace_callback_set_t *cbset,
     634                fn_cb_meta_packet handler);
    601635
    602636/**
Note: See TracChangeset for help on using the changeset viewer.