]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: use "/proc/self/" i.o. crafting links with getpid()
authorQuentin Monnet <quentin.monnet@netronome.com>
Fri, 30 Nov 2018 16:25:44 +0000 (16:25 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 30 Nov 2018 22:06:06 +0000 (14:06 -0800)
commitaba7dbcad55608068339aaa84f2c94ff3953a82e
tree370cef3a25e60fa348730d04ee1561b7f726d705
parentedb6dc325224dd9610410803268140ab730b0225
tools: bpftool: use "/proc/self/" i.o. crafting links with getpid()

The getpid() function is called in a couple of places in bpftool to
craft links of the shape "/proc/<pid>/...". Instead, it is possible to
use the "/proc/self/" shortcut, which makes things a bit easier, in
particular in jit_disasm.c.

Do the replacement, and remove the includes of <sys/types.h> from the
relevant files, now we do not use getpid() anymore.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/common.c
tools/bpf/bpftool/jit_disasm.c