Commit 379d19ec authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

selftests/bpf: use preferred setter/getter APIs instead of deprecated ones

Switch to using preferred setters and getters instead of deprecated ones.
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220124194254.2051434-6-andrii@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 39748db1
...@@ -151,7 +151,7 @@ static struct ringbuf_bench *ringbuf_setup_skeleton(void) ...@@ -151,7 +151,7 @@ static struct ringbuf_bench *ringbuf_setup_skeleton(void)
/* record data + header take 16 bytes */ /* record data + header take 16 bytes */
skel->rodata->wakeup_data_size = args.sample_rate * 16; skel->rodata->wakeup_data_size = args.sample_rate * 16;
bpf_map__resize(skel->maps.ringbuf, args.ringbuf_sz); bpf_map__set_max_entries(skel->maps.ringbuf, args.ringbuf_sz);
if (ringbuf_bench__load(skel)) { if (ringbuf_bench__load(skel)) {
fprintf(stderr, "failed to load skeleton\n"); fprintf(stderr, "failed to load skeleton\n");
......
...@@ -132,7 +132,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file, ...@@ -132,7 +132,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file,
&link_info, &info_len); &link_info, &info_len);
ASSERT_OK(err, "link_fd_get_info"); ASSERT_OK(err, "link_fd_get_info");
ASSERT_EQ(link_info.tracing.attach_type, ASSERT_EQ(link_info.tracing.attach_type,
bpf_program__get_expected_attach_type(prog[i]), bpf_program__expected_attach_type(prog[i]),
"link_attach_type"); "link_attach_type");
ASSERT_EQ(link_info.tracing.target_obj_id, tgt_prog_id, "link_tgt_obj_id"); ASSERT_EQ(link_info.tracing.target_obj_id, tgt_prog_id, "link_tgt_obj_id");
ASSERT_EQ(link_info.tracing.target_btf_id, btf_id, "link_tgt_btf_id"); ASSERT_EQ(link_info.tracing.target_btf_id, btf_id, "link_tgt_btf_id");
......
...@@ -27,7 +27,7 @@ void test_get_stackid_cannot_attach(void) ...@@ -27,7 +27,7 @@ void test_get_stackid_cannot_attach(void)
return; return;
/* override program type */ /* override program type */
bpf_program__set_perf_event(skel->progs.oncpu); bpf_program__set_type(skel->progs.oncpu, BPF_PROG_TYPE_PERF_EVENT);
err = test_stacktrace_build_id__load(skel); err = test_stacktrace_build_id__load(skel);
if (CHECK(err, "skel_load", "skeleton load failed: %d\n", err)) if (CHECK(err, "skel_load", "skeleton load failed: %d\n", err))
......
...@@ -42,7 +42,7 @@ void test_stacktrace_build_id_nmi(void) ...@@ -42,7 +42,7 @@ void test_stacktrace_build_id_nmi(void)
return; return;
/* override program type */ /* override program type */
bpf_program__set_perf_event(skel->progs.oncpu); bpf_program__set_type(skel->progs.oncpu, BPF_PROG_TYPE_PERF_EVENT);
err = test_stacktrace_build_id__load(skel); err = test_stacktrace_build_id__load(skel);
if (CHECK(err, "skel_load", "skeleton load failed: %d\n", err)) if (CHECK(err, "skel_load", "skeleton load failed: %d\n", err))
......
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