diff options
author | Daniel T. Lee <danieltimlee@gmail.com> | 2020-09-04 08:34:33 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-09-04 16:37:48 +0200 |
commit | 698584dffd4bca834ac4733fc6a659a0a0d213e7 (patch) | |
tree | 410116106c57e96dc5a780a039caecff7a7b8ae0 /samples/bpf/sockex3_user.c | |
parent | libbpf: Fix potential multiplication overflow (diff) | |
download | linux-698584dffd4bca834ac4733fc6a659a0a0d213e7.tar.xz linux-698584dffd4bca834ac4733fc6a659a0a0d213e7.zip |
samples, bpf: Replace bpf_program__title() with bpf_program__section_name()
From commit 521095842027 ("libbpf: Deprecate notion of BPF program
"title" in favor of "section name""), the term title has been replaced
with section name in libbpf.
Since the bpf_program__title() has been deprecated, this commit
switches this function to bpf_program__section_name(). Due to
this commit, the compilation warning issue has also been resolved.
Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"")
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200904063434.24963-1-danieltimlee@gmail.com
Diffstat (limited to 'samples/bpf/sockex3_user.c')
-rw-r--r-- | samples/bpf/sockex3_user.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/samples/bpf/sockex3_user.c b/samples/bpf/sockex3_user.c index 4dbee7427d47..7793f6a6ae7e 100644 --- a/samples/bpf/sockex3_user.c +++ b/samples/bpf/sockex3_user.c @@ -29,8 +29,8 @@ int main(int argc, char **argv) struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; struct bpf_program *prog; struct bpf_object *obj; + const char *section; char filename[256]; - const char *title; FILE *f; snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); @@ -58,8 +58,8 @@ int main(int argc, char **argv) bpf_object__for_each_program(prog, obj) { fd = bpf_program__fd(prog); - title = bpf_program__title(prog, false); - if (sscanf(title, "socket/%d", &key) != 1) { + section = bpf_program__section_name(prog); + if (sscanf(section, "socket/%d", &key) != 1) { fprintf(stderr, "ERROR: finding prog failed\n"); goto cleanup; } |