linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: rostedt@goodmis.org, tglx@linutronix.de, namhyung@kernel.org,
	vedang.patel@intel.com, bigeasy@linutronix.de,
	joel@joelfernandes.org, mathieu.desnoyers@efficios.com,
	julia@ni.com, linux-kernel@vger.kernel.org,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v4 8/8] trace: Add alternative synthetic event trace action syntax
Date: Wed, 19 Sep 2018 11:33:12 -0500	[thread overview]
Message-ID: <1537374792.11628.20.camel@kernel.org> (raw)
In-Reply-To: <20180919085447.53b1e87f4c76fdb38bf5ad98@kernel.org>

Hi Masami,

On Wed, 2018-09-19 at 08:54 +0900, Masami Hiramatsu wrote:
> Hi Tom,
> 
> On Tue, 18 Sep 2018 14:16:43 -0500
> Tom Zanussi <zanussi@kernel.org> wrote:
> 
> > Hi Masami,
> > 
> > On Wed, 2018-09-19 at 03:54 +0900, Masami Hiramatsu wrote:
> > > Hi Tom,
> > > 
> > > On Mon, 10 Sep 2018 14:10:46 -0500
> > > Tom Zanussi <zanussi@kernel.org> wrote:
> > > 
> > > > From: Tom Zanussi <tom.zanussi@linux.intel.com>
> > > > 
> > > > Add a 'trace(synthetic_event_name, params)' alternative to
> > > > synthetic_event_name(params).
> > > > 
> > > > Currently, the syntax used for generating synthetic events is
> > > > to
> > > > invoke synthetic_event_name(params) i.e. use the synthetic
> > > > event
> > > > name
> > > > as a function call.
> > > > 
> > > > Users requested a new form that more explicitly shows that the
> > > > synthetic event is in effect being traced.  In this version, a
> > > > new
> > > > 'trace()' keyword is used, and the synthetic event name is
> > > > passed
> > > > in
> > > > as the first argument.
> > > 
> > > Hmm, what is the advantage of adding this new form?
> > > 
> > 
> > There's no real advantage other than user preference - Namhyung
> > thought
> > that since the event-name-as-function-call actions are all defined
> > as
> > ACTION_TRACE, there should also be an explicit 'trace' action.
> 
> Ah, got it. Would this needs documentation and testcase update too?
> 

The first part of the patch does contain the Documentation change to
trace/histograms.txt.

But I didn't do a testcase for it, will do that in the next iteration.

> > 
> > So I added it as alternative syntax - the event-name-as-function-
> > call
> > form remains unchanged.
> > 
> > By the way, I also have a patch implementing your alternative
> > syntax
> > change, where if you have only one handler, you can do away with
> > the
> > explicit action.handler form e.g.
> > 
> >   # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-ts0: 
> > \
> >     onmax($wakeup_lat): \
> >     save(next_prio,next_comm,prev_pid,prev_prio,prev_comm):snapshot
> > () \
> 
> Hmm, in this case, I think comma-connected syntax will be clearer
> when
> the action is kicked.
> 
>      onmax($wakeup_lat).save(next_prio,next_comm,prev_pid,prev_prio,p
> rev_comm),snapshot()
> 
> any thought?
> 

With the above I was trying to implement something close to your
original suggestion of:

<actions> onchange(<var>)

So what I described was:

<actions>:onchange(<var>)

where <actions> would expand to action1[:action2:..]

But as I mentioned both only make sense if you only have one
onchange(<var>).

Your new version:

onchange(<var>).action1[,action2,..]

is probably better as it would allow for multiple onchange<var> and/or
other handlers.

Thanks,

Tom


      reply	other threads:[~2018-09-19 16:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 19:10 [PATCH v4 0/8] tracing: Hist trigger snapshot and onchange additions Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 1/8] tracing: Refactor hist trigger action code Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 2/8] tracing: Split up onmatch action data Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 3/8] tracing: Generalize hist trigger onmax and save action Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 4/8] tracing: Add conditional snapshot Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 5/8] tracing: Move hist trigger key printing into a separate function Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 6/8] tracing: Add snapshot action Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 7/8] tracing: Add hist trigger onchange() handler Tom Zanussi
2018-09-10 19:10 ` [PATCH v4 8/8] trace: Add alternative synthetic event trace action syntax Tom Zanussi
2018-09-18 18:54   ` Masami Hiramatsu
2018-09-18 19:16     ` Tom Zanussi
2018-09-18 23:54       ` Masami Hiramatsu
2018-09-19 16:33         ` 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=1537374792.11628.20.camel@kernel.org \
    --to=zanussi@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=joel@joelfernandes.org \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vedang.patel@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).