Skip to content

Commit f4ca2d2

Browse files
committed
Merge: tracing: Add division and multiplication support for hist triggers [rhel-9]
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6586 # Merge Request Required Information JIRA: https://issues.redhat.com/browse/RHEL-67679 ## Summary of Changes Backport support for division and multiplication in histogram triggers as well as fixes and optimizations for it. Support for creating hist trigger variables from literal is added, too, as it is a dependency of one of the fixes and is documented together with the former. ## Approved Development Ticket(s) All submissions to CentOS Stream must reference a ticket in [Red Hat Jira](https://issues.redhat.com/). <details><summary>Click for formatting instructions</summary> Please follow the CentOS Stream [contribution documentation](https://docs.centos.org/en-US/stream-contrib/quickstart/) for how to file this ticket and have it approved. List tickets each on their own line of this description using the format "Resolves: RHEL-76229", "Related: RHEL-76229" or "Reverts: RHEL-76229", as appropriate. </details> Signed-off-by: Tomas Glozar <[email protected]> Approved-by: Joe Lawrence <[email protected]> Approved-by: Waiman Long <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents 4c62eee + 2b20078 commit f4ca2d2

File tree

2 files changed

+350
-91
lines changed

2 files changed

+350
-91
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)