Skip to contentSkip to conversation

Documentation/trace: Add clarification how histogram onmatch works

PATCH In review Tzvetomir Stoyanov 4 participants 5 messages May 7, 2019 – May 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Documentation/trace: Add clarification how histogram onmatch works

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.

---
 Documentation/trace/histogram.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/trace/histogram.txt +8 -4
index 7ffea6aa22e3..d97f0530a731 100644
@@ -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,\
Signature · 1 line
2.21.0
maintainer Reviewed-by on v2 1/1
#1 lore raw

Tom,

Can you review this patch.

Jon,

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

Thanks!

-- Steve

Quoted 40 lines · On Tue, 7 May 2019 17:49:46 +0300 Tzvetomir Stoyanov <[email protected]>…

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.

---
 Documentation/trace/histogram.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/trace/histogram.txt +8 -4
index 7ffea6aa22e3..d97f0530a731 100644
@@ -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,\
Reviewed-by
#2 lore raw

Hi Steve,

Quoted 4 lines · Steven Rostedt

Tom,

Can you review this patch.

Sure.

Quoted 8 lines

Jon,

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

Thanks!

Thanks,

Tom

Quoted 64 lines

-- Steve

Quoted 56 lines · On Tue, 7 May 2019 17:49:46 +0300 Tzvetomir Stoyanov <[email protected]>…

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.

---
 Documentation/trace/histogram.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/trace/histogram.txt +0 -0
index 7ffea6aa22e3..d97f0530a731 100644
@@ -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

Documentation/trace/histogram.txt +1 -1
-    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

Documentation/trace/histogram.txt +1 -0
+    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

Documentation/trace/histogram.txt +1 -2
-    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
,\
maintainer
#3 lore raw

Jon,

Can you take this patch in your tree?

Tom,

Thanks for the review!

-- Steve

Quoted 89 lines · On Wed, 08 May 2019 08:15:26 -0500 Tom Zanussi <[email protected]> wrote:

Hi Steve,

Quoted 4 lines · Steven Rostedt

Tom,

Can you review this patch.

Sure.

Quoted 8 lines

Jon,

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

Thanks!

Thanks,

Tom

Quoted 64 lines

-- Steve

Quoted 56 lines · On Tue, 7 May 2019 17:49:46 +0300 Tzvetomir Stoyanov <[email protected]>…

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.

---
 Documentation/trace/histogram.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/trace/histogram.txt +0 -0
index 7ffea6aa22e3..d97f0530a731 100644
@@ -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

Documentation/trace/histogram.txt +1 -1
-    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

Documentation/trace/histogram.txt +1 -0
+    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

Documentation/trace/histogram.txt +1 -2
-    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
,\  
maintainer
#4 lore raw
Quoted 3 lines · On Wed, 8 May 2019 12:18:54 -0400 Steven Rostedt <[email protected]> wrote:

Jon,

Can you take this patch in your tree?

Will do.

jon