diff options
author | Eugene Syromyatnikov <evgsyr@gmail.com> | 2021-11-28 16:43:59 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2021-11-28 15:43:59 +0000 |
commit | 9d043d7491e246b1cc8bf2c537e1e0234ecfefbd (patch) | |
tree | 1d8fa88a07e30ffa351dec8e30bb709bba7ad590 | |
parent | 4510791737030c7f99638a72d813db0e13b0fa21 (diff) | |
download | strace-9d043d7491e246b1cc8bf2c537e1e0234ecfefbd.tar.gz |
tests: fix bpf-obj_get_info_by_fd-prog-v expected output
Since we cannot reliably predict the value of xlated_prog_len field
returned by the kernel, do not hard-code it.
* tests/bpf-obj_get_info_by_fd.c (main): Print the value
of the xlated_prog_len field returned by the kernel
instead of hard-coding an expected value.
Fixes: v5.14-46-g835c65c0e "bpf: fix bpf_prog_info.map_ids array printing"
-rw-r--r-- | tests/bpf-obj_get_info_by_fd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/bpf-obj_get_info_by_fd.c b/tests/bpf-obj_get_info_by_fd.c index 8ca2d3dff..c7326aa8a 100644 --- a/tests/bpf-obj_get_info_by_fd.c +++ b/tests/bpf-obj_get_info_by_fd.c @@ -545,7 +545,9 @@ main(int ac, char **av) printf(", xlated_prog_insns=[]"); break; case 4: - printf(", xlated_prog_len=1 => 0"); + printf(", xlated_prog_len=1"); + if (prog_info->xlated_prog_len != 1) + printf(" => %u", prog_info->xlated_prog_len); printf(", xlated_prog_insns=[]"); break; } |