linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works
@ 2019-05-07 14:49 Tzvetomir Stoyanov
  2019-05-08  0:11 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Tzvetomir Stoyanov @ 2019-05-07 14:49 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, linux-kernel, tom.zanussi

The current trace documentation, the section describing histogram's "onmatch"
is not straightforward enough about how this action is applied. It is not
clear what criteria are used to "match" both events. A short note is added,
describing what exactly is compared in order to match the events.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 Documentation/trace/histogram.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt
index 7ffea6aa22e3..d97f0530a731 100644
--- a/Documentation/trace/histogram.txt
+++ b/Documentation/trace/histogram.txt
@@ -1863,7 +1863,10 @@ hist trigger specification.
 
     The 'matching.event' specification is simply the fully qualified
     event name of the event that matches the target event for the
-    onmatch() functionality, in the form 'system.event_name'.
+    onmatch() functionality, in the form 'system.event_name'. Histogram
+    keys of both events are compared to find if events match. In the case
+    multiple histogram keys are used, both events must have the same
+    number of keys, and the keys must match in the same order.
 
     Finally, the number and type of variables/fields in the 'param
     list' must match the number and types of the fields in the
@@ -1920,9 +1923,10 @@ hist trigger specification.
 	    /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
 
     Then, when the corresponding thread is actually scheduled onto the
-    CPU by a sched_switch event, calculate the latency and use that
-    along with another variable and an event field to generate a
-    wakeup_latency synthetic event:
+    CPU by a sched_switch event (where the sched_waking key	"saved_pid"
+    matches the sched_switch key "next_pid"), calculate the latency and
+    use that along with another variable and an event field to generate
+    a wakeup_latency synthetic event:
 
     # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:\
             onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,\
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works
  2019-05-07 14:49 [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works Tzvetomir Stoyanov
@ 2019-05-08  0:11 ` Steven Rostedt
  2019-05-08 13:15   ` Tom Zanussi
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2019-05-08  0:11 UTC (permalink / raw)
  To: Tzvetomir Stoyanov
  Cc: linux-trace-devel, linux-kernel, Tom Zanussi, Jonathan Corbet


Tom,

Can you review this patch.

Jon,

After Tom gives his review, can you take this in your tree?

Thanks!

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve


On Tue,  7 May 2019 17:49:46 +0300
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> The current trace documentation, the section describing histogram's "onmatch"
> is not straightforward enough about how this action is applied. It is not
> clear what criteria are used to "match" both events. A short note is added,
> describing what exactly is compared in order to match the events.
> 
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
>  Documentation/trace/histogram.txt | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt
> index 7ffea6aa22e3..d97f0530a731 100644
> --- a/Documentation/trace/histogram.txt
> +++ b/Documentation/trace/histogram.txt
> @@ -1863,7 +1863,10 @@ hist trigger specification.
>  
>      The 'matching.event' specification is simply the fully qualified
>      event name of the event that matches the target event for the
> -    onmatch() functionality, in the form 'system.event_name'.
> +    onmatch() functionality, in the form 'system.event_name'. Histogram
> +    keys of both events are compared to find if events match. In the case
> +    multiple histogram keys are used, both events must have the same
> +    number of keys, and the keys must match in the same order.
>  
>      Finally, the number and type of variables/fields in the 'param
>      list' must match the number and types of the fields in the
> @@ -1920,9 +1923,10 @@ hist trigger specification.
>  	    /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
>  
>      Then, when the corresponding thread is actually scheduled onto the
> -    CPU by a sched_switch event, calculate the latency and use that
> -    along with another variable and an event field to generate a
> -    wakeup_latency synthetic event:
> +    CPU by a sched_switch event (where the sched_waking key	"saved_pid"
> +    matches the sched_switch key "next_pid"), calculate the latency and
> +    use that along with another variable and an event field to generate
> +    a wakeup_latency synthetic event:
>  
>      # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:\
>              onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,\


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works
  2019-05-08  0:11 ` Steven Rostedt
@ 2019-05-08 13:15   ` Tom Zanussi
  2019-05-08 16:18     ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Zanussi @ 2019-05-08 13:15 UTC (permalink / raw)
  To: Steven Rostedt, Tzvetomir Stoyanov
  Cc: linux-trace-devel, linux-kernel, Jonathan Corbet

Hi Steve,

On Tue, 2019-05-07 at 20:11 -0400, Steven Rostedt wrote:
> Tom,
> 
> Can you review this patch.
> 

Sure.

> Jon,
> 
> After Tom gives his review, can you take this in your tree?
> 
> Thanks!
> 
> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 

Reviewed-by: Tom Zanussi <tom.zanussi@linux.intel.com>

Thanks,

Tom

> -- Steve
> 
> 
> On Tue,  7 May 2019 17:49:46 +0300
> Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> 
> > The current trace documentation, the section describing histogram's
> > "onmatch"
> > is not straightforward enough about how this action is applied. It
> > is not
> > clear what criteria are used to "match" both events. A short note
> > is added,
> > describing what exactly is compared in order to match the events.
> > 
> > Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> > ---
> >  Documentation/trace/histogram.txt | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/Documentation/trace/histogram.txt
> > b/Documentation/trace/histogram.txt
> > index 7ffea6aa22e3..d97f0530a731 100644
> > --- a/Documentation/trace/histogram.txt
> > +++ b/Documentation/trace/histogram.txt
> > @@ -1863,7 +1863,10 @@ hist trigger specification.
> >  
> >      The 'matching.event' specification is simply the fully
> > qualified
> >      event name of the event that matches the target event for the
> > -    onmatch() functionality, in the form 'system.event_name'.
> > +    onmatch() functionality, in the form 'system.event_name'.
> > Histogram
> > +    keys of both events are compared to find if events match. In
> > the case
> > +    multiple histogram keys are used, both events must have the
> > same
> > +    number of keys, and the keys must match in the same order.
> >  
> >      Finally, the number and type of variables/fields in the 'param
> >      list' must match the number and types of the fields in the
> > @@ -1920,9 +1923,10 @@ hist trigger specification.
> >  	    /sys/kernel/debug/tracing/events/sched/sched_waking/tr
> > igger
> >  
> >      Then, when the corresponding thread is actually scheduled onto
> > the
> > -    CPU by a sched_switch event, calculate the latency and use
> > that
> > -    along with another variable and an event field to generate a
> > -    wakeup_latency synthetic event:
> > +    CPU by a sched_switch event (where the sched_waking key	
> > "saved_pid"
> > +    matches the sched_switch key "next_pid"), calculate the
> > latency and
> > +    use that along with another variable and an event field to
> > generate
> > +    a wakeup_latency synthetic event:
> >  
> >      # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-
> > $ts0:\
> >              onmatch(sched.sched_waking).wakeup_latency($wakeup_lat
> > ,\
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works
  2019-05-08 13:15   ` Tom Zanussi
@ 2019-05-08 16:18     ` Steven Rostedt
  2019-05-08 16:22       ` Jonathan Corbet
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2019-05-08 16:18 UTC (permalink / raw)
  To: Tom Zanussi
  Cc: Tzvetomir Stoyanov, linux-trace-devel, linux-kernel, Jonathan Corbet


Jon,

Can you take this patch in your tree?

Tom,

Thanks for the review!

-- Steve


On Wed, 08 May 2019 08:15:26 -0500
Tom Zanussi <zanussi@kernel.org> wrote:

> Hi Steve,
> 
> On Tue, 2019-05-07 at 20:11 -0400, Steven Rostedt wrote:
> > Tom,
> > 
> > Can you review this patch.
> >   
> 
> Sure.
> 
> > Jon,
> > 
> > After Tom gives his review, can you take this in your tree?
> > 
> > Thanks!
> > 
> > Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> >   
> 
> Reviewed-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> 
> Thanks,
> 
> Tom
> 
> > -- Steve
> > 
> > 
> > On Tue,  7 May 2019 17:49:46 +0300
> > Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> >   
> > > The current trace documentation, the section describing histogram's
> > > "onmatch"
> > > is not straightforward enough about how this action is applied. It
> > > is not
> > > clear what criteria are used to "match" both events. A short note
> > > is added,
> > > describing what exactly is compared in order to match the events.
> > > 
> > > Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> > > ---
> > >  Documentation/trace/histogram.txt | 12 ++++++++----
> > >  1 file changed, 8 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/Documentation/trace/histogram.txt
> > > b/Documentation/trace/histogram.txt
> > > index 7ffea6aa22e3..d97f0530a731 100644
> > > --- a/Documentation/trace/histogram.txt
> > > +++ b/Documentation/trace/histogram.txt
> > > @@ -1863,7 +1863,10 @@ hist trigger specification.
> > >  
> > >      The 'matching.event' specification is simply the fully
> > > qualified
> > >      event name of the event that matches the target event for the
> > > -    onmatch() functionality, in the form 'system.event_name'.
> > > +    onmatch() functionality, in the form 'system.event_name'.
> > > Histogram
> > > +    keys of both events are compared to find if events match. In
> > > the case
> > > +    multiple histogram keys are used, both events must have the
> > > same
> > > +    number of keys, and the keys must match in the same order.
> > >  
> > >      Finally, the number and type of variables/fields in the 'param
> > >      list' must match the number and types of the fields in the
> > > @@ -1920,9 +1923,10 @@ hist trigger specification.
> > >  	    /sys/kernel/debug/tracing/events/sched/sched_waking/tr
> > > igger
> > >  
> > >      Then, when the corresponding thread is actually scheduled onto
> > > the
> > > -    CPU by a sched_switch event, calculate the latency and use
> > > that
> > > -    along with another variable and an event field to generate a
> > > -    wakeup_latency synthetic event:
> > > +    CPU by a sched_switch event (where the sched_waking key	
> > > "saved_pid"
> > > +    matches the sched_switch key "next_pid"), calculate the
> > > latency and
> > > +    use that along with another variable and an event field to
> > > generate
> > > +    a wakeup_latency synthetic event:
> > >  
> > >      # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-
> > > $ts0:\
> > >              onmatch(sched.sched_waking).wakeup_latency($wakeup_lat
> > > ,\  
> > 
> >   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works
  2019-05-08 16:18     ` Steven Rostedt
@ 2019-05-08 16:22       ` Jonathan Corbet
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2019-05-08 16:22 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Tom Zanussi, Tzvetomir Stoyanov, linux-trace-devel, linux-kernel

On Wed, 8 May 2019 12:18:54 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Jon,
> 
> Can you take this patch in your tree?

Will do.

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-08 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 14:49 [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works Tzvetomir Stoyanov
2019-05-08  0:11 ` Steven Rostedt
2019-05-08 13:15   ` Tom Zanussi
2019-05-08 16:18     ` Steven Rostedt
2019-05-08 16:22       ` Jonathan Corbet

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).