[PATCH v2] Documentation: trace: histogram-design: fix bracket, improve wording

From: Manuel Ebner

Date: Thu Sep 03 2026 - 03:19:05 EST


Add missing ')' and add note about the new way of triggering an event.

CC: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Manuel Ebner <manuelebnerli@xxxxxxxxxxx>
---
I sent the previous mail on accident, sorry.

@ Steven, I added this line to your suggestion because else the references
wouldn't make sense. References: $wakeup_lat, next_pid
Let me know what you think.

+ ... (which
+could equivalently be written trace(wakeup_latency,$wakeup_lat,next_pid)
are implemented, the parameters specified to the trace handler must be
variables. In this case, $wakeup_lat is obviously a variable, but
next_pid isn't, since it's just naming a field in the sched_switch
---
Documentation/trace/histogram-design.rst | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/trace/histogram-design.rst b/Documentation/trace/histogram-design.rst
index 41a726cd3..c0271463b 100644
--- a/Documentation/trace/histogram-design.rst
+++ b/Documentation/trace/histogram-design.rst
@@ -877,7 +877,7 @@ variables specified in the wakeup_latency() trace action, and use
them to generate a new wakeup_latency event into the trace stream.

Note that the way the trace handlers such as wakeup_latency() (which
-could equivalently be written trace(wakeup_latency,$wakeup_lat,next_pid)
+could equivalently be written trace(wakeup_latency,$wakeup_lat,next_pid))
are implemented, the parameters specified to the trace handler must be
variables. In this case, $wakeup_lat is obviously a variable, but
next_pid isn't, since it's just naming a field in the sched_switch
@@ -916,6 +916,13 @@ means it will be automatically converted into a field variable::
onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid)' >>
/sys/kernel/tracing/events/sched/sched_switch/trigger

+Note that the above is the old way to trigger a synthetic event, whereas the
+newer way is preferred, which uses the trace() action handler::
+
+ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0: \
+ onmatch(sched.sched_waking).trace(wakeup_latency,$wakeup_lat,next_pid)' >>
+ /sys/kernel/tracing/events/sched/sched_switch/trigger
+
The diagram for the sched_switch event is similar to previous examples
but shows the additional field_vars[] array for hist_data and shows
the linkages between the field_vars and the variables and references
--
2.54.0