Changeset 62b2d97
- Timestamp:
- 01/08/19 09:40:10 (2 years ago)
- Branches:
- develop
- Children:
- 3c828b8
- Parents:
- f47025d
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace_int.h
r37ee856 r62b2d97 294 294 fn_cb_dataless message_pausing; 295 295 fn_cb_packet message_packet; 296 fn_cb_packet message_meta_packet; 296 297 fn_cb_result message_result; 297 298 fn_cb_first_packet message_first_packet; -
lib/libtrace_parallel.h
rc22a4bb r62b2d97 135 135 */ 136 136 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, 137 142 138 143 /** A libtrace result is ready, this will trigger the result callback … … 519 524 520 525 /** 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 */ 538 typedef 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 /** 521 545 * Callback for handling a result message. Should only be required by the 522 546 * reporter thread. … … 599 623 DLLEXPORT int trace_set_packet_cb(libtrace_callback_set_t *cbset, 600 624 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 */ 633 DLLEXPORT int trace_set_meta_packet_cb(libtrace_callback_set_t *cbset, 634 fn_cb_meta_packet handler); 601 635 602 636 /** -
lib/trace_parallel.c
r9c46b65 r62b2d97 242 242 case MESSAGE_PACKET: 243 243 return; 244 } 245 244 case MESSAGE_META_PACKET: 245 return; 246 } 246 247 if (fn) 247 248 (*fn)(trace, thread, trace->global_blob, thread->user_data); … … 496 497 t->accepted_packets++; 497 498 } 498 if (trace->perpkt_cbs->message_packet) 499 *packet = (*trace->perpkt_cbs->message_packet)(trace, t, trace->global_blob, t->user_data, *packet); 499 500 /* If packet is meta call the meta callback */ 501 if (IS_LIBTRACE_META_PACKET((*packet))) { 502 if (trace->perpkt_cbs->message_meta_packet) { 503 *packet = (*trace->perpkt_cbs->message_meta_packet)(trace, t, trace->global_blob, 504 t->user_data, *packet); 505 } 506 } else { 507 if (trace->perpkt_cbs->message_packet) { 508 *packet = (*trace->perpkt_cbs->message_packet)(trace, t, trace->global_blob, t->user_data, 509 *packet); 510 } 511 } 500 512 trace_fin_packet(*packet); 501 513 } else { … … 2035 2047 fn_cb_packet handler) { 2036 2048 cbset->message_packet = handler; 2049 return 0; 2050 } 2051 2052 DLLEXPORT int trace_set_meta_packet_cb(libtrace_callback_set_t *cbset, 2053 fn_cb_meta_packet handler) { 2054 cbset->message_meta_packet = handler; 2037 2055 return 0; 2038 2056 }
Note: See TracChangeset
for help on using the changeset viewer.