mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-01-11 23:50:14 +02:00
wprobe: fix moving average
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15064 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
f1edfd3cf5
commit
ab6bc07067
@ -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])
|
else if (wprobe_fam.attrbuf[WPROBE_ATTR_SCALE])
|
||||||
scale = nla_get_u32(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].s = div_s64(val[i].s, scale);
|
||||||
val[i].ss = div_s64(val[i].ss, 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