Rename LTTng instrumentation macros
[lttng-modules.git] / instrumentation / events / lttng-module / irq.h
index 344015d4654a471bb2d187fade10bca30dba1f8d..8517414bde017d245d1bced5729852f31656e826 100644 (file)
@@ -1,10 +1,10 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM irq
 
-#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_IRQ_H
+#if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
+#define LTTNG_TRACE_IRQ_H
 
-#include <linux/tracepoint.h>
+#include "../../../probes/lttng-tracepoint-event.h"
 
 #ifndef _TRACE_IRQ_DEF_
 #define _TRACE_IRQ_DEF_
@@ -39,7 +39,7 @@ struct softirq_action;
  * conjunction with the irq_handler_exit tracepoint, we can figure
  * out irq handler latencies.
  */
-TRACE_EVENT(irq_handler_entry,
+LTTNG_TRACEPOINT_EVENT(irq_handler_entry,
 
        TP_PROTO(int irq, struct irqaction *action),
 
@@ -69,7 +69,7 @@ TRACE_EVENT(irq_handler_entry,
  * a shared irq line, or the irq was not handled successfully. Can be used in
  * conjunction with the irq_handler_entry to understand irq handler latencies.
  */
-TRACE_EVENT(irq_handler_exit,
+LTTNG_TRACEPOINT_EVENT(irq_handler_exit,
 
        TP_PROTO(int irq, struct irqaction *action, int ret),
 
@@ -89,7 +89,8 @@ TRACE_EVENT(irq_handler_exit,
                  __entry->irq, __entry->ret ? "handled" : "unhandled")
 )
 
-DECLARE_EVENT_CLASS(softirq,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+LTTNG_TRACEPOINT_EVENT_CLASS(softirq,
 
        TP_PROTO(unsigned int vec_nr),
 
@@ -114,7 +115,7 @@ DECLARE_EVENT_CLASS(softirq,
  * When used in combination with the softirq_exit tracepoint
  * we can determine the softirq handler runtine.
  */
-DEFINE_EVENT(softirq, softirq_entry,
+LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry,
 
        TP_PROTO(unsigned int vec_nr),
 
@@ -128,7 +129,7 @@ DEFINE_EVENT(softirq, softirq_entry,
  * When used in combination with the softirq_entry tracepoint
  * we can determine the softirq handler runtine.
  */
-DEFINE_EVENT(softirq, softirq_exit,
+LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit,
 
        TP_PROTO(unsigned int vec_nr),
 
@@ -142,14 +143,78 @@ DEFINE_EVENT(softirq, softirq_exit,
  * When used in combination with the softirq_entry tracepoint
  * we can determine the softirq raise to run latency.
  */
-DEFINE_EVENT(softirq, softirq_raise,
+LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise,
 
        TP_PROTO(unsigned int vec_nr),
 
        TP_ARGS(vec_nr)
 )
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
+LTTNG_TRACEPOINT_EVENT_CLASS(softirq,
 
-#endif /*  _TRACE_IRQ_H */
+       TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+
+       TP_ARGS(h, vec),
+
+       TP_STRUCT__entry(
+               __field(        unsigned int,   vec     )
+       ),
+
+       TP_fast_assign(
+               tp_assign(vec, (int)(h - vec))
+       ),
+
+       TP_printk("vec=%u [action=%s]", __entry->vec,
+                 show_softirq_name(__entry->vec))
+)
+
+/**
+ * softirq_entry - called immediately before the softirq handler
+ * @h: pointer to struct softirq_action
+ * @vec: pointer to first struct softirq_action in softirq_vec array
+ *
+ * When used in combination with the softirq_exit tracepoint
+ * we can determine the softirq handler runtine.
+ */
+LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry,
+
+       TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+
+       TP_ARGS(h, vec)
+)
+
+/**
+ * softirq_exit - called immediately after the softirq handler returns
+ * @h: pointer to struct softirq_action
+ * @vec: pointer to first struct softirq_action in softirq_vec array
+ *
+ * When used in combination with the softirq_entry tracepoint
+ * we can determine the softirq handler runtine.
+ */
+LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit,
+
+       TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+
+       TP_ARGS(h, vec)
+)
+
+/**
+ * softirq_raise - called immediately when a softirq is raised
+ * @h: pointer to struct softirq_action
+ * @vec: pointer to first struct softirq_action in softirq_vec array
+ *
+ * When used in combination with the softirq_entry tracepoint
+ * we can determine the softirq raise to run latency.
+ */
+LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise,
+
+       TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+
+       TP_ARGS(h, vec)
+)
+#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
+
+#endif /*  LTTNG_TRACE_IRQ_H */
 
 /* This part must be outside protection */
 #include "../../../probes/define_trace.h"
This page took 0.025443 seconds and 4 git commands to generate.