From 58d42df82d0a728cb74fd5ede0b3169659956b3e Mon Sep 17 00:00:00 2001
From: Olivier Dion <olivier.dion@savoirfairelinux.com>
Date: Fri, 10 Dec 2021 12:53:31 -0500
Subject: [PATCH] tracepoint: Add scheduled executor tracepoints

The two tracepoints are used to delimit the beginning and the end of the
execution of a task by a scheduler.  The beginning tracepoint contains all the
meta information related to the the execution context of the task and an unique
cookie.  This cookie is then reused in the end tracepoint to match the pair of
begin/end without duplication of information.

Change-Id: Ibbf64fe49325e7cb72c60aa6c9d8d8d1ab074f2a
---
 src/jami/tracepoint-def.h | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/jami/tracepoint-def.h b/src/jami/tracepoint-def.h
index 47ac84aa35..3d2d32f354 100644
--- a/src/jami/tracepoint-def.h
+++ b/src/jami/tracepoint-def.h
@@ -13,13 +13,38 @@
 
 #include <lttng/tracepoint.h>
 
+
 /*
  * Use LTTNG_UST_TRACEPOINT_EVENT(), LTTNG_UST_TRACEPOINT_EVENT_CLASS(),
  * LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(), and LTTNG_UST_TRACEPOINT_LOGLEVEL()
  * here.
  */
 
-#endif /* TRACEPOINT_H */
+LTTNG_UST_TRACEPOINT_EVENT(
+    jami,
+    scheduled_executor_task_begin,
+    LTTNG_UST_TP_ARGS(
+        const char *, executor_name,
+        const char *, filename,
+        uint32_t,     linum,
+        uint64_t,     cookie
+    ),
+    LTTNG_UST_TP_FIELDS(
+        lttng_ust_field_string(executor, executor_name)
+        lttng_ust_field_string(source_filename, filename)
+        lttng_ust_field_integer(uint32_t, source_line, linum)
+        lttng_ust_field_integer(uint64_t, cookie, cookie)
+    )
+)
+
+LTTNG_UST_TRACEPOINT_EVENT(
+    jami,
+    scheduled_executor_task_end,
+    LTTNG_UST_TP_ARGS(uint64_t, cookie),
+    LTTNG_UST_TP_FIELDS(lttng_ust_field_integer(uint64_t, cookie, cookie))
+)
+
+#endif /* TRACEPOINT_DEF_H */
 
 #include <lttng/tracepoint-event.h>
 
-- 
GitLab