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
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -1540,7 +1540,12 @@ stacktrace_trigger(struct event_trigger_data *data, · 1539 unmodified lines | ||
| 1540 | 1540 | struct trace_buffer *buffer, void *rec, |
| 1541 | 1541 | struct ring_buffer_event *event) |
| 1542 | 1542 | { |
| 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); | |
| 1544 | 1549 | } |
| 1545 | 1550 | |
| 1546 | 1551 | static void |