提交 ce33c845 编写于 作者: D Daniel Bristot de Oliveira 提交者: Steven Rostedt (Google)

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: stable@vger.kernel.org
Fixes: ae63b31e ("tracing: Separate out trace events from global variables")
Reviewed-by: NTom Zanussi <zanussi@kernel.org>
Tested-by: NTom Zanussi <zanussi@kernel.org>
Signed-off-by: NDaniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: NSteven Rostedt (Google) <rostedt@goodmis.org>
上级 7414db41
...@@ -1540,6 +1540,11 @@ stacktrace_trigger(struct event_trigger_data *data, ...@@ -1540,6 +1540,11 @@ stacktrace_trigger(struct event_trigger_data *data,
struct trace_buffer *buffer, void *rec, struct trace_buffer *buffer, void *rec,
struct ring_buffer_event *event) struct ring_buffer_event *event)
{ {
struct trace_event_file *file = data->private_data;
if (file)
__trace_stack(file->tr, tracing_gen_ctx(), STACK_SKIP);
else
trace_dump_stack(STACK_SKIP); trace_dump_stack(STACK_SKIP);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册