Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1690862 > unrolled thread

Re: [PATCH 16/32] tracing: Add variable support to hist triggers

Started byNamhyung Kim <namhyung@kernel.org>
First post2017-07-19 03:10 +0200
Last post2017-07-19 17:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 16/32] tracing: Add variable support to hist triggers Namhyung Kim <namhyung@kernel.org> - 2017-07-19 03:10 +0200
    Re: [PATCH 16/32] tracing: Add variable support to hist triggers Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-07-19 17:50 +0200

#1690862 — Re: [PATCH 16/32] tracing: Add variable support to hist triggers

FromNamhyung Kim <namhyung@kernel.org>
Date2017-07-19 03:10 +0200
SubjectRe: [PATCH 16/32] tracing: Add variable support to hist triggers
Message-ID<u4LEZ-1qm-7@gated-at.bofh.it>
Hi Tom,

On Mon, Jun 26, 2017 at 05:49:17PM -0500, Tom Zanussi wrote:
> Add support for saving the value of a current event's event field by
> assigning it to a variable that can be read by a subsequent event.
> 
> The basic syntax for saving a variable is to simply prefix a unique
> variable name not corresponding to any keyword along with an '=' sign
> to any event field.
> 
> Both keys and values can be saved and retrieved in this way:
> 
>     # echo 'hist:keys=next_pid:vals=ts0=common_timestamp ...
>     # echo 'hist:key=timer_pid=common_pid ...'
> 
> If a variable isn't a key variable or prefixed with 'vals=', the
> associated event field will be saved in a variable but won't be summed
> as a value:
> 
>     # echo 'hist:keys=next_pid:ts1=common_timestamp:...
> 
> Multiple variables can be assigned at the same time:
> 
>     # echo 'hist:keys=pid:vals=ts0=common_timestamp,b=field1,field2 ...
> 
> Multiple (or single) variables can also be assigned at the same time
> using separate assignments:
> 
>     # echo 'hist:keys=pid:vals=ts0=common_timestamp:b=field1:c=field2 ...

It seems the variable definition can be hard to read if multiple
variables with expression are used.  I think it'd be better to make it
clear what's the key and the values by separating the variable
definition.  For example, the above example can be written as

  # echo 'hist:key=pid:val=ts0:ts0=$common_timestamp:b=field1:...'

I know this is not a good example since the 'ts0' is a simple
reference to the timestamp but it can be more complex..

What do you think?

Thanks,
Namhyung


> 
> Variables set as above can be used by being referenced from another
> event, as described in a subsequent patch.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>

[toc] | [next] | [standalone]


#1691926

FromTom Zanussi <tom.zanussi@linux.intel.com>
Date2017-07-19 17:50 +0200
Message-ID<u4ZoC-27S-39@gated-at.bofh.it>
In reply to#1690862
Hi Namhyung,

On Wed, 2017-07-19 at 10:07 +0900, Namhyung Kim wrote:
> Hi Tom,
> 
> On Mon, Jun 26, 2017 at 05:49:17PM -0500, Tom Zanussi wrote:
> > Add support for saving the value of a current event's event field by
> > assigning it to a variable that can be read by a subsequent event.
> > 
> > The basic syntax for saving a variable is to simply prefix a unique
> > variable name not corresponding to any keyword along with an '=' sign
> > to any event field.
> > 
> > Both keys and values can be saved and retrieved in this way:
> > 
> >     # echo 'hist:keys=next_pid:vals=ts0=common_timestamp ...
> >     # echo 'hist:key=timer_pid=common_pid ...'
> > 
> > If a variable isn't a key variable or prefixed with 'vals=', the
> > associated event field will be saved in a variable but won't be summed
> > as a value:
> > 
> >     # echo 'hist:keys=next_pid:ts1=common_timestamp:...
> > 
> > Multiple variables can be assigned at the same time:
> > 
> >     # echo 'hist:keys=pid:vals=ts0=common_timestamp,b=field1,field2 ...
> > 
> > Multiple (or single) variables can also be assigned at the same time
> > using separate assignments:
> > 
> >     # echo 'hist:keys=pid:vals=ts0=common_timestamp:b=field1:c=field2 ...
> 
> It seems the variable definition can be hard to read if multiple
> variables with expression are used.  I think it'd be better to make it
> clear what's the key and the values by separating the variable
> definition.  For example, the above example can be written as
> 
>   # echo 'hist:key=pid:val=ts0:ts0=$common_timestamp:b=field1:...'
> 
> I know this is not a good example since the 'ts0' is a simple
> reference to the timestamp but it can be more complex..
> 
> What do you think?
> 

Yes, I think that makes sense - I was never a big fan of that syntax
anyway.  I'll make that change in the next version.

Thanks,

Tom

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web