Skip to content

Commit

Permalink
tracing/uprobes: Support event triggering
Browse files Browse the repository at this point in the history
Add support for event triggering to uprobes.  This is same as kprobes
support added by Tom (plus cleanup by Steven).

Link: http://lkml.kernel.org/r/1389946120-19610-5-git-send-email-namhyung@kernel.org

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Namhyung Kim authored and Steven Rostedt committed Feb 20, 2014
1 parent 70ed91c commit ca3b162
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/trace/trace_uprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,9 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
if (WARN_ON_ONCE(tu->tp.size + dsize > PAGE_SIZE))
return;

if (ftrace_trigger_soft_disabled(ftrace_file))
return;

esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
size = esize + tu->tp.size + dsize;
event = trace_event_buffer_lock_reserve(&buffer, ftrace_file,
Expand All @@ -795,8 +798,7 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,

memcpy(data, ucb->buf, tu->tp.size + dsize);

if (!call_filter_check_discard(call, entry, buffer, event))
trace_buffer_unlock_commit(buffer, event, 0, 0);
event_trigger_unlock_commit(ftrace_file, buffer, event, entry, 0, 0);
}

/* uprobe handler */
Expand Down

0 comments on commit ca3b162

Please sign in to comment.