]> granicus.if.org Git - strace/commit
bpf: print xlated_prog_insns only when xlated_prog_len had not been 0
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 1 Jun 2018 00:44:04 +0000 (02:44 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 2 Jun 2018 16:32:10 +0000 (16:32 +0000)
commitbcac74438da7486dce133eb36f2c99702f80ce9d
treec3b469a636f13cd9790d51a0470e9521f43709f8
parentd4b2f1c4b64936d71a887750a85f85239290870e
bpf: print xlated_prog_insns only when xlated_prog_len had not been 0

If xlated_prog_len is zero on entering syscall and non-zero on exiting,
the program itself is not written into xlated_prog_insns.

* bpf.c (print_ebpf_prog): Add decode argument, print the address only
if decode is false.
(BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Specify decode == true argument
to print_ebpf_prog.
(print_bpf_prog_info): Specify saved xlated_prog_len as decode argument
to print_ebpf_prog.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
bpf.c