Skip to content

Commit

Permalink
tracing: Remove unused ftrace_cpu_disabled per cpu variable
Browse files Browse the repository at this point in the history
Since the ring buffer is lockless, there is no need to disable ftrace on
CPU. And no one doing so: after commit 6817968 ("tracing: Remove
ftrace_disable/enable_cpu()") ftrace_cpu_disabled stays the same after
initialization, nothing changes it.
ftrace_cpu_disabled shouldn't be used by any external module since it
disables only function and graph_function tracers but not any other
tracer.

Link: http://lkml.kernel.org/r/[email protected]

Signed-off-by: Dmitry Safonov <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
0x7f454c46 authored and rostedt committed Nov 7, 2015
1 parent 8b12919 commit 03e88ae
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
6 changes: 0 additions & 6 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ static DEFINE_PER_CPU(bool, trace_cmdline_save);
*/
static int tracing_disabled = 1;

DEFINE_PER_CPU(int, ftrace_cpu_disabled);

cpumask_var_t __read_mostly tracing_buffer_mask;

/*
Expand Down Expand Up @@ -1775,10 +1773,6 @@ trace_function(struct trace_array *tr,
struct ring_buffer_event *event;
struct ftrace_entry *entry;

/* If we are reading the ring buffer, don't trace */
if (unlikely(__this_cpu_read(ftrace_cpu_disabled)))
return;

event = trace_buffer_lock_reserve(buffer, TRACE_FN, sizeof(*entry),
flags, pc);
if (!event)
Expand Down
1 change: 0 additions & 1 deletion kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@ extern int DYN_FTRACE_TEST_NAME2(void);

extern bool ring_buffer_expanded;
extern bool tracing_selftest_disabled;
DECLARE_PER_CPU(int, ftrace_cpu_disabled);

#ifdef CONFIG_FTRACE_STARTUP_TEST
extern int trace_selftest_startup_function(struct tracer *trace,
Expand Down
6 changes: 0 additions & 6 deletions kernel/trace/trace_functions_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ int __trace_graph_entry(struct trace_array *tr,
struct ring_buffer *buffer = tr->trace_buffer.buffer;
struct ftrace_graph_ent_entry *entry;

if (unlikely(__this_cpu_read(ftrace_cpu_disabled)))
return 0;

event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_ENT,
sizeof(*entry), flags, pc);
if (!event)
Expand Down Expand Up @@ -403,9 +400,6 @@ void __trace_graph_return(struct trace_array *tr,
struct ring_buffer *buffer = tr->trace_buffer.buffer;
struct ftrace_graph_ret_entry *entry;

if (unlikely(__this_cpu_read(ftrace_cpu_disabled)))
return;

event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_RET,
sizeof(*entry), flags, pc);
if (!event)
Expand Down

0 comments on commit 03e88ae

Please sign in to comment.