Cleanup: move to kernel style SPDX license identifiers
[lttng-modules.git] / instrumentation / events / lttng-module / irq.h
index 8517414bde017d245d1bced5729852f31656e826..6f66a5e0fd6f6e62fba7df3732507c26700eab76 100644 (file)
@@ -1,10 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM irq
 
 #if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
 #define LTTNG_TRACE_IRQ_H
 
-#include "../../../probes/lttng-tracepoint-event.h"
+#include <probes/lttng-tracepoint-event.h>
 
 #ifndef _TRACE_IRQ_DEF_
 #define _TRACE_IRQ_DEF_
 struct irqaction;
 struct softirq_action;
 
-#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
-#define show_softirq_name(val)                         \
-       __print_symbolic(val,                           \
-                        softirq_name(HI),              \
-                        softirq_name(TIMER),           \
-                        softirq_name(NET_TX),          \
-                        softirq_name(NET_RX),          \
-                        softirq_name(BLOCK),           \
-                        softirq_name(BLOCK_IOPOLL),    \
-                        softirq_name(TASKLET),         \
-                        softirq_name(SCHED),           \
-                        softirq_name(HRTIMER),         \
-                        softirq_name(RCU))
-
 #endif /* _TRACE_IRQ_DEF_ */
 
 /**
@@ -45,17 +32,10 @@ LTTNG_TRACEPOINT_EVENT(irq_handler_entry,
 
        TP_ARGS(irq, action),
 
-       TP_STRUCT__entry(
-               __field(        int,    irq             )
-               __string(       name,   action->name    )
-       ),
-
-       TP_fast_assign(
-               tp_assign(irq, irq)
-               tp_strcpy(name, action->name)
-       ),
-
-       TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
+       TP_FIELDS(
+               ctf_integer(int, irq, irq)
+               ctf_string(name, action->name)
+       )
 )
 
 /**
@@ -75,37 +55,22 @@ LTTNG_TRACEPOINT_EVENT(irq_handler_exit,
 
        TP_ARGS(irq, action, ret),
 
-       TP_STRUCT__entry(
-               __field(        int,    irq     )
-               __field(        int,    ret     )
-       ),
-
-       TP_fast_assign(
-               tp_assign(irq, irq)
-               tp_assign(ret, ret)
-       ),
-
-       TP_printk("irq=%d ret=%s",
-                 __entry->irq, __entry->ret ? "handled" : "unhandled")
+       TP_FIELDS(
+               ctf_integer(int, irq, irq)
+               ctf_integer(int, ret, ret)
+       )
 )
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
-LTTNG_TRACEPOINT_EVENT_CLASS(softirq,
+LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq,
 
        TP_PROTO(unsigned int vec_nr),
 
        TP_ARGS(vec_nr),
 
-       TP_STRUCT__entry(
-               __field(        unsigned int,   vec     )
-       ),
-
-       TP_fast_assign(
-               tp_assign(vec, vec_nr)
-       ),
-
-       TP_printk("vec=%u [action=%s]", __entry->vec,
-                 show_softirq_name(__entry->vec))
+       TP_FIELDS(
+               ctf_integer(unsigned int, vec, vec_nr)
+       )
 )
 
 /**
@@ -115,7 +80,9 @@ LTTNG_TRACEPOINT_EVENT_CLASS(softirq,
  * When used in combination with the softirq_exit tracepoint
  * we can determine the softirq handler runtine.
  */
-LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry,
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry,
+
+       irq_softirq_entry,
 
        TP_PROTO(unsigned int vec_nr),
 
@@ -129,7 +96,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry,
  * When used in combination with the softirq_entry tracepoint
  * we can determine the softirq handler runtine.
  */
-LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit,
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit,
+
+       irq_softirq_exit,
 
        TP_PROTO(unsigned int vec_nr),
 
@@ -143,29 +112,24 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit,
  * 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,
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise,
+
+       irq_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,
+LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq,
 
        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))
+       TP_FIELDS(
+               ctf_integer(unsigned int, vec, (int)(h - vec))
+       )
 )
 
 /**
@@ -176,7 +140,9 @@ LTTNG_TRACEPOINT_EVENT_CLASS(softirq,
  * When used in combination with the softirq_exit tracepoint
  * we can determine the softirq handler runtine.
  */
-LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry,
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry,
+
+       irq_softirq_entry,
 
        TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
 
@@ -191,7 +157,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry,
  * When used in combination with the softirq_entry tracepoint
  * we can determine the softirq handler runtine.
  */
-LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit,
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit,
+
+       irq_softirq_exit,
 
        TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
 
@@ -206,7 +174,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit,
  * 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,
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise,
+
+       irq_softirq_raise,
 
        TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
 
@@ -217,4 +187,4 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise,
 #endif /*  LTTNG_TRACE_IRQ_H */
 
 /* This part must be outside protection */
-#include "../../../probes/define_trace.h"
+#include <probes/define_trace.h>
This page took 0.024752 seconds and 4 git commands to generate.