Skip to content

Commit 0ca6d12

Browse files
Kalesh Singhrostedt
authored andcommitted
tracing/histogram: Update division by 0 documentation
If the divisor is a constant and zero, the undeifned case can be detected and an error returned instead of -1. Link: https://lkml.kernel.org/r/[email protected] Cc: Jonathan Corbet <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Tom Zanussi <[email protected]> Signed-off-by: Kalesh Singh <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 8b5d46f commit 0ca6d12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Documentation/trace/histogram.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,8 @@ using the same key and variable from yet another event::
17661766
Expressions support the use of addition, subtraction, multiplication and
17671767
division operators (+-\*/).
17681768

1769-
Note that division by zero always returns -1.
1769+
Note if division by zero cannot be detected at parse time (i.e. the
1770+
divisor is not a constant), the result will be -1.
17701771

17711772
Numeric constants can also be used directly in an expression::
17721773

0 commit comments

Comments
 (0)