summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2012-02-07 11:11:05 -0500
committerIngo Molnar <mingo@elte.hu>2012-02-23 03:28:06 -0500
commit4ff16c25e2cc48cbe6956e356c38a25ac063a64d (patch)
tree27ff21500ab5559497126e6a25e65bcf96d44c59 /fs/exec.c
parent034d150a44a2b428e273e69889397c01f63eaf14 (diff)
tracepoint, vfs, sched: Add exec() tracepoint
Added a minimal exec tracepoint. Exec is an important major event in the life of a task, like fork(), clone() or exit(), all of which we already trace. [ We also do scheduling re-balancing during exec() - so it's useful from a scheduler instrumentation POV as well. ] If you want to watch a task start up, when it gets exec'ed is a good place to start. With the addition of this tracepoint, exec's can be monitored and better picture of general system activity can be obtained. This tracepoint will also enable better process life tracking, allowing you to answer questions like "what process keeps starting up binary X?". This tracepoint can also be useful in ftrace filtering and trigger conditions: i.e. starting or stopping filtering when exec is called. Signed-off-by: David Smith <dsmith@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/4F314D19.7030504@redhat.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/exec.c b/fs/exec.c
index aeb135c7ff5c..d0d208092773 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -63,6 +63,8 @@
63#include <trace/events/task.h> 63#include <trace/events/task.h>
64#include "internal.h" 64#include "internal.h"
65 65
66#include <trace/events/sched.h>
67
66int core_uses_pid; 68int core_uses_pid;
67char core_pattern[CORENAME_MAX_SIZE] = "core"; 69char core_pattern[CORENAME_MAX_SIZE] = "core";
68unsigned int core_pipe_limit; 70unsigned int core_pipe_limit;
@@ -1401,9 +1403,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1401 */ 1403 */
1402 bprm->recursion_depth = depth; 1404 bprm->recursion_depth = depth;
1403 if (retval >= 0) { 1405 if (retval >= 0) {
1404 if (depth == 0) 1406 if (depth == 0) {
1405 ptrace_event(PTRACE_EVENT_EXEC, 1407 trace_sched_process_exec(current, old_pid, bprm);
1406 old_pid); 1408 ptrace_event(PTRACE_EVENT_EXEC, old_pid);
1409 }
1407 put_binfmt(fmt); 1410 put_binfmt(fmt);
1408 allow_write_access(bprm->file); 1411 allow_write_access(bprm->file);
1409 if (bprm->file) 1412 if (bprm->file)