bpftool: Handle EAGAIN error code properly in pids collection
authorYonghong Song <yhs@fb.com>
Tue, 18 Aug 2020 22:23:12 +0000 (15:23 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Aug 2020 00:36:23 +0000 (17:36 -0700)
commit00fa1d83a8b50351c830521d00135e823c46e7d0
tree586aac21b3840b28a2ad2c76e13dfe7c415b2970
parente60572b8d4c39572be6857d1ec91fdf979f8775f
bpftool: Handle EAGAIN error code properly in pids collection

When the error code is EAGAIN, the kernel signals the user
space should retry the read() operation for bpf iterators.
Let us do it.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200818222312.2181675-1-yhs@fb.com
tools/bpf/bpftool/pids.c