[libcamera-devel] [PATCH 2/2] utils: tracepoints: ipa call analyzer: Fix std dev calculation for single value
Paul Elder
paul.elder at ideasonboard.com
Wed Feb 17 10:29:37 CET 2021
Some IPA calls might only be called once, such as configure(), start(),
stop(), etc. This causes the analyzer to break as stddev() on a single
value is invalid. Set the stddev to zero if there is only one datapoint.
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
utils/tracepoints/analyze-ipa-trace.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/tracepoints/analyze-ipa-trace.py b/utils/tracepoints/analyze-ipa-trace.py
index 50fbbf42..cd7e9ffc 100755
--- a/utils/tracepoints/analyze-ipa-trace.py
+++ b/utils/tracepoints/analyze-ipa-trace.py
@@ -58,7 +58,7 @@ def main(argv):
rows.append(['pipeline:function', 'min', 'max', 'mean', 'stddev'])
for k, v in samples.items():
mean = int(stats.mean(v))
- stddev = int(stats.stdev(v))
+ stddev = int(stats.stdev(v)) if len(v) > 1 else 0
minv = min(v)
maxv = max(v)
rows.append([k, str(minv), str(maxv), str(mean), str(stddev)])
--
2.27.0
More information about the libcamera-devel
mailing list