From: Paul Woegerer Date: Fri, 12 Oct 2012 14:19:42 +0000 (-0400) Subject: Add TRACE_EVENT(sched_process_exec) to sched.h X-Git-Tag: v2.1.0~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=46142a81c9c0cafd313852003df68048d199d0cc;p=lttng-modules.git Add TRACE_EVENT(sched_process_exec) to sched.h Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/sched.h b/instrumentation/events/lttng-module/sched.h index b68616e0..23e4955a 100644 --- a/instrumentation/events/lttng-module/sched.h +++ b/instrumentation/events/lttng-module/sched.h @@ -313,6 +313,32 @@ TRACE_EVENT(sched_process_fork, __entry->child_comm, __entry->child_tid) ) +/* + * 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, pid ) + __field( pid_t, old_pid ) + ), + + TP_fast_assign( + tp_strcpy(filename, bprm->filename) + tp_assign(pid, p->pid) + tp_assign(old_pid, old_pid) + ), + + TP_printk("filename=%s pid=%d old_pid=%d", __get_str(filename), + __entry->pid, __entry->old_pid) +) + /* * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE * adding sched_stat support to SCHED_FIFO/RR would be welcome. diff --git a/instrumentation/events/mainline/sched.h b/instrumentation/events/mainline/sched.h index f6334782..6700ecc9 100644 --- a/instrumentation/events/mainline/sched.h +++ b/instrumentation/events/mainline/sched.h @@ -274,6 +274,32 @@ TRACE_EVENT(sched_process_fork, __entry->child_comm, __entry->child_pid) ); +/* + * 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, pid ) + __field( pid_t, old_pid ) + ), + + TP_fast_assign( + __assign_str(filename, bprm->filename); + __entry->pid = p->pid; + __entry->old_pid = old_pid; + ), + + TP_printk("filename=%s pid=%d old_pid=%d", __get_str(filename), + __entry->pid, __entry->old_pid) +); + /* * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE * adding sched_stat support to SCHED_FIFO/RR would be welcome.