summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/main.h
diff options
context:
space:
mode:
authorQuentin Monnet2018-12-18 11:13:18 +0100
committerDaniel Borkmann2018-12-18 14:47:17 +0100
commitbe3245e22d227ad68ab97785d506561374daa028 (patch)
tree9eb34c8d2e69fa121c94fcba5e7419dda8eda836 /tools/bpf/bpftool/main.h
parenttools/bpf: check precise {func, line, jited_line}_info_rec_size in test_btf (diff)
downloadkernel-qcow2-linux-be3245e22d227ad68ab97785d506561374daa028.tar.gz
kernel-qcow2-linux-be3245e22d227ad68ab97785d506561374daa028.tar.xz
kernel-qcow2-linux-be3245e22d227ad68ab97785d506561374daa028.zip
tools: bpftool: attempt to mount tracefs if required for tracelog cmd
As a follow-up to commit 30da46b5dc3a ("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>
Diffstat (limited to 'tools/bpf/bpftool/main.h')
-rw-r--r--tools/bpf/bpftool/main.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index 9487345b04a7..9e4499c926fa 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -98,6 +98,8 @@ void usage(void) __noreturn;
void set_max_rlimit(void);
+int mount_tracefs(const char *target);
+
struct pinned_obj_table {
DECLARE_HASHTABLE(table, 16);
};