mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-11 17:34:57 +00:00
wprobe: fix moving average
SVN-Revision: 15064
This commit is contained in:
parent
ab55cf802d
commit
9dc3c72f0d
@ -448,10 +448,10 @@ wprobe_scale_stats(const struct wprobe_item *item, struct wprobe_value *val, int
|
||||
else if (wprobe_fam.attrbuf[WPROBE_ATTR_SCALE])
|
||||
scale = nla_get_u32(wprobe_fam.attrbuf[WPROBE_ATTR_SCALE]);
|
||||
|
||||
if ((scale > 0) && (val[i].n >= scale)) {
|
||||
if ((scale > 0) && (val[i].n > scale)) {
|
||||
val[i].s = div_s64(val[i].s, scale);
|
||||
val[i].ss = div_s64(val[i].ss, scale);
|
||||
val[i].n /= scale;
|
||||
val[i].n = val[i].n / scale + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user