LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Clark Williams <williams@redhat.com>,
	Karim Yaghmour <karim.yaghmour@opersys.com>,
	Brendan Gregg <bgregg@netflix.com>,
	Joel Fernandes <joelaf@google.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-rt-users@vger.kernel.org, kernel-team@lge.com
Subject: Re: [RFC][PATCH 06/10] tracing: Add trigger file for trace_markers tracefs/ftrace/print
Date: Wed, 16 May 2018 16:49:04 +0900	[thread overview]
Message-ID: <20180516074904.GA30309@danjae.aot.lge.com> (raw)
In-Reply-To: <20180514110436.336b214b@gandalf.local.home>

Hi Steve,

On Mon, May 14, 2018 at 11:04:36AM -0400, Steven Rostedt wrote:
> On Mon, 14 May 2018 12:13:22 +0900
> Namhyung Kim <namhyung@kernel.org> wrote:
> 
> > On Fri, May 11, 2018 at 03:49:33PM -0400, Steven Rostedt wrote:
> > > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > > 
> > > Allow writing to the trace_markers file initiate triggers defined in
> > > tracefs/ftrace/print/trigger file. This will allow of user space to trigger
> > > the same type of triggers (including histograms) that the trace events use.
> > > 
> > > Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
> > > Cc: Clark Williams <williams@redhat.com>
> > > Cc: Karim Yaghmour <karim.yaghmour@opersys.com>
> > > Cc: Brendan Gregg <bgregg@netflix.com>
> > > Suggested-by: Joel Fernandes <joelaf@google.com>
> > > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > > ---  
> > 
> > [SNIP]
> > > diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h
> > > index e3a658bac10f..de3fce14cd00 100644
> > > --- a/kernel/trace/trace_entries.h
> > > +++ b/kernel/trace/trace_entries.h
> > > @@ -230,7 +230,7 @@ FTRACE_ENTRY(bprint, bprint_entry,
> > >  	FILTER_OTHER
> > >  );
> > >  
> > > -FTRACE_ENTRY(print, print_entry,
> > > +FTRACE_ENTRY_REG(print, print_entry,
> > >  
> > >  	TRACE_PRINT,
> > >  
> > > @@ -242,7 +242,9 @@ FTRACE_ENTRY(print, print_entry,
> > >  	F_printk("%ps: %s",
> > >  		 (void *)__entry->ip, __entry->buf),
> > >  
> > > -	FILTER_OTHER
> > > +	FILTER_OTHER,
> > > +
> > > +	 ftrace_event_register  
> > 
> > I wonder this is still needed since you added __find_event_file()
> > which ignores the reg field.  Maybe I'm missing something..
> 
> No, that's not the reason for it. The reason is due to the
> event_trigger_callback() function. I'll update the changelog to specify
> this.
> 
> We have something like:
> 
>  # echo snapshot > events/ftrace/print/trigger
> 
> Which will do:
> 
>   event_trigger_write() {
>     event_trigger_regex_write() {
>       trigger_process_regex() {
>         for p in trigger_commands {
>           p->func(); /* trigger_snapshot_cmd->func */
>             event_trigger_callback() {
>               cmd_ops->reg() /* register_trigger() */ {
>                 trace_event_trigger_enable_disable() {
>                   trace_event_enable_disable() {
>                     call->class->reg();
> 
> Without this patch, we jump to NULL and BOOM!

Thanks for the explanation.  I wonder we can skip calling
trace_event_enable_disable() for events which have the
TRACE_EVENT_FL_IGNORE_ENABLE flag.

Thanks,
Namhyung

  reply	other threads:[~2018-05-16  7:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 19:49 [RFC][PATCH 00/10] tracing: Add triggers to trace_marker writes Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 01/10] tracing: Do not reference event data in post call triggers Steven Rostedt
2018-05-12 12:04   ` Masami Hiramatsu
2018-05-11 19:49 ` [RFC][PATCH 02/10] tracing: Add __find_event_file() to find event files without restrictions Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 03/10] tracing: Have event_trace_init() called by trace_init_tracefs() Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 04/10] tracing: Add brackets in ftrace event dynamic arrays Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 05/10] tracing: Do not show filter file for ftrace internal events Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 06/10] tracing: Add trigger file for trace_markers tracefs/ftrace/print Steven Rostedt
2018-05-14  3:13   ` Namhyung Kim
2018-05-14 15:04     ` Steven Rostedt
2018-05-16  7:49       ` Namhyung Kim [this message]
2018-05-16 10:37         ` Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string Steven Rostedt
2018-05-12 12:40   ` Masami Hiramatsu
2018-05-12 17:27     ` Steven Rostedt
2018-05-12 18:32   ` Yann Ylavic
2018-05-14  2:23     ` Namhyung Kim
2018-05-14 14:12     ` Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 08/10] tracing: Prevent further users of zero size static arrays in trace events Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 09/10] tracing: Allow histogram triggers to access ftrace internal events Steven Rostedt
2018-05-11 19:49 ` [RFC][PATCH 10/10] tracing: Document trace_marker triggers Steven Rostedt

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=20180516074904.GA30309@danjae.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bgregg@netflix.com \
    --cc=joelaf@google.com \
    --cc=karim.yaghmour@opersys.com \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    --cc=williams@redhat.com \
    --subject='Re: [RFC][PATCH 06/10] tracing: Add trigger file for trace_markers tracefs/ftrace/print' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).