summaryrefslogtreecommitdiff
path: root/samples/bpf/trace_output_user.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-12-01 15:28:23 -0800
committerAlexei Starovoitov <ast@kernel.org>2021-12-02 15:23:40 -0800
commitc58f9815ba9735752d3735efb915e8878604684b (patch)
tree4af974bfbf16a9cf5739729d06f4621f5eccb927 /samples/bpf/trace_output_user.c
parent527024f7aeb683ce7ef49b07ef7ce9ecf015288d (diff)
downloadlwn-c58f9815ba9735752d3735efb915e8878604684b.tar.gz
lwn-c58f9815ba9735752d3735efb915e8878604684b.zip
samples/bpf: Get rid of deprecated libbpf API uses
Replace deprecated APIs with new ones. Also mute source code using deprecated AF_XDP (xsk.h). Figuring out what to do with all the AF_XDP stuff is a separate problem that should be solved with its own set of changes. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20211201232824.3166325-9-andrii@kernel.org
Diffstat (limited to 'samples/bpf/trace_output_user.c')
-rw-r--r--samples/bpf/trace_output_user.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/samples/bpf/trace_output_user.c b/samples/bpf/trace_output_user.c
index 364b98764d54..371732f9cf8e 100644
--- a/samples/bpf/trace_output_user.c
+++ b/samples/bpf/trace_output_user.c
@@ -43,7 +43,6 @@ static void print_bpf_output(void *ctx, int cpu, void *data, __u32 size)
int main(int argc, char **argv)
{
- struct perf_buffer_opts pb_opts = {};
struct bpf_link *link = NULL;
struct bpf_program *prog;
struct perf_buffer *pb;
@@ -84,8 +83,7 @@ int main(int argc, char **argv)
goto cleanup;
}
- pb_opts.sample_cb = print_bpf_output;
- pb = perf_buffer__new(map_fd, 8, &pb_opts);
+ pb = perf_buffer__new(map_fd, 8, print_bpf_output, NULL, NULL, NULL);
ret = libbpf_get_error(pb);
if (ret) {
printf("failed to setup perf_buffer: %d\n", ret);