Tracepoint event: add "TP_code_post()"
[lttng-modules.git] / instrumentation / events / lttng-module / sched.h
index 6e42fc62d4d3c779bca162d441656aa56aff3475..dc30398826546c87cf3b4000d921bd6cdd42014f 100644 (file)
@@ -131,6 +131,21 @@ LTTNG_TRACEPOINT_EVENT(sched_kthread_stop_ret,
 /*
  * Tracepoint for waking up a task:
  */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template,
+
+       TP_PROTO(struct task_struct *p),
+
+       TP_ARGS(p),
+
+       TP_FIELDS(
+               ctf_array_text(char, comm, p->comm, TASK_COMM_LEN)
+               ctf_integer(pid_t, tid, p->pid)
+               ctf_integer(int, prio, p->prio)
+               ctf_integer(int, target_cpu, task_cpu(p))
+       )
+)
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
 LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template,
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
@@ -153,8 +168,34 @@ LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template,
 #endif
        )
 )
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+
+/*
+ * Tracepoint called when waking a task; this tracepoint is guaranteed to be
+ * called from the waking context.
+ */
+LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_waking,
+            TP_PROTO(struct task_struct *p),
+            TP_ARGS(p))
+
+/*
+ * Tracepoint called when the task is actually woken; p->state == TASK_RUNNNG.
+ * It it not always called from the waking context.
+ */
+LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup,
+            TP_PROTO(struct task_struct *p),
+            TP_ARGS(p))
+
+/*
+ * Tracepoint for waking up a new task:
+ */
+LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new,
+            TP_PROTO(struct task_struct *p),
+            TP_ARGS(p))
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
 
 LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup,
             TP_PROTO(struct task_struct *p, int success),
@@ -308,7 +349,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(sched_process_fork,
                unsigned int ns_level;
        ),
 
-       TP_code(
+       TP_code_pre(
                if (child) {
                        struct pid *child_pid;
                        unsigned int i;
@@ -362,7 +403,9 @@ LTTNG_TRACEPOINT_EVENT_CODE(sched_process_fork,
                                child_ns_inum;
                        }))
 #endif
-       )
+       ),
+
+       TP_code_post()
 )
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
This page took 0.024107 seconds and 4 git commands to generate.