Message ID | 20231010155427.4822d4d7@gandalf.local.home (mailing list archive) |
---|---|
State | Under Review |
Headers | show |
Series | libtraceeval: Do not update stats if both the timestamp and value are zero | expand |
diff --git a/src/histograms.c b/src/histograms.c index 480b78da606b..4e03c967dca3 100644 --- a/src/histograms.c +++ b/src/histograms.c @@ -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;