Skip to content

Commit 43f23b7

Browse files
committed
feat: add tracepoints definition compatible to caret v0.2
Signed-off-by: hsgwa <[email protected]>
1 parent 638fa0a commit 43f23b7

File tree

3 files changed

+150
-5
lines changed

3 files changed

+150
-5
lines changed

tracetools/include/tracetools/tp_call.h

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ TRACEPOINT_EVENT(
100100
TRACEPOINT_PROVIDER,
101101
rclcpp_publish,
102102
TP_ARGS(
103-
const void *, message_arg
103+
const void *, publisher_handle_arg,
104+
const void *, message_arg,
105+
const uint64_t, message_timestamp_arg
104106
),
105107
TP_FIELDS(
108+
ctf_integer_hex(const void *, publisher_handle, publisher_handle_arg)
106109
ctf_integer_hex(const void *, message, message_arg)
110+
ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg)
107111
)
108112
)
109113

@@ -408,6 +412,66 @@ TRACEPOINT_EVENT(
408412
)
409413
)
410414

415+
TRACEPOINT_EVENT(
416+
TRACEPOINT_PROVIDER,
417+
message_construct,
418+
TP_ARGS(
419+
const void *, original_message_arg,
420+
const void *, constructed_message_arg
421+
),
422+
TP_FIELDS(
423+
ctf_integer_hex(const void *, original_message, original_message_arg)
424+
ctf_integer_hex(const void *, constructed_message, constructed_message_arg)
425+
)
426+
)
427+
428+
TRACEPOINT_EVENT(
429+
TRACEPOINT_PROVIDER,
430+
rclcpp_intra_publish,
431+
TP_ARGS(
432+
const void *, publisher_handle_arg,
433+
const void *, message_arg,
434+
const uint64_t, message_timestamp_arg
435+
),
436+
TP_FIELDS(
437+
ctf_integer_hex(const void *, publisher_handle, publisher_handle_arg)
438+
ctf_integer_hex(const void *, message, message_arg)
439+
ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg)
440+
)
441+
)
442+
443+
TRACEPOINT_EVENT(
444+
TRACEPOINT_PROVIDER,
445+
dispatch_subscription_callback,
446+
TP_ARGS(
447+
const void *, message_arg,
448+
const void *, callback_arg,
449+
const uint64_t, source_timestamp_arg,
450+
const uint64_t, message_timestamp_arg
451+
),
452+
TP_FIELDS(
453+
ctf_integer_hex(const void *, message, message_arg)
454+
ctf_integer_hex(const void *, callback, callback_arg)
455+
ctf_integer(const uint64_t, source_stamp, source_timestamp_arg)
456+
ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg)
457+
)
458+
)
459+
460+
TRACEPOINT_EVENT(
461+
TRACEPOINT_PROVIDER,
462+
dispatch_intra_process_subscription_callback,
463+
TP_ARGS(
464+
const void *, message_arg,
465+
const void *, callback_arg,
466+
const uint64_t, message_timestamp_arg
467+
),
468+
TP_FIELDS(
469+
ctf_integer_hex(const void *, message, message_arg)
470+
ctf_integer_hex(const void *, callback, callback_arg)
471+
ctf_integer(const uint64_t, message_timestamp, message_timestamp_arg)
472+
)
473+
)
474+
411475
#endif // _TRACETOOLS__TP_CALL_H_
412476

413477
#include <lttng/tracepoint-event.h>

tracetools/include/tracetools/tracetools.h

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@ DECLARE_TRACEPOINT(
163163
*
164164
* \param[in] publisher_handle not used, but kept for API/ABI stability
165165
* \param[in] message pointer to the message being published
166+
* \param[in] timestamp of message header
166167
*/
167168
DECLARE_TRACEPOINT(
168169
rclcpp_publish,
169170
const void * publisher_handle,
170-
const void * message)
171+
const void * message,
172+
const uint64_t message_timestamp)
171173

172174
/// `rcl_publish`
173175
/**
@@ -482,6 +484,30 @@ DECLARE_TRACEPOINT(
482484
rclcpp_executor_execute,
483485
const void * handle)
484486

487+
DECLARE_TRACEPOINT(
488+
message_construct,
489+
const void * original_message,
490+
const void * constructed_message)
491+
492+
DECLARE_TRACEPOINT(
493+
rclcpp_intra_publish,
494+
const void * publisher_handle,
495+
const void * message,
496+
const uint64_t message_timestamp)
497+
498+
DECLARE_TRACEPOINT(
499+
dispatch_subscription_callback,
500+
const void * message,
501+
const void * callback,
502+
const uint64_t source_timestamp,
503+
const uint64_t message_timestamp)
504+
505+
DECLARE_TRACEPOINT(
506+
dispatch_intra_process_subscription_callback,
507+
const void * message,
508+
const void * callback,
509+
const uint64_t message_timestamp)
510+
485511
#ifdef __cplusplus
486512
}
487513
#endif

tracetools/src/tracetools.c

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ void TRACEPOINT(
9797
void TRACEPOINT(
9898
rclcpp_publish,
9999
const void * publisher_handle,
100-
const void * message)
100+
const void * message,
101+
const uint64_t message_timestamp)
101102
{
102-
(void)publisher_handle;
103103
CONDITIONAL_TP(
104104
rclcpp_publish,
105-
message);
105+
publisher_handle,
106+
message,
107+
message_timestamp);
106108
}
107109

108110
void TRACEPOINT(
@@ -362,6 +364,59 @@ void TRACEPOINT(
362364
handle);
363365
}
364366

367+
void TRACEPOINT(
368+
message_construct,
369+
const void * original_message,
370+
const void * constructed_message)
371+
{
372+
CONDITIONAL_TP(
373+
message_construct,
374+
original_message,
375+
constructed_message);
376+
}
377+
378+
void TRACEPOINT(
379+
rclcpp_intra_publish,
380+
const void * publisher_handle,
381+
const void * message,
382+
const uint64_t message_timestamp
383+
)
384+
{
385+
CONDITIONAL_TP(
386+
rclcpp_intra_publish,
387+
publisher_handle,
388+
message,
389+
message_timestamp);
390+
}
391+
392+
void TRACEPOINT(
393+
dispatch_subscription_callback,
394+
const void * message,
395+
const void * callback,
396+
const uint64_t source_stamp,
397+
const uint64_t message_timestamp)
398+
{
399+
CONDITIONAL_TP(
400+
dispatch_subscription_callback,
401+
message,
402+
callback,
403+
source_stamp,
404+
message_timestamp);
405+
}
406+
407+
void TRACEPOINT(
408+
dispatch_intra_process_subscription_callback,
409+
const void * message,
410+
const void * callback,
411+
const uint64_t message_timestamp)
412+
{
413+
CONDITIONAL_TP(
414+
dispatch_intra_process_subscription_callback,
415+
message,
416+
callback,
417+
message_timestamp);
418+
}
419+
365420
#ifndef _WIN32
366421
# pragma GCC diagnostic pop
367422
#else

0 commit comments

Comments
 (0)