]> granicus.if.org Git - strace/commit
bpf: enhance decoding of BPF_MAP_LOOKUP_ELEM and BPF_MAP_GET_NEXT_KEY
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 27 Jul 2017 20:11:33 +0000 (20:11 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 27 Jul 2017 20:11:33 +0000 (20:11 +0000)
commit805d6ea5700cfc5fe09d2e5a2792b63c859916dc
tree9d93f21f1f5a2bb967236f9baf11bae94fd59b94
parent269e7d2a2c31448ea61cb8aeb015b9b30492b7ca
bpf: enhance decoding of BPF_MAP_LOOKUP_ELEM and BPF_MAP_GET_NEXT_KEY

Print union bpf_attr.value field of BPF_MAP_LOOKUP_ELEM command
and union bpf_attr.next_key field of BPF_MAP_GET_NEXT_KEY command
on entering syscall.  These fields are addresses specified to the
kernel from userspace.  The amount of data written by the kernel
to these addresses is specified at the map creation time
by BPF_MAP_CREATE command and is not available at this point.

* bpf.c (decode_BPF_MAP_LOOKUP_ELEM): Print union bpf_attr.value
on entering syscall.
(decode_BPF_MAP_GET_NEXT_KEY): Print union bpf_attr.next_key
on entering syscall.
(bpf_map_io): Remove.
* tests/bpf.c (print_BPF_MAP_DELETE_ELEM_first,
print_BPF_MAP_DELETE_ELEM_attr, print_BPF_MAP_GET_NEXT_KEY_first,
print_BPF_MAP_GET_NEXT_KEY_attr): Replace macro redirects with
new functions.
(print_BPF_MAP_LOOKUP_ELEM_first, print_BPF_MAP_LOOKUP_ELEM_attr,
bpf.c
tests/bpf.c