diff options
author | Michal Rostecki <mrostecki@opensuse.org> | 2019-05-23 08:53:55 -0400 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-24 16:47:17 -0400 |
commit | c87f60a77db2c01770ef9c6ea792a1d39c3594ff (patch) | |
tree | 86953c8307a303a61b3c152c6dd95ada5329f020 | |
parent | 37739d1b4fe744da9c2f342224000ae7fbb5c063 (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>
-rw-r--r-- | samples/bpf/hbm_kern.h | 11 | ||||
-rw-r--r-- | samples/bpf/tcp_basertt_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_bufs_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_clamp_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_cong_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_iw_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_rwnd_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_synrto_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/tcp_tos_reflect_kern.c | 7 | ||||
-rw-r--r-- | samples/bpf/xdp_sample_pkts_kern.c | 7 |
10 files changed, 2 insertions, 72 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 @@ | |||
30 | #define ALLOW_PKT 1 | 30 | #define ALLOW_PKT 1 |
31 | #define TCP_ECN_OK 1 | 31 | #define TCP_ECN_OK 1 |
32 | 32 | ||
33 | #define HBM_DEBUG 0 // Set to 1 to enable debugging | 33 | #ifndef HBM_DEBUG // Define HBM_DEBUG to enable debugging |
34 | #if HBM_DEBUG | 34 | #undef bpf_printk |
35 | #define bpf_printk(fmt, ...) \ | ||
36 | ({ \ | ||
37 | char ____fmt[] = fmt; \ | ||
38 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
39 | ##__VA_ARGS__); \ | ||
40 | }) | ||
41 | #else | ||
42 | #define bpf_printk(fmt, ...) | 35 | #define bpf_printk(fmt, ...) |
43 | #endif | 36 | #endif |
44 | 37 | ||
diff --git a/samples/bpf/tcp_basertt_kern.c b/samples/bpf/tcp_basertt_kern.c index 6ef1625e8b2c..9dba48c2b920 100644 --- a/samples/bpf/tcp_basertt_kern.c +++ b/samples/bpf/tcp_basertt_kern.c | |||
@@ -21,13 +21,6 @@ | |||
21 | 21 | ||
22 | #define DEBUG 1 | 22 | #define DEBUG 1 |
23 | 23 | ||
24 | #define bpf_printk(fmt, ...) \ | ||
25 | ({ \ | ||
26 | char ____fmt[] = fmt; \ | ||
27 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
28 | ##__VA_ARGS__); \ | ||
29 | }) | ||
30 | |||
31 | SEC("sockops") | 24 | SEC("sockops") |
32 | int bpf_basertt(struct bpf_sock_ops *skops) | 25 | int bpf_basertt(struct bpf_sock_ops *skops) |
33 | { | 26 | { |
diff --git a/samples/bpf/tcp_bufs_kern.c b/samples/bpf/tcp_bufs_kern.c index e03e204739fa..af8486f33771 100644 --- a/samples/bpf/tcp_bufs_kern.c +++ b/samples/bpf/tcp_bufs_kern.c | |||
@@ -22,13 +22,6 @@ | |||
22 | 22 | ||
23 | #define DEBUG 1 | 23 | #define DEBUG 1 |
24 | 24 | ||
25 | #define bpf_printk(fmt, ...) \ | ||
26 | ({ \ | ||
27 | char ____fmt[] = fmt; \ | ||
28 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
29 | ##__VA_ARGS__); \ | ||
30 | }) | ||
31 | |||
32 | SEC("sockops") | 25 | SEC("sockops") |
33 | int bpf_bufs(struct bpf_sock_ops *skops) | 26 | int bpf_bufs(struct bpf_sock_ops *skops) |
34 | { | 27 | { |
diff --git a/samples/bpf/tcp_clamp_kern.c b/samples/bpf/tcp_clamp_kern.c index a0dc2d254aca..26c0fd091f3c 100644 --- a/samples/bpf/tcp_clamp_kern.c +++ b/samples/bpf/tcp_clamp_kern.c | |||
@@ -22,13 +22,6 @@ | |||
22 | 22 | ||
23 | #define DEBUG 1 | 23 | #define DEBUG 1 |
24 | 24 | ||
25 | #define bpf_printk(fmt, ...) \ | ||
26 | ({ \ | ||
27 | char ____fmt[] = fmt; \ | ||
28 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
29 | ##__VA_ARGS__); \ | ||
30 | }) | ||
31 | |||
32 | SEC("sockops") | 25 | SEC("sockops") |
33 | int bpf_clamp(struct bpf_sock_ops *skops) | 26 | int bpf_clamp(struct bpf_sock_ops *skops) |
34 | { | 27 | { |
diff --git a/samples/bpf/tcp_cong_kern.c b/samples/bpf/tcp_cong_kern.c index 4fd3ca979a06..6d4dc4c7dd1e 100644 --- a/samples/bpf/tcp_cong_kern.c +++ b/samples/bpf/tcp_cong_kern.c | |||
@@ -21,13 +21,6 @@ | |||
21 | 21 | ||
22 | #define DEBUG 1 | 22 | #define DEBUG 1 |
23 | 23 | ||
24 | #define bpf_printk(fmt, ...) \ | ||
25 | ({ \ | ||
26 | char ____fmt[] = fmt; \ | ||
27 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
28 | ##__VA_ARGS__); \ | ||
29 | }) | ||
30 | |||
31 | SEC("sockops") | 24 | SEC("sockops") |
32 | int bpf_cong(struct bpf_sock_ops *skops) | 25 | int bpf_cong(struct bpf_sock_ops *skops) |
33 | { | 26 | { |
diff --git a/samples/bpf/tcp_iw_kern.c b/samples/bpf/tcp_iw_kern.c index 9b139ec69560..da61d53378b3 100644 --- a/samples/bpf/tcp_iw_kern.c +++ b/samples/bpf/tcp_iw_kern.c | |||
@@ -22,13 +22,6 @@ | |||
22 | 22 | ||
23 | #define DEBUG 1 | 23 | #define DEBUG 1 |
24 | 24 | ||
25 | #define bpf_printk(fmt, ...) \ | ||
26 | ({ \ | ||
27 | char ____fmt[] = fmt; \ | ||
28 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
29 | ##__VA_ARGS__); \ | ||
30 | }) | ||
31 | |||
32 | SEC("sockops") | 25 | SEC("sockops") |
33 | int bpf_iw(struct bpf_sock_ops *skops) | 26 | int bpf_iw(struct bpf_sock_ops *skops) |
34 | { | 27 | { |
diff --git a/samples/bpf/tcp_rwnd_kern.c b/samples/bpf/tcp_rwnd_kern.c index cc71ee96e044..d011e38b80d2 100644 --- a/samples/bpf/tcp_rwnd_kern.c +++ b/samples/bpf/tcp_rwnd_kern.c | |||
@@ -21,13 +21,6 @@ | |||
21 | 21 | ||
22 | #define DEBUG 1 | 22 | #define DEBUG 1 |
23 | 23 | ||
24 | #define bpf_printk(fmt, ...) \ | ||
25 | ({ \ | ||
26 | char ____fmt[] = fmt; \ | ||
27 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
28 | ##__VA_ARGS__); \ | ||
29 | }) | ||
30 | |||
31 | SEC("sockops") | 24 | SEC("sockops") |
32 | int bpf_rwnd(struct bpf_sock_ops *skops) | 25 | int bpf_rwnd(struct bpf_sock_ops *skops) |
33 | { | 26 | { |
diff --git a/samples/bpf/tcp_synrto_kern.c b/samples/bpf/tcp_synrto_kern.c index ca87ed34f896..720d1950322d 100644 --- a/samples/bpf/tcp_synrto_kern.c +++ b/samples/bpf/tcp_synrto_kern.c | |||
@@ -21,13 +21,6 @@ | |||
21 | 21 | ||
22 | #define DEBUG 1 | 22 | #define DEBUG 1 |
23 | 23 | ||
24 | #define bpf_printk(fmt, ...) \ | ||
25 | ({ \ | ||
26 | char ____fmt[] = fmt; \ | ||
27 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
28 | ##__VA_ARGS__); \ | ||
29 | }) | ||
30 | |||
31 | SEC("sockops") | 24 | SEC("sockops") |
32 | int bpf_synrto(struct bpf_sock_ops *skops) | 25 | int bpf_synrto(struct bpf_sock_ops *skops) |
33 | { | 26 | { |
diff --git a/samples/bpf/tcp_tos_reflect_kern.c b/samples/bpf/tcp_tos_reflect_kern.c index de788be6f862..369faca70a15 100644 --- a/samples/bpf/tcp_tos_reflect_kern.c +++ b/samples/bpf/tcp_tos_reflect_kern.c | |||
@@ -20,13 +20,6 @@ | |||
20 | 20 | ||
21 | #define DEBUG 1 | 21 | #define DEBUG 1 |
22 | 22 | ||
23 | #define bpf_printk(fmt, ...) \ | ||
24 | ({ \ | ||
25 | char ____fmt[] = fmt; \ | ||
26 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
27 | ##__VA_ARGS__); \ | ||
28 | }) | ||
29 | |||
30 | SEC("sockops") | 23 | SEC("sockops") |
31 | int bpf_basertt(struct bpf_sock_ops *skops) | 24 | int bpf_basertt(struct bpf_sock_ops *skops) |
32 | { | 25 | { |
diff --git a/samples/bpf/xdp_sample_pkts_kern.c b/samples/bpf/xdp_sample_pkts_kern.c index f7ca8b850978..6c7c7e0aaeda 100644 --- a/samples/bpf/xdp_sample_pkts_kern.c +++ b/samples/bpf/xdp_sample_pkts_kern.c | |||
@@ -7,13 +7,6 @@ | |||
7 | #define SAMPLE_SIZE 64ul | 7 | #define SAMPLE_SIZE 64ul |
8 | #define MAX_CPUS 128 | 8 | #define MAX_CPUS 128 |
9 | 9 | ||
10 | #define bpf_printk(fmt, ...) \ | ||
11 | ({ \ | ||
12 | char ____fmt[] = fmt; \ | ||
13 | bpf_trace_printk(____fmt, sizeof(____fmt), \ | ||
14 | ##__VA_ARGS__); \ | ||
15 | }) | ||
16 | |||
17 | struct bpf_map_def SEC("maps") my_map = { | 10 | struct bpf_map_def SEC("maps") my_map = { |
18 | .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, | 11 | .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, |
19 | .key_size = sizeof(int), | 12 | .key_size = sizeof(int), |