]> granicus.if.org Git - strace/commit
bpf: move handling of the saved state to BPF_OBJ_GET_INFO_BY_FD decoder
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 1 Jun 2018 00:49:09 +0000 (02:49 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 2 Jun 2018 16:32:10 +0000 (16:32 +0000)
commitec27280cf3b21e6b34775786ec23785973fc7384
treee14fb04a87de95041e1fb65ead6c1441f7eb45a7
parent712fd66dfb6af4ae9bc1f47323f3a638e8913bde
bpf: move handling of the saved state to BPF_OBJ_GET_INFO_BY_FD decoder

As it is needed for proper info_len printing on exiting.

* bpf.c (print_bpf_obj_info_fn): Change return type to void, add "saved"
argument.
(struct obj_get_info_saved): New type definition.
(print_bpf_map_info, print_bpf_prog_info): Change return type to void,
add "saved" argument, do not handle private tcb data allocation and
obtainment.
(print_bpf_obj_info_addr): Change return type to void, add tcb argument,
print the address only on exiting.
(print_bpf_obj_info): Change return type to void, add "saved" argument.
(BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Handle private data
allocation/saving/restoring, use it for storing/printing info_len field.

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