From bfc28100cf7a713ea17b72c2cb68f0808f96404c Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Fri, 29 Oct 2021 11:33:28 -0700 Subject: [PATCH] UPSTREAM: 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/20211029183339.3216491-3-kaleshsingh@google.com Cc: Jonathan Corbet Cc: Ingo Molnar Cc: Shuah Khan Cc: Tom Zanussi Signed-off-by: Kalesh Singh Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 0ca6d12c9768ee15e6c7d65ddb5cb35c05946e1e) Bug: 146055070 Bug: 145972256 Signed-off-by: Kalesh Singh Change-Id: I5bf188056aa42bee69f0e4439a23b004295322db --- Documentation/trace/histogram.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/trace/histogram.rst b/Documentation/trace/histogram.rst index 66ec972dfb78..859fd1b76c63 100644 --- a/Documentation/trace/histogram.rst +++ b/Documentation/trace/histogram.rst @@ -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::