Skip to content

Commit 2d2f6d4

Browse files
Kalesh Singhrostedt
authored andcommitted
tracing/histogram: Document expression arithmetic and constants
Histogram expressions now support division, and multiplication in addition to the already supported subtraction and addition operators. Numeric constants can also be used in a hist trigger expressions or assigned to a variable and used by refernce in an expression. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kalesh Singh <[email protected]> Reviewed-by: Namhyung Kim <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 722edda commit 2d2f6d4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Documentation/trace/histogram.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,20 @@ using the same key and variable from yet another event::
17631763

17641764
# echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger
17651765

1766+
Expressions support the use of addition, subtraction, multiplication and
1767+
division operators (+-*/).
1768+
1769+
Note that division by zero always returns -1.
1770+
1771+
Numeric constants can also be used directly in an expression::
1772+
1773+
# echo 'hist:keys=next_pid:timestamp_secs=common_timestamp/1000000 ...' >> event/trigger
1774+
1775+
or assigned to a variable and referenced in a subsequent expression::
1776+
1777+
# echo 'hist:keys=next_pid:us_per_sec=1000000 ...' >> event/trigger
1778+
# echo 'hist:keys=next_pid:timestamp_secs=common_timestamp/$us_per_sec ...' >> event/trigger
1779+
17661780
2.2.2 Synthetic Events
17671781
----------------------
17681782

0 commit comments

Comments
 (0)