mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@kernel.org>
To: Daniel Bristot de Oliveira <bristot@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] tracing: Dump stacktrace trigger to the corresponding instance
Date: Thu, 24 Feb 2022 09:41:33 -0600	[thread overview]
Message-ID: <d38804da61e219e617b056a176cf8755c74c90d5.camel@kernel.org> (raw)
In-Reply-To: <afbb0b4f18ba92c276865bc97204d438473f4ebc.1645396236.git.bristot@kernel.org>

Hi Daniel,

On Sun, 2022-02-20 at 23:49 +0100, Daniel Bristot de Oliveira wrote:
> The stacktrace event trigger is 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.
> 
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Tom Zanussi <zanussi@kernel.org>
> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
> ---
>  kernel/trace/trace_events_trigger.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_events_trigger.c
> b/kernel/trace/trace_events_trigger.c
> index d00fee705f9c..e0d50c9577f3 100644
> --- a/kernel/trace/trace_events_trigger.c
> +++ b/kernel/trace/trace_events_trigger.c
> @@ -1540,7 +1540,12 @@ stacktrace_trigger(struct event_trigger_data
> *data,
>  		   struct trace_buffer *buffer,  void *rec,
>  		   struct ring_buffer_event *event)
>  {
> -	trace_dump_stack(STACK_SKIP);
> +	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);
>  }
>  
>  static void


Looks good to me.

Reviewed-by: Tom Zanussi <zanussi@kernel.org>
Tested-by: Tom Zanussi <zanussi@kernel.org>

Thanks,

Tom





      parent reply	other threads:[~2022-02-24 15:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-20 22:49 Daniel Bristot de Oliveira
2022-02-20 23:45 ` Daniel Bristot de Oliveira
2022-02-24 15:41 ` Tom Zanussi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d38804da61e219e617b056a176cf8755c74c90d5.camel@kernel.org \
    --to=zanussi@kernel.org \
    --cc=bristot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®