aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2022-01-24 19:42:51 +0000
committerAlexei Starovoitov <[email protected]>2022-01-26 01:59:06 +0000
commit39748db1d6bc12b9f749a0aebe7ec71b00bd60eb (patch)
treea8d1d26b5688a23ae449037f869aac628a4102eb /tools/bpf/bpftool/prog.c
parentlibbpf: deprecate bpf_program__is_<type>() and bpf_program__set_<type>() APIs (diff)
downloadkernel-39748db1d6bc12b9f749a0aebe7ec71b00bd60eb.tar.gz
kernel-39748db1d6bc12b9f749a0aebe7ec71b00bd60eb.zip
bpftool: use preferred setters/getters instead of deprecated ones
Use bpf_program__type() instead of discouraged bpf_program__get_type(). Also switch to bpf_map__set_max_entries() instead of bpf_map__resize(). Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r--tools/bpf/bpftool/prog.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index cf935c63e6f5..87593f98d2d1 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -2283,10 +2283,10 @@ static int do_profile(int argc, char **argv)
profile_obj->rodata->num_metric = num_metric;
/* adjust map sizes */
- bpf_map__resize(profile_obj->maps.events, num_metric * num_cpu);
- bpf_map__resize(profile_obj->maps.fentry_readings, num_metric);
- bpf_map__resize(profile_obj->maps.accum_readings, num_metric);
- bpf_map__resize(profile_obj->maps.counts, 1);
+ bpf_map__set_max_entries(profile_obj->maps.events, num_metric * num_cpu);
+ bpf_map__set_max_entries(profile_obj->maps.fentry_readings, num_metric);
+ bpf_map__set_max_entries(profile_obj->maps.accum_readings, num_metric);
+ bpf_map__set_max_entries(profile_obj->maps.counts, 1);
/* change target name */
profile_tgt_name = profile_target_name(profile_tgt_fd);