Skip to content

Commit bcee527

Browse files
committed
tracing: Fix userstacktrace option for instances
When the instances were able to use their own options, the userstacktrace option was left hardcoded for the top level. This made the instance userstacktrace option bascially into a nop, and will confuse users that set it, but nothing happens (I was confused when it happened to me!) Cc: [email protected] Fixes: 1627014 ("tracing: Add trace options for core options to instances") Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 0522749 commit bcee527

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kernel/trace/trace.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ static union trace_eval_map_item *trace_eval_maps;
163163
#endif /* CONFIG_TRACE_EVAL_MAP_FILE */
164164

165165
int tracing_set_tracer(struct trace_array *tr, const char *buf);
166-
static void ftrace_trace_userstack(struct trace_buffer *buffer,
166+
static void ftrace_trace_userstack(struct trace_array *tr,
167+
struct trace_buffer *buffer,
167168
unsigned long flags, int pc);
168169

169170
#define MAX_TRACER_SIZE 100
@@ -2870,7 +2871,7 @@ void trace_buffer_unlock_commit_regs(struct trace_array *tr,
28702871
* two. They are not that meaningful.
28712872
*/
28722873
ftrace_trace_stack(tr, buffer, flags, regs ? 0 : STACK_SKIP, pc, regs);
2873-
ftrace_trace_userstack(buffer, flags, pc);
2874+
ftrace_trace_userstack(tr, buffer, flags, pc);
28742875
}
28752876

28762877
/*
@@ -3056,13 +3057,14 @@ EXPORT_SYMBOL_GPL(trace_dump_stack);
30563057
static DEFINE_PER_CPU(int, user_stack_count);
30573058

30583059
static void
3059-
ftrace_trace_userstack(struct trace_buffer *buffer, unsigned long flags, int pc)
3060+
ftrace_trace_userstack(struct trace_array *tr,
3061+
struct trace_buffer *buffer, unsigned long flags, int pc)
30603062
{
30613063
struct trace_event_call *call = &event_user_stack;
30623064
struct ring_buffer_event *event;
30633065
struct userstack_entry *entry;
30643066

3065-
if (!(global_trace.trace_flags & TRACE_ITER_USERSTACKTRACE))
3067+
if (!(tr->trace_flags & TRACE_ITER_USERSTACKTRACE))
30663068
return;
30673069

30683070
/*
@@ -3101,7 +3103,8 @@ ftrace_trace_userstack(struct trace_buffer *buffer, unsigned long flags, int pc)
31013103
preempt_enable();
31023104
}
31033105
#else /* CONFIG_USER_STACKTRACE_SUPPORT */
3104-
static void ftrace_trace_userstack(struct trace_buffer *buffer,
3106+
static void ftrace_trace_userstack(struct trace_array *tr,
3107+
struct trace_buffer *buffer,
31053108
unsigned long flags, int pc)
31063109
{
31073110
}

0 commit comments

Comments
 (0)