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]>
This commit is contained in:
Kalesh Singh authored and Steven Rostedt (VMware) committed 2021-10-26 20:27:20 -04:00
1 parent 722eddaa40
commit 2d2f6d4b8c
1 file changed
+14
+14
View File
@@ -1763,6 +1763,20 @@ using the same key and variable from yet another event::
# echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger
Expressions support the use of addition, subtraction, multiplication and
division operators (+-*/).
Note that division by zero always returns -1.
Numeric constants can also be used directly in an expression::
# echo 'hist:keys=next_pid:timestamp_secs=common_timestamp/1000000 ...' >> event/trigger
or assigned to a variable and referenced in a subsequent expression::
# echo 'hist:keys=next_pid:us_per_sec=1000000 ...' >> event/trigger
# echo 'hist:keys=next_pid:timestamp_secs=common_timestamp/$us_per_sec ...' >> event/trigger
2.2.2 Synthetic Events
----------------------