aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/strobemeta.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-07-05 08:50:12 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-07-05 22:52:25 +0200
commit1639b17c72fa7ad977ccd0ad6c673e3f7048723b (patch)
treedcb5097948742ffc5be049ae008120ec7a18c522 /tools/testing/selftests/bpf/progs/strobemeta.h
parentselftests/bpf: convert selftests using BTF-defined maps to new syntax (diff)
downloadlinux-1639b17c72fa7ad977ccd0ad6c673e3f7048723b.tar.xz
linux-1639b17c72fa7ad977ccd0ad6c673e3f7048723b.zip
selftests/bpf: convert legacy BPF maps to BTF-defined ones
Convert selftests that were originally left out and new ones added recently to consistently use BTF-defined maps. Reported-by: kernel test robot <rong.a.chen@intel.com> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/strobemeta.h')
-rw-r--r--tools/testing/selftests/bpf/progs/strobemeta.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/tools/testing/selftests/bpf/progs/strobemeta.h b/tools/testing/selftests/bpf/progs/strobemeta.h
index 553bc3b62e89..8a399bdfd920 100644
--- a/tools/testing/selftests/bpf/progs/strobemeta.h
+++ b/tools/testing/selftests/bpf/progs/strobemeta.h
@@ -204,40 +204,40 @@ struct strobelight_bpf_sample {
char dummy_safeguard;
};
-struct bpf_map_def SEC("maps") samples = {
- .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
- .key_size = sizeof(int),
- .value_size = sizeof(int),
- .max_entries = 32,
-};
-
-struct bpf_map_def SEC("maps") stacks_0 = {
- .type = BPF_MAP_TYPE_STACK_TRACE,
- .key_size = sizeof(uint32_t),
- .value_size = sizeof(uint64_t) * PERF_MAX_STACK_DEPTH,
- .max_entries = 16,
-};
-
-struct bpf_map_def SEC("maps") stacks_1 = {
- .type = BPF_MAP_TYPE_STACK_TRACE,
- .key_size = sizeof(uint32_t),
- .value_size = sizeof(uint64_t) * PERF_MAX_STACK_DEPTH,
- .max_entries = 16,
-};
-
-struct bpf_map_def SEC("maps") sample_heap = {
- .type = BPF_MAP_TYPE_PERCPU_ARRAY,
- .key_size = sizeof(uint32_t),
- .value_size = sizeof(struct strobelight_bpf_sample),
- .max_entries = 1,
-};
-
-struct bpf_map_def SEC("maps") strobemeta_cfgs = {
- .type = BPF_MAP_TYPE_PERCPU_ARRAY,
- .key_size = sizeof(pid_t),
- .value_size = sizeof(struct strobemeta_cfg),
- .max_entries = STROBE_MAX_CFGS,
-};
+struct {
+ __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
+ __uint(max_entries, 32);
+ __uint(key_size, sizeof(int));
+ __uint(value_size, sizeof(int));
+} samples SEC(".maps");
+
+struct {
+ __uint(type, BPF_MAP_TYPE_STACK_TRACE);
+ __uint(max_entries, 16);
+ __uint(key_size, sizeof(uint32_t));
+ __uint(value_size, sizeof(uint64_t) * PERF_MAX_STACK_DEPTH);
+} stacks_0 SEC(".maps");
+
+struct {
+ __uint(type, BPF_MAP_TYPE_STACK_TRACE);
+ __uint(max_entries, 16);
+ __uint(key_size, sizeof(uint32_t));
+ __uint(value_size, sizeof(uint64_t) * PERF_MAX_STACK_DEPTH);
+} stacks_1 SEC(".maps");
+
+struct {
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, uint32_t);
+ __type(value, struct strobelight_bpf_sample);
+} sample_heap SEC(".maps");
+
+struct {
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, STROBE_MAX_CFGS);
+ __type(key, pid_t);
+ __type(value, struct strobemeta_cfg);
+} strobemeta_cfgs SEC(".maps");
/* Type for the dtv. */
/* https://github.com/lattera/glibc/blob/master/nptl/sysdeps/x86_64/tls.h#L34 */