[v2,17/32] eal/trace: add alarm tracepoints
diff mbox series

Message ID 20200325211603.240288-18-jerinj@marvell.com
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • DPDK Trace support
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Jerin Jacob Kollanukkaran March 25, 2020, 9:15 p.m. UTC
From: Jerin Jacob <jerinj@marvell.com>

Add following alarm related trace points.

rte_trace_lib_eal_alarm_set()
rte_trace_lib_eal_alarm_cancel()

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 .../common/eal_common_trace_points.c           |  9 +++++++++
 lib/librte_eal/common/include/rte_trace_eal.h  | 18 ++++++++++++++++++
 lib/librte_eal/freebsd/eal/eal_alarm.c         |  3 +++
 lib/librte_eal/linux/eal/eal_alarm.c           |  4 ++++
 lib/librte_eal/rte_eal_version.map             |  2 ++
 5 files changed, 36 insertions(+)

Patch
diff mbox series

diff --git a/lib/librte_eal/common/eal_common_trace_points.c b/lib/librte_eal/common/eal_common_trace_points.c
index ff521c981..16261b1d6 100644
--- a/lib/librte_eal/common/eal_common_trace_points.c
+++ b/lib/librte_eal/common/eal_common_trace_points.c
@@ -23,6 +23,9 @@  RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_generic_ptr);
 RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_generic_str);
 RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_generic_func);
 
+RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_alarm_set);
+RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_alarm_cancel);
+
 RTE_INIT(eal_trace_init)
 {
 	RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_generic_void,
@@ -57,4 +60,10 @@  RTE_INIT(eal_trace_init)
 				 lib.eal.generic.string, INFO);
 	RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_generic_func,
 				 lib.eal.generic.func, INFO);
+
+	RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_alarm_set,
+				 lib.eal.alarm.set, INFO);
+	RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_alarm_cancel,
+				 lib.eal.alarm.cancel, INFO);
+
 }
diff --git a/lib/librte_eal/common/include/rte_trace_eal.h b/lib/librte_eal/common/include/rte_trace_eal.h
index 269ef7502..df1b3854b 100644
--- a/lib/librte_eal/common/include/rte_trace_eal.h
+++ b/lib/librte_eal/common/include/rte_trace_eal.h
@@ -15,6 +15,7 @@ 
 extern "C" {
 #endif
 
+#include <rte_alarm.h>
 #include <rte_trace.h>
 
 /* Generic */
@@ -115,6 +116,23 @@  RTE_TRACE_POINT(
 
 #define RTE_TRACE_LIB_EAL_GENERIC_FUNC rte_trace_lib_eal_generic_func(__func__)
 
+/* Alarm */
+RTE_TRACE_POINT(
+	rte_trace_lib_eal_alarm_set,
+	RTE_TRACE_POINT_ARGS(uint64_t us, rte_eal_alarm_callback cb_fn,
+			     void *cb_arg, int rc),
+	rte_trace_ctf_u64(us); rte_trace_ctf_ptr(cb_fn);
+	rte_trace_ctf_ptr(cb_arg); rte_trace_ctf_int(rc);
+)
+
+RTE_TRACE_POINT(
+	rte_trace_lib_eal_alarm_cancel,
+	RTE_TRACE_POINT_ARGS(rte_eal_alarm_callback cb_fn, void *cb_arg,
+			     int count),
+	rte_trace_ctf_ptr(cb_fn); rte_trace_ctf_ptr(cb_arg);
+	rte_trace_ctf_int(count);
+)
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/freebsd/eal/eal_alarm.c b/lib/librte_eal/freebsd/eal/eal_alarm.c
index 51ea4b8c0..5f03ab4c4 100644
--- a/lib/librte_eal/freebsd/eal/eal_alarm.c
+++ b/lib/librte_eal/freebsd/eal/eal_alarm.c
@@ -17,6 +17,7 @@ 
 #include <rte_errno.h>
 #include <rte_interrupts.h>
 #include <rte_spinlock.h>
+#include <rte_trace_eal.h>
 
 #include "eal_private.h"
 #include "eal_alarm_private.h"
@@ -223,6 +224,7 @@  rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb_fn, void *cb_arg)
 
 	rte_spinlock_unlock(&alarm_list_lk);
 
+	rte_trace_lib_eal_alarm_set(us, cb_fn, cb_arg, ret);
 	return ret;
 }
 
@@ -310,5 +312,6 @@  rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn, void *cb_arg)
 
 	rte_spinlock_unlock(&alarm_list_lk);
 
+	rte_trace_lib_eal_alarm_cancel(cb_fn, cb_arg, count);
 	return count;
 }
diff --git a/lib/librte_eal/linux/eal/eal_alarm.c b/lib/librte_eal/linux/eal/eal_alarm.c
index 0924c9205..9fef3e6c8 100644
--- a/lib/librte_eal/linux/eal/eal_alarm.c
+++ b/lib/librte_eal/linux/eal/eal_alarm.c
@@ -20,6 +20,8 @@ 
 #include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
+#include <rte_trace_eal.h>
+
 #include <eal_private.h>
 
 #ifndef	TFD_NONBLOCK
@@ -172,6 +174,7 @@  rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb_fn, void *cb_arg)
 	}
 	rte_spinlock_unlock(&alarm_list_lk);
 
+	rte_trace_lib_eal_alarm_set(us, cb_fn, cb_arg, ret);
 	return ret;
 }
 
@@ -240,5 +243,6 @@  rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn, void *cb_arg)
 	else if (err)
 		rte_errno = err;
 
+	rte_trace_lib_eal_alarm_cancel(cb_fn, cb_arg, count);
 	return count;
 }
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 9d56715b6..d1c4c10de 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -381,4 +381,6 @@  EXPERIMENTAL {
 	__rte_trace_lib_eal_generic_ptr;
 	__rte_trace_lib_eal_generic_str;
 	__rte_trace_lib_eal_generic_func;
+	__rte_trace_lib_eal_alarm_set;
+	__rte_trace_lib_eal_alarm_cancel;
 };