Add TRACE_EVENT(sched_process_exec) to sched.h
authorPaul Woegerer <paul_woegerer@mentor.com>
Fri, 12 Oct 2012 14:19:42 +0000 (10:19 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Oct 2012 14:19:42 +0000 (10:19 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/sched.h
instrumentation/events/mainline/sched.h

index b68616e068111af4b67aa46ac91ef2fae4615ec9..23e4955ac7b4bfb7a9c86b7e9f2eb5087708655d 100644 (file)
@@ -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.
index f6334782a593847907b82fcfc5756040b1bd6ff8..6700ecc9a6055b38936d63f254c59eabfcea8229 100644 (file)
@@ -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.
This page took 0.028573 seconds and 4 git commands to generate.