summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat)2013-02-02 00:38:47 +0100
committerSteven Rostedt2013-02-02 00:38:47 +0100
commitd840f718d28715a9833c1a8f46c2493ff3fd219b (patch)
tree6fb0115db3dabd5ce79563fb1412c98edc24088e /tools/perf/builtin-script.c
parenttracing: Add documentation of snapshot utility (diff)
downloadkernel-qcow2-linux-d840f718d28715a9833c1a8f46c2493ff3fd219b.tar.gz
kernel-qcow2-linux-d840f718d28715a9833c1a8f46c2493ff3fd219b.tar.xz
kernel-qcow2-linux-d840f718d28715a9833c1a8f46c2493ff3fd219b.zip
tracing: Init current_trace to nop_trace and remove NULL checks
On early boot up, when the ftrace ring buffer is initialized, the static variable current_trace is initialized to &nop_trace. Before this initialization, current_trace is NULL and will never become NULL again. It is always reassigned to a ftrace tracer. Several places check if current_trace is NULL before it uses it, and this check is frivolous, because at the point in time when the checks are made the only way current_trace could be NULL is if ftrace failed its allocations at boot up, and the paths to these locations would probably not be possible. By initializing current_trace to &nop_trace where it is declared, current_trace will never be NULL, and we can remove all these checks of current_trace being NULL which never needed to be checked in the first place. Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/perf/builtin-script.c')
0 files changed, 0 insertions, 0 deletions