Skip to content

Commit 7e35b31

Browse files
Daniel Bristot de Oliveiragregkh
authored andcommitted
tracing: Dump stacktrace trigger to the corresponding instance
commit ce33c84 upstream. The stacktrace event trigger is not dumping the stacktrace to the instance where it was enabled, but to the global "instance." Use the private_data, pointing to the trigger file, to figure out the corresponding trace instance, and use it in the trigger action, like snapshot_trigger does. Link: https://lkml.kernel.org/r/afbb0b4f18ba92c276865bc97204d438473f4ebc.1645396236.git.bristot@kernel.org Cc: stable@vger.kernel.org Fixes: ae63b31 ("tracing: Separate out trace events from global variables") Reviewed-by: Tom Zanussi <zanussi@kernel.org> Tested-by: Tom Zanussi <zanussi@kernel.org> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c8b56e5 commit 7e35b31

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎kernel/trace/trace_events_trigger.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,12 @@ stacktrace_trigger(struct event_trigger_data *data,
12001200
struct trace_buffer *buffer, void *rec,
12011201
struct ring_buffer_event *event)
12021202
{
1203-
trace_dump_stack(STACK_SKIP);
1203+
struct trace_event_file *file = data->private_data;
1204+
1205+
if (file)
1206+
__trace_stack(file->tr, tracing_gen_ctx(), STACK_SKIP);
1207+
else
1208+
trace_dump_stack(STACK_SKIP);
12041209
}
12051210

12061211
static void

0 commit comments

Comments
 (0)