summaryrefslogtreecommitdiff
path: root/samples/bpf/hbm_kern.h
diff options
context:
space:
mode:
authorMichal Rostecki <mrostecki@opensuse.org>2019-05-23 14:53:55 +0200
committerAlexei Starovoitov <ast@kernel.org>2019-05-24 13:47:17 -0700
commitc87f60a77db2c01770ef9c6ea792a1d39c3594ff (patch)
tree86953c8307a303a61b3c152c6dd95ada5329f020 /samples/bpf/hbm_kern.h
parent37739d1b4fe744da9c2f342224000ae7fbb5c063 (diff)
samples: bpf: Do not define bpf_printk macro
The bpf_printk macro was moved to bpf_helpers.h which is included in all example programs. Signed-off-by: Michal Rostecki <mrostecki@opensuse.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/hbm_kern.h')
-rw-r--r--samples/bpf/hbm_kern.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/samples/bpf/hbm_kern.h b/samples/bpf/hbm_kern.h
index c5635d924193..41384be233b9 100644
--- a/samples/bpf/hbm_kern.h
+++ b/samples/bpf/hbm_kern.h
@@ -30,15 +30,8 @@
#define ALLOW_PKT 1
#define TCP_ECN_OK 1
-#define HBM_DEBUG 0 // Set to 1 to enable debugging
-#if HBM_DEBUG
-#define bpf_printk(fmt, ...) \
-({ \
- char ____fmt[] = fmt; \
- bpf_trace_printk(____fmt, sizeof(____fmt), \
- ##__VA_ARGS__); \
-})
-#else
+#ifndef HBM_DEBUG // Define HBM_DEBUG to enable debugging
+#undef bpf_printk
#define bpf_printk(fmt, ...)
#endif