Rename LTTng instrumentation macros
[lttng-modules.git] / instrumentation / events / lttng-module / rcu.h
index 8392946a74d3da24147a8ae1bd2356634be682df..42b2004c638fe3a2f8f19429e858fc98a59c77de 100644 (file)
@@ -1,10 +1,10 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM rcu
 
-#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_RCU_H
+#if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
+#define LTTNG_TRACE_RCU_H
 
-#include <linux/tracepoint.h>
+#include "../../../probes/lttng-tracepoint-event.h"
 #include <linux/version.h>
 
 /*
  * An "@" character within "<activity>" is a comment character: Data
  * reduction scripts will ignore the "@" and the remainder of the line.
  */
-TRACE_EVENT(rcu_utilization,
+LTTNG_TRACEPOINT_EVENT(rcu_utilization,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *s),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *s),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(s),
 
@@ -48,9 +52,13 @@ TRACE_EVENT(rcu_utilization,
  * and "cpuofl", respectively), and a CPU being kicked for being too
  * long in dyntick-idle mode ("kick").
  */
-TRACE_EVENT(rcu_grace_period,
+LTTNG_TRACEPOINT_EVENT(rcu_grace_period,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, gpnum, gpevent),
 
@@ -77,10 +85,15 @@ TRACE_EVENT(rcu_grace_period,
  * rcu_node structure, and the mask of CPUs that will be waited for.
  * All but the type of RCU are extracted from the rcu_node structure.
  */
-TRACE_EVENT(rcu_grace_period_init,
+LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
+                int grplo, int grphi, unsigned long qsmask),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
                 int grplo, int grphi, unsigned long qsmask),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
 
@@ -113,9 +126,13 @@ TRACE_EVENT(rcu_grace_period_init,
  * include SRCU), the grace-period number that the task is blocking
  * (the current or the next), and the task's PID.
  */
-TRACE_EVENT(rcu_preempt_task,
+LTTNG_TRACEPOINT_EVENT(rcu_preempt_task,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, pid, gpnum),
 
@@ -140,9 +157,13 @@ TRACE_EVENT(rcu_preempt_task,
  * read-side critical section exiting that critical section.  Track the
  * type of RCU (which one day might include SRCU) and the task's PID.
  */
-TRACE_EVENT(rcu_unlock_preempted_task,
+LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, gpnum, pid),
 
@@ -169,11 +190,17 @@ TRACE_EVENT(rcu_unlock_preempted_task,
  * whether there are any blocked tasks blocking the current grace period.
  * All but the type of RCU are extracted from the rcu_node structure.
  */
-TRACE_EVENT(rcu_quiescent_state_report,
+LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, unsigned long gpnum,
+                unsigned long mask, unsigned long qsmask,
+                u8 level, int grplo, int grphi, int gp_tasks),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, unsigned long gpnum,
                 unsigned long mask, unsigned long qsmask,
                 u8 level, int grplo, int grphi, int gp_tasks),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
 
@@ -213,9 +240,13 @@ TRACE_EVENT(rcu_quiescent_state_report,
  * or "kick" when kicking a CPU that has been in dyntick-idle mode for
  * too long.
  */
-TRACE_EVENT(rcu_fqs,
+LTTNG_TRACEPOINT_EVENT(rcu_fqs,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, gpnum, cpu, qsevent),
 
@@ -253,9 +284,14 @@ TRACE_EVENT(rcu_fqs,
  * events use the upper bits of each number, while interrupt-related
  * events use the lower bits.
  */
-TRACE_EVENT(rcu_dyntick,
+LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
+
+       TP_ARGS(polarity, oldnesting, newnesting),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
        TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
 
        TP_ARGS(polarity, oldnesting, newnesting),
@@ -312,9 +348,13 @@ TRACE_EVENT(rcu_dyntick,
  *     "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
  *     "Cleanup after idle": Idle exited, timer canceled.
  */
-TRACE_EVENT(rcu_prep_idle,
+LTTNG_TRACEPOINT_EVENT(rcu_prep_idle,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *reason),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *reason),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(reason),
 
@@ -337,9 +377,14 @@ TRACE_EVENT(rcu_prep_idle,
  * number of lazy callbacks queued, and the fourth element is the
  * total number of callbacks queued.
  */
-TRACE_EVENT(rcu_callback,
+LTTNG_TRACEPOINT_EVENT(rcu_callback,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
+                long qlen),
+
+       TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
        TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy,
                 long qlen),
 
@@ -389,9 +434,15 @@ TRACE_EVENT(rcu_callback,
  * the fourth argument is the number of lazy callbacks queued, and the
  * fifth argument is the total number of callbacks queued.
  */
-TRACE_EVENT(rcu_kfree_callback,
+LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
+                long qlen_lazy, long qlen),
+
+       TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
        TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
                 long qlen_lazy, long qlen),
 
@@ -441,9 +492,17 @@ TRACE_EVENT(rcu_kfree_callback,
  * the total number of callbacks queued, and the fourth argument is
  * the current RCU-callback batch limit.
  */
-TRACE_EVENT(rcu_batch_start,
+LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
+
+       TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+       TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit),
+
+       TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
        TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit),
 
        TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
@@ -459,7 +518,11 @@ TRACE_EVENT(rcu_batch_start,
                __field(long, qlen_lazy)
 #endif
                __field(long, qlen)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+               __field(long, blimit)
+#else
                __field(int, blimit)
+#endif
        ),
 
        TP_fast_assign(
@@ -471,7 +534,11 @@ TRACE_EVENT(rcu_batch_start,
                tp_assign(blimit, blimit)
        ),
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+       TP_printk("%s CBs=%ld/%ld bl=%ld",
+                 __get_str(rcuname), __entry->qlen_lazy, __entry->qlen,
+                 __entry->blimit)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
        TP_printk("%s CBs=%ld/%ld bl=%d",
                  __get_str(rcuname), __entry->qlen_lazy, __entry->qlen,
                  __entry->blimit)
@@ -486,9 +553,13 @@ TRACE_EVENT(rcu_batch_start,
  * The first argument is the type of RCU, and the second argument is
  * a pointer to the RCU callback itself.
  */
-TRACE_EVENT(rcu_invoke_callback,
+LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, struct rcu_head *rhp),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, struct rcu_head *rhp),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, rhp),
 
@@ -515,9 +586,13 @@ TRACE_EVENT(rcu_invoke_callback,
  * is the offset of the callback within the enclosing RCU-protected
  * data structure.
  */
-TRACE_EVENT(rcu_invoke_kfree_callback,
+LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, rhp, offset),
 
@@ -548,9 +623,19 @@ TRACE_EVENT(rcu_invoke_kfree_callback,
  * and the sixth argument (risk) is the return value from
  * rcu_is_callbacks_kthread().
  */
-TRACE_EVENT(rcu_batch_end,
+LTTNG_TRACEPOINT_EVENT(rcu_batch_end,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
+       TP_PROTO(const char *rcuname, int callbacks_invoked,
+                char cb, char nr, char iit, char risk),
+
+       TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, int callbacks_invoked,
+                bool cb, bool nr, bool iit, bool risk),
+
+       TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
        TP_PROTO(char *rcuname, int callbacks_invoked,
                 bool cb, bool nr, bool iit, bool risk),
 
@@ -564,7 +649,12 @@ TRACE_EVENT(rcu_batch_end,
        TP_STRUCT__entry(
                __string(rcuname, rcuname)
                __field(int, callbacks_invoked)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
+               __field(char, cb)
+               __field(char, nr)
+               __field(char, iit)
+               __field(char, risk)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
                __field(bool, cb)
                __field(bool, nr)
                __field(bool, iit)
@@ -602,9 +692,14 @@ TRACE_EVENT(rcu_batch_end,
  * of the RCU flavor from rcutorture's viewpoint and the second argument
  * is the callback address.
  */
-TRACE_EVENT(rcu_torture_read,
+LTTNG_TRACEPOINT_EVENT(rcu_torture_read,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
+                unsigned long secs, unsigned long c_old, unsigned long c),
+
+       TP_ARGS(rcutorturename, rhp, secs, c_old, c),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
        TP_PROTO(char *rcutorturename, struct rcu_head *rhp,
                 unsigned long secs, unsigned long c_old, unsigned long c),
 
@@ -664,9 +759,13 @@ TRACE_EVENT(rcu_torture_read,
  * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
  * is the count of remaining callbacks, and "done" is the piggybacking count.
  */
-TRACE_EVENT(rcu_barrier,
+LTTNG_TRACEPOINT_EVENT(rcu_barrier,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+       TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
        TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
 
        TP_ARGS(rcuname, s, cpu, cnt, done),
 
@@ -741,7 +840,7 @@ TRACE_EVENT(rcu_barrier,
 #endif
 #endif /* #else #ifdef CONFIG_RCU_TRACE */
 
-#endif /* _TRACE_RCU_H */
+#endif /* LTTNG_TRACE_RCU_H */
 
 /* This part must be outside protection */
 #include "../../../probes/define_trace.h"
This page took 0.027696 seconds and 4 git commands to generate.