From e2285f3b95e837eedf5c0c548a1871a97876b973 Mon Sep 17 00:00:00 2001 From: Christopher Wecht Date: Tue, 23 Jan 2024 15:56:51 +0100 Subject: [PATCH] Add timestamp to rmw_publish tracepoint (#74) Signed-off-by: Christopher Wecht --- tracetools/include/tracetools/tp_call.h | 6 +++++- tracetools/include/tracetools/tracetools.h | 4 +++- tracetools/src/tracetools.c | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tracetools/include/tracetools/tp_call.h b/tracetools/include/tracetools/tp_call.h index 8c09e020..99dbe570 100644 --- a/tracetools/include/tracetools/tp_call.h +++ b/tracetools/include/tracetools/tp_call.h @@ -137,10 +137,14 @@ TRACEPOINT_EVENT( TRACEPOINT_PROVIDER, rmw_publish, TP_ARGS( - const void *, message_arg + const void *, publisher_handle_arg, + const void *, message_arg, + int64_t, timestamp_arg ), TP_FIELDS( + ctf_integer_hex(const void *, publisher_handle, publisher_handle_arg) ctf_integer_hex(const void *, message, message_arg) + ctf_integer(int64_t, timestamp, timestamp_arg) ) ) diff --git a/tracetools/include/tracetools/tracetools.h b/tracetools/include/tracetools/tracetools.h index 9a2ae935..8b41b62c 100644 --- a/tracetools/include/tracetools/tracetools.h +++ b/tracetools/include/tracetools/tracetools.h @@ -274,7 +274,9 @@ _DECLARE_TRACEPOINT( */ _DECLARE_TRACEPOINT( rmw_publish, - const void * message) + const void * publisher_handle, + const void * message, + int64_t timestamp) /// `rmw_subscription_init` /** diff --git a/tracetools/src/tracetools.c b/tracetools/src/tracetools.c index 0f3b47e9..d5cabbbd 100644 --- a/tracetools/src/tracetools.c +++ b/tracetools/src/tracetools.c @@ -156,9 +156,13 @@ DEFINE_TRACEPOINT( DEFINE_TRACEPOINT( rmw_publish, TRACEPOINT_PARAMS( - const void * message), + const void * publisher_handle, + const void * message, + int64_t timestamp), TRACEPOINT_ARGS( - message)) + publisher_handle, + message, + timestamp)) DEFINE_TRACEPOINT( rmw_subscription_init,