diff options
author | Delyan Kratunov <delyank@fb.com> | 2022-02-02 15:54:22 -0800 |
---|---|---|
committer | Quentin Monnet <qmonnet+github@qoba.lt> | 2022-02-07 18:33:45 +0000 |
commit | 3adf4ae3a4b5cd604befc0ddd142b5e473a4e6ef (patch) | |
tree | a079a6b004e26a294ee57024d77984f88ea8a880 | |
parent | c14cc3cfda680b3490a6b7d929cb8b8918ac978c (diff) | |
download | bpftool-3adf4ae3a4b5cd604befc0ddd142b5e473a4e6ef.tar.gz |
bpftool: Migrate from bpf_prog_test_run_xattr
bpf_prog_test_run is being deprecated in favor of the OPTS-based
bpf_prog_test_run_opts.
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220202235423.1097270-4-delyank@fb.com
-rw-r--r-- | src/prog.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1272,12 +1272,12 @@ static int do_run(int argc, char **argv) { char *data_fname_in = NULL, *data_fname_out = NULL; char *ctx_fname_in = NULL, *ctx_fname_out = NULL; - struct bpf_prog_test_run_attr test_attr = {0}; const unsigned int default_size = SZ_32K; void *data_in = NULL, *data_out = NULL; void *ctx_in = NULL, *ctx_out = NULL; unsigned int repeat = 1; int fd, err; + LIBBPF_OPTS(bpf_test_run_opts, test_attr); if (!REQ_ARGS(4)) return -1; @@ -1395,14 +1395,13 @@ static int do_run(int argc, char **argv) goto free_ctx_in; } - test_attr.prog_fd = fd; test_attr.repeat = repeat; test_attr.data_in = data_in; test_attr.data_out = data_out; test_attr.ctx_in = ctx_in; test_attr.ctx_out = ctx_out; - err = bpf_prog_test_run_xattr(&test_attr); + err = bpf_prog_test_run_opts(fd, &test_attr); if (err) { p_err("failed to run program: %s", strerror(errno)); goto free_ctx_out; |