Skip to content

Commit

Permalink
libbpf-tools: Replace deprecated libbpf API
Browse files Browse the repository at this point in the history
Replace deprecated libbpf API bpf_map__resize with
bpf_map__set_max_entries.

Signed-off-by: Hengqi Chen <[email protected]>
  • Loading branch information
chenhengqi committed Apr 12, 2022
1 parent a8718ca commit 7e5dcda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libbpf-tools/cpudist.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ int main(int argc, char **argv)
return 1;
}

bpf_map__resize(obj->maps.start, pid_max);
bpf_map__set_max_entries(obj->maps.start, pid_max);
if (!env.per_process && !env.per_thread)
bpf_map__resize(obj->maps.hists, 1);
bpf_map__set_max_entries(obj->maps.hists, 1);
else
bpf_map__resize(obj->maps.hists, pid_max);
bpf_map__set_max_entries(obj->maps.hists, pid_max);

err = cpudist_bpf__load(obj);
if (err) {
Expand Down

0 comments on commit 7e5dcda

Please sign in to comment.