aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/arb.h
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2019-10-07 19:05:05 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2019-10-07 19:05:05 +0000
commit1a13f2e6b444dd8048aebd2ac1f0b8fae9e3088f (patch)
tree330bdbba535e6a9a9e29639c53c83e8bf933bfc9 /sys/sys/arb.h
parentd253c454bb88a1c3ff5be6d0f644342ba05644f1 (diff)
downloadsrc-1a13f2e6b444dd8048aebd2ac1f0b8fae9e3088f.tar.gz
src-1a13f2e6b444dd8048aebd2ac1f0b8fae9e3088f.zip
Introduce stats(3), a flexible statistics gathering API.
This provides a framework to define a template describing a set of "variables of interest" and the intended way for the framework to maintain them (for example the maximum, sum, t-digest, or a combination thereof). Afterwards the user code feeds in the raw data, and the framework maintains these variables inside a user-provided, opaque stats blobs. The framework also provides a way to selectively extract the stats from the blobs. The stats(3) framework can be used in both userspace and the kernel. See the stats(3) manual page for details. This will be used by the upcoming TCP statistics gathering code, https://reviews.freebsd.org/D20655. The stats(3) framework is disabled by default for now, except in the NOTES kernel (for QA); it is expected to be enabled in amd64 GENERIC after a cool down period. Reviewed by: sef (earlier version) Obtained from: Netflix Relnotes: yes Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D20477
Notes
Notes: svn path=/head/; revision=353283
Diffstat (limited to 'sys/sys/arb.h')
-rw-r--r--sys/sys/arb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/arb.h b/sys/sys/arb.h
index e5f0a450cb3a..4bcd17bd2f74 100644
--- a/sys/sys/arb.h
+++ b/sys/sys/arb.h
@@ -776,4 +776,7 @@ name##_ARB_REINSERT(struct name *head, struct type *elm) \
#define ARB_ARRFOREACH_REVERSE(x, field, head) \
ARB_ARRFOREACH_REVWCOND(x, field, head, 1)
+#define ARB_RESET_TREE(head, name, maxn) \
+ *(head) = ARB_INITIALIZER(name, maxn)
+
#endif /* _SYS_ARB_H_ */