[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180516074904.GA30309@danjae.aot.lge.com>
Date: Wed, 16 May 2018 16:49:04 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Tom Zanussi <tom.zanussi@...ux.intel.com>,
Clark Williams <williams@...hat.com>,
Karim Yaghmour <karim.yaghmour@...rsys.com>,
Brendan Gregg <bgregg@...flix.com>,
Joel Fernandes <joelaf@...gle.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
linux-rt-users@...r.kernel.org, kernel-team@....com
Subject: Re: [RFC][PATCH 06/10] tracing: Add trigger file for trace_markers
tracefs/ftrace/print
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@...nel.org> wrote:
>
> > On Fri, May 11, 2018 at 03:49:33PM -0400, Steven Rostedt wrote:
> > > From: "Steven Rostedt (VMware)" <rostedt@...dmis.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@...ux.intel.com>
> > > Cc: Clark Williams <williams@...hat.com>
> > > Cc: Karim Yaghmour <karim.yaghmour@...rsys.com>
> > > Cc: Brendan Gregg <bgregg@...flix.com>
> > > Suggested-by: Joel Fernandes <joelaf@...gle.com>
> > > Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.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
Powered by blists - more mailing lists