]> Pileus Git - ~andy/linux/commit
tracing/perf: Reimplement TP_perf_assign() logic
authorOleg Nesterov <oleg@redhat.com>
Tue, 6 Aug 2013 16:08:44 +0000 (18:08 +0200)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 14 Aug 2013 01:05:57 +0000 (21:05 -0400)
commit12473965c38a527a0c6f7a38d23edce60957f873
tree390d32b5ae485dda15302f370812bf668f5cdd87
parent36009d07b79d2a168d6037947357d96e5d8cebe7
tracing/perf: Reimplement TP_perf_assign() logic

The next patch tries to avoid the costly perf_trace_buf_* calls
when possible but there is a problem. We can only do this if
__task == NULL, perf_tp_event(task != NULL) has the additional
code for this case.

Unfortunately, TP_perf_assign/__perf_xxx which changes the default
values of __count/__task variables for perf_trace_buf_submit() is
called "too late", after we already did perf_trace_buf_prepare(),
and the optimization above can't work.

So this patch simply embeds __perf_xxx() into TP_ARGS(), this way
DECLARE_EVENT_CLASS() can use the result of assignments hidden in
"args" right after ftrace_get_offsets_##call() which is mostly
trivial. This allows us to have the fast-path "__task != NULL"
check at the start, see the next patch.

Link: http://lkml.kernel.org/r/20130806160844.GA2739@redhat.com
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/trace/events/sched.h
include/trace/ftrace.h