Skip to content

Commit 4b2cb46

Browse files
tracing/histogram: Document expression arithmetic and constants
JIRA: https://issues.redhat.com/browse/RHEL-67679 commit 2d2f6d4 Author: Kalesh Singh <kaleshsingh@google.com> Date: Mon Oct 25 13:08:40 2021 -0700 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/20211025200852.3002369-9-kaleshsingh@google.com Signed-off-by: Kalesh Singh <kaleshsingh@google.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Tomas Glozar <tglozar@redhat.com>
1 parent adca273 commit 4b2cb46

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
@@ -1762,6 +1762,20 @@ using the same key and variable from yet another event::
17621762

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

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

0 commit comments

Comments
 (0)