linux-stable/tools/bpf/bpftool
Quentin Monnet be3245e22d tools: bpftool: attempt to mount tracefs if required for tracelog cmd
As a follow-up to commit 30da46b5dc ("tools: bpftool: add a command to
dump the trace pipe"), attempt to mount the tracefs virtual file system
if it is not detected on the system before trying to dump content of the
tracing pipe on an invocation of "bpftool prog tracelog".

Usually, tracefs in automatically mounted by debugfs when the user tries
to access it (e.g. "ls /sys/kernel/debug/tracing" mounts the tracefs).
So if we failed to find it, it is probably that debugfs is not here
either. Therefore, we just attempt a single mount, at a location that
does not involve debugfs: /sys/kernel/tracing.

Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-12-18 14:47:17 +01:00
..
bash-completion tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
Documentation tools: bpftool: add a prog array map update example to documentation 2018-12-15 01:31:49 +01:00
.gitignore tools/bpftool: ignore build products 2018-07-26 02:50:26 +02:00
btf_dumper.c tools: bpftool: support pretty print with kind_flag set 2018-12-18 01:12:00 +01:00
cfg.c tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cfg.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cgroup.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
common.c tools: bpftool: attempt to mount tracefs if required for tracelog cmd 2018-12-18 14:47:17 +01:00
jit_disasm.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
json_writer.c tools: bpftool: fix -Wmissing declaration warnings 2018-12-15 01:31:49 +01:00
json_writer.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
main.c tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
main.h tools: bpftool: attempt to mount tracefs if required for tracelog cmd 2018-12-18 14:47:17 +01:00
Makefile bpftool: make libbfd optional 2018-11-16 20:45:01 -08:00
map.c tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
map_perf_ring.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
net.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
netlink_dumper.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
netlink_dumper.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
perf.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
prog.c tools: bpftool: fix -Wmissing declaration warnings 2018-12-15 01:31:49 +01:00
tracelog.c tools: bpftool: attempt to mount tracefs if required for tracelog cmd 2018-12-18 14:47:17 +01:00
xlated_dumper.c tools: bpftool: fix -Wmissing declaration warnings 2018-12-15 01:31:49 +01:00
xlated_dumper.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00