libtraceeval: Do not update stats if both the timestamp and value are zero
PATCH 1/1 libtraceeval: Do not update stats if both the timestamp and value are zero
From: "Steven Rostedt (Google)" <[email protected]>
If the timestamp and the value are both zero, the stats will not be updated. We may in the future add a way to allow it to add zero of both, but in most case, a delta of zero is pretty meaningless.
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/histograms.c | 4 ++++ 1 file changed, 4 insertions(+)
src/histograms.c +4 -0
@@ -538,6 +538,10 @@ __hidden void _teval_update_stat(struct traceeval_type *type, unsigned long long val, unsigned long long ts) { +/* If both the delta and the timestamp are zero, ignore this */ +if (!val && !ts) +return ; +if (!stat->count++) { stat->max = val; stat->min = val;
Signature · 1 line
2.42.0