X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fsched.h;h=005f3d141e1f7bca6d6ccfe83dd29d94986c6057;hb=e7b0901e522e1f5654dad4a775e2bb233b15b420;hp=33f69213e4245f4da29ddfe0f105fd81482db629;hpb=3568c28ca2b801c6fd572aae078bfb474f720e7c;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/sched.h b/instrumentation/events/lttng-module/sched.h index 33f69213..005f3d14 100644 --- a/instrumentation/events/lttng-module/sched.h +++ b/instrumentation/events/lttng-module/sched.h @@ -74,9 +74,15 @@ TRACE_EVENT(sched_kthread_stop_ret, */ DECLARE_EVENT_CLASS(sched_wakeup_template, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) TP_PROTO(struct task_struct *p, int success), TP_ARGS(p, success), +#else + TP_PROTO(struct rq *rq, struct task_struct *p, int success), + + TP_ARGS(rq, p, success), +#endif TP_STRUCT__entry( __array_text( char, comm, TASK_COMM_LEN ) @@ -99,6 +105,8 @@ DECLARE_EVENT_CLASS(sched_wakeup_template, __entry->success, __entry->target_cpu) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + DEFINE_EVENT(sched_wakeup_template, sched_wakeup, TP_PROTO(struct task_struct *p, int success), TP_ARGS(p, success)) @@ -110,15 +118,37 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, TP_PROTO(struct task_struct *p, int success), TP_ARGS(p, success)) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */ + +DEFINE_EVENT(sched_wakeup_template, sched_wakeup, + TP_PROTO(struct rq *rq, struct task_struct *p, int success), + TP_ARGS(rq, p, success)) + +/* + * Tracepoint for waking up a new task: + */ +DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, + TP_PROTO(struct rq *rq, struct task_struct *p, int success), + TP_ARGS(rq, p, success)) + +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */ + /* * Tracepoint for task switches, performed by the scheduler: */ TRACE_EVENT(sched_switch, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) TP_PROTO(struct task_struct *prev, struct task_struct *next), TP_ARGS(prev, next), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */ + TP_PROTO(struct rq *rq, struct task_struct *prev, + struct task_struct *next), + + TP_ARGS(rq, prev, next), +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */ TP_STRUCT__entry( __array_text( char, prev_comm, TASK_COMM_LEN ) @@ -220,9 +250,15 @@ DEFINE_EVENT(sched_process_template, sched_process_exit, /* * Tracepoint for waiting on task to unschedule: */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) DEFINE_EVENT(sched_process_template, sched_wait_task, TP_PROTO(struct task_struct *p), TP_ARGS(p)) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */ +DEFINE_EVENT(sched_process_template, sched_wait_task, + TP_PROTO(struct rq *rq, struct task_struct *p), + TP_ARGS(rq, p)) +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */ /* * Tracepoint for a waiting task: @@ -277,6 +313,34 @@ TRACE_EVENT(sched_process_fork, __entry->child_comm, __entry->child_tid) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +/* + * Tracepoint for exec: + */ +TRACE_EVENT(sched_process_exec, + + TP_PROTO(struct task_struct *p, pid_t old_pid, + struct linux_binprm *bprm), + + TP_ARGS(p, old_pid, bprm), + + TP_STRUCT__entry( + __string( filename, bprm->filename ) + __field( pid_t, tid ) + __field( pid_t, old_tid ) + ), + + TP_fast_assign( + tp_strcpy(filename, bprm->filename) + tp_assign(tid, p->pid) + tp_assign(old_tid, old_pid) + ), + + TP_printk("filename=%s tid=%d old_tid=%d", __get_str(filename), + __entry->tid, __entry->old_tid) +) +#endif + /* * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE * adding sched_stat support to SCHED_FIFO/RR would be welcome.