Skip to content

Commit ce33c84

Browse files
Daniel Bristot de Oliveirarostedt
authored andcommitted
tracing: Dump stacktrace trigger to the corresponding instance
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: [email protected] Fixes: ae63b31 ("tracing: Separate out trace events from global variables") Reviewed-by: Tom Zanussi <[email protected]> Tested-by: Tom Zanussi <[email protected]> Signed-off-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 7414db4 commit ce33c84

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kernel/trace/trace_events_trigger.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,12 @@ stacktrace_trigger(struct event_trigger_data *data,
15401540
struct trace_buffer *buffer, void *rec,
15411541
struct ring_buffer_event *event)
15421542
{
1543-
trace_dump_stack(STACK_SKIP);
1543+
struct trace_event_file *file = data->private_data;
1544+
1545+
if (file)
1546+
__trace_stack(file->tr, tracing_gen_ctx(), STACK_SKIP);
1547+
else
1548+
trace_dump_stack(STACK_SKIP);
15441549
}
15451550

15461551
static void

0 commit comments

Comments
 (0)