aboutsummaryrefslogtreecommitdiffstats
path: root/package/wprobe/src
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-03-29 02:12:47 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-03-29 02:12:47 +0000
commit48592d1229b86a997c3f8b9ce72c6a0526441e58 (patch)
tree4086c0785bc0859255e5a514a782d99349bb5e43 /package/wprobe/src
parentc4349fe7f3ee316f390a360f66e15f77c271fd0c (diff)
downloadupstream-48592d1229b86a997c3f8b9ce72c6a0526441e58.tar.gz
upstream-48592d1229b86a997c3f8b9ce72c6a0526441e58.tar.bz2
upstream-48592d1229b86a997c3f8b9ce72c6a0526441e58.zip
wprobe: fix moving average
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15064 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/wprobe/src')
-rw-r--r--package/wprobe/src/kernel/wprobe-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/wprobe/src/kernel/wprobe-core.c b/package/wprobe/src/kernel/wprobe-core.c
index 03e9049464..798cd7ddec 100644
--- a/package/wprobe/src/kernel/wprobe-core.c
+++ b/package/wprobe/src/kernel/wprobe-core.c
@@ -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;
}
}
}