Commit 20550622 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

tracing: Do not inherit event-fork option for instances

As the event-fork option requires doing work when enabled and disabled, it
can not be passed down to created instances. The instance must clear this
flag when it is created, and must clear it when its removed.

As more options may be created with this need, a macro ZEROED_TRACE_FLAGS is
created that holds the flags that must not be inherited by the top level
instance, and must be cleared on removal of instances.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent d50c744e
...@@ -253,6 +253,9 @@ unsigned long long ns2usecs(cycle_t nsec) ...@@ -253,6 +253,9 @@ unsigned long long ns2usecs(cycle_t nsec)
#define TOP_LEVEL_TRACE_FLAGS (TRACE_ITER_PRINTK | \ #define TOP_LEVEL_TRACE_FLAGS (TRACE_ITER_PRINTK | \
TRACE_ITER_PRINTK_MSGONLY | TRACE_ITER_RECORD_CMD) TRACE_ITER_PRINTK_MSGONLY | TRACE_ITER_RECORD_CMD)
/* trace_flags that are default zero for instances */
#define ZEROED_TRACE_FLAGS \
TRACE_ITER_EVENT_FORK
/* /*
* The global_trace is the descriptor that holds the tracing * The global_trace is the descriptor that holds the tracing
...@@ -6710,7 +6713,7 @@ static int instance_mkdir(const char *name) ...@@ -6710,7 +6713,7 @@ static int instance_mkdir(const char *name)
if (!alloc_cpumask_var(&tr->tracing_cpumask, GFP_KERNEL)) if (!alloc_cpumask_var(&tr->tracing_cpumask, GFP_KERNEL))
goto out_free_tr; goto out_free_tr;
tr->trace_flags = global_trace.trace_flags; tr->trace_flags = global_trace.trace_flags & ~ZEROED_TRACE_FLAGS;
cpumask_copy(tr->tracing_cpumask, cpu_all_mask); cpumask_copy(tr->tracing_cpumask, cpu_all_mask);
...@@ -6784,6 +6787,12 @@ static int instance_rmdir(const char *name) ...@@ -6784,6 +6787,12 @@ static int instance_rmdir(const char *name)
list_del(&tr->list); list_del(&tr->list);
/* Disable all the flags that were enabled coming in */
for (i = 0; i < TRACE_FLAGS_MAX_SIZE; i++) {
if ((1 << i) & ZEROED_TRACE_FLAGS)
set_tracer_flag(tr, 1 << i, 0);
}
tracing_set_nop(tr); tracing_set_nop(tr);
event_trace_del_tracer(tr); event_trace_del_tracer(tr);
ftrace_destroy_function_files(tr); ftrace_destroy_function_files(tr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment