From: Oleg Nesterov Date: Thu, 20 Jun 2013 17:38:06 +0000 (+0200) Subject: tracing/kprobes: Avoid perf_trace_buf_*() if ->perf_events is empty X-Git-Tag: v3.11-rc1~33^2~20 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=288e984e622336bab8bc3dfdf2f190816362d9a1;p=pandora-kernel.git tracing/kprobes: Avoid perf_trace_buf_*() if ->perf_events is empty perf_trace_buf_prepare() + perf_trace_buf_submit() make no sense if this task/CPU has no active counters. Change kprobe_perf_func() and kretprobe_perf_func() to check call->perf_events beforehand and return if this list is empty. For example, "perf record -e some_probe -p1". Only /sbin/init will report, all other threads which hit the same probe will do perf_trace_buf_prepare/perf_trace_buf_submit just to realize that nobody wants perf_swevent_event(). Link: http://lkml.kernel.org/r/20130620173806.GA13151@redhat.com Acked-by: Masami Hiramatsu Signed-off-by: Oleg Nesterov Signed-off-by: Steven Rostedt --- Reading git-diff-tree failed