X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fsched.h;h=d2e03f9d989c853917d63bd2718e97786377f445;hb=e655c2d56f2df45ab547aec57c98aabf25d78325;hp=1bea326135a428e0db10c42388a9683d58edd745;hpb=2a5c234d1afcc98b07a349e919284ae8148d672d;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/sched.h b/instrumentation/events/lttng-module/sched.h index 1bea3261..d2e03f9d 100644 --- a/instrumentation/events/lttng-module/sched.h +++ b/instrumentation/events/lttng-module/sched.h @@ -135,6 +135,35 @@ 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_STRUCT__entry( + __array_text( char, comm, TASK_COMM_LEN ) + __field( pid_t, tid ) + __field( int, prio ) + __field( int, target_cpu ) + ), + + TP_fast_assign( + tp_memcpy(comm, p->comm, TASK_COMM_LEN) + tp_assign(tid, p->pid) + tp_assign(prio, p->prio) + tp_assign(target_cpu, task_cpu(p)) + ) + TP_perf_assign( + __perf_task(p) + ), + + TP_printk("comm=%s tid=%d prio=%d target_cpu=%03d", + __entry->comm, __entry->tid, __entry->prio, + __entry->target_cpu) +) +#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)) @@ -182,8 +211,34 @@ LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template, __entry->success) #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),