Skip to content

Commit

Permalink
tracing/histogram: Update division by 0 documentation
Browse files Browse the repository at this point in the history
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/20211029183339.3216491-3-kaleshsingh@google.com

Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Kalesh Singh authored and rostedt committed Nov 2, 2021
1 parent 8b5d46f commit 0ca6d12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Documentation/trace/histogram.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,8 @@ using the same key and variable from yet another event::
Expressions support the use of addition, subtraction, multiplication and
division operators (+-\*/).

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

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

Expand Down

0 comments on commit 0ca6d12

Please sign in to comment.