Commit c87f60a7 authored by Michal Rostecki's avatar Michal Rostecki Committed by Alexei Starovoitov

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: default avatarMichal Rostecki <mrostecki@opensuse.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 37739d1b
...@@ -30,15 +30,8 @@ ...@@ -30,15 +30,8 @@
#define ALLOW_PKT 1 #define ALLOW_PKT 1
#define TCP_ECN_OK 1 #define TCP_ECN_OK 1
#define HBM_DEBUG 0 // Set to 1 to enable debugging #ifndef HBM_DEBUG // Define HBM_DEBUG to enable debugging
#if HBM_DEBUG #undef bpf_printk
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
#else
#define bpf_printk(fmt, ...) #define bpf_printk(fmt, ...)
#endif #endif
......
...@@ -21,13 +21,6 @@ ...@@ -21,13 +21,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_basertt(struct bpf_sock_ops *skops) int bpf_basertt(struct bpf_sock_ops *skops)
{ {
......
...@@ -22,13 +22,6 @@ ...@@ -22,13 +22,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_bufs(struct bpf_sock_ops *skops) int bpf_bufs(struct bpf_sock_ops *skops)
{ {
......
...@@ -22,13 +22,6 @@ ...@@ -22,13 +22,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_clamp(struct bpf_sock_ops *skops) int bpf_clamp(struct bpf_sock_ops *skops)
{ {
......
...@@ -21,13 +21,6 @@ ...@@ -21,13 +21,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_cong(struct bpf_sock_ops *skops) int bpf_cong(struct bpf_sock_ops *skops)
{ {
......
...@@ -22,13 +22,6 @@ ...@@ -22,13 +22,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_iw(struct bpf_sock_ops *skops) int bpf_iw(struct bpf_sock_ops *skops)
{ {
......
...@@ -21,13 +21,6 @@ ...@@ -21,13 +21,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_rwnd(struct bpf_sock_ops *skops) int bpf_rwnd(struct bpf_sock_ops *skops)
{ {
......
...@@ -21,13 +21,6 @@ ...@@ -21,13 +21,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_synrto(struct bpf_sock_ops *skops) int bpf_synrto(struct bpf_sock_ops *skops)
{ {
......
...@@ -20,13 +20,6 @@ ...@@ -20,13 +20,6 @@
#define DEBUG 1 #define DEBUG 1
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
SEC("sockops") SEC("sockops")
int bpf_basertt(struct bpf_sock_ops *skops) int bpf_basertt(struct bpf_sock_ops *skops)
{ {
......
...@@ -7,13 +7,6 @@ ...@@ -7,13 +7,6 @@
#define SAMPLE_SIZE 64ul #define SAMPLE_SIZE 64ul
#define MAX_CPUS 128 #define MAX_CPUS 128
#define bpf_printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
struct bpf_map_def SEC("maps") my_map = { struct bpf_map_def SEC("maps") my_map = {
.type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
.key_size = sizeof(int), .key_size = sizeof(int),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment