summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLorenz Bauer <lmb@cloudflare.com>2018-11-16 11:41:08 +0000
committerDaniel Borkmann <daniel@iogearbox.net>2018-11-20 00:53:39 +0100
commit96b3b6c9091d23289721350e32c63cc8749686be (patch)
tree94552c4164204873c93534fb2383044e122d0488 /include
parent23499442c319412aa8e54e7a939e2eb531bdd77d (diff)
bpf: allow zero-initializing hash map seed
Add a new flag BPF_F_ZERO_SEED, which forces a hash map to initialize the seed to zero. This is useful when doing performance analysis both on individual BPF programs, as well as the kernel's hash table implementation. Signed-off-by: Lorenz Bauer <lmb@cloudflare.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/bpf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 47d606d744cc..8c01b89a4cb4 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -269,6 +269,9 @@ enum bpf_attach_type {
/* Flag for stack_map, store build_id+offset instead of pointer */
#define BPF_F_STACK_BUILD_ID (1U << 5)
+/* Zero-initialize hash function seed. This should only be used for testing. */
+#define BPF_F_ZERO_SEED (1U << 6)
+
enum bpf_stack_build_id_status {
/* user space need an empty entry to identify end of a trace */
BPF_STACK_BUILD_ID_EMPTY = 0,