diff options
author | Ross Zwisler <zwisler@google.com> | 2023-03-13 21:56:27 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-14 05:51:30 +0100 |
commit | 27d7fdf06fdb84455ff585b58c8034e2fab42583 (patch) | |
tree | 6db438ddc306f32e69758cbcc1d69cbf3e10e298 /samples/bpf/hbm.c | |
parent | bpf: Disable migration when freeing stashed local kptr using obj drop (diff) | |
download | linux-27d7fdf06fdb84455ff585b58c8034e2fab42583.tar.xz linux-27d7fdf06fdb84455ff585b58c8034e2fab42583.zip |
bpf: use canonical ftrace path
The canonical location for the tracefs filesystem is at /sys/kernel/tracing.
But, from Documentation/trace/ftrace.rst:
Before 4.1, all ftrace tracing control files were within the debugfs
file system, which is typically located at /sys/kernel/debug/tracing.
For backward compatibility, when mounting the debugfs file system,
the tracefs file system will be automatically mounted at:
/sys/kernel/debug/tracing
Many comments and samples in the bpf code still refer to this older
debugfs path, so let's update them to avoid confusion. There are a few
spots where the bpf code explicitly checks both tracefs and debugfs
(tools/bpf/bpftool/tracelog.c and tools/lib/api/fs/fs.c) and I've left
those alone so that the tools can continue to work with both paths.
Signed-off-by: Ross Zwisler <zwisler@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20230313205628.1058720-2-zwisler@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/hbm.c')
-rw-r--r-- | samples/bpf/hbm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c index 516fbac28b71..ff58ec43f56a 100644 --- a/samples/bpf/hbm.c +++ b/samples/bpf/hbm.c @@ -65,7 +65,7 @@ static void Usage(void); static void read_trace_pipe2(void); static void do_error(char *msg, bool errno_flag); -#define DEBUGFS "/sys/kernel/debug/tracing/" +#define TRACEFS "/sys/kernel/tracing/" static struct bpf_program *bpf_prog; static struct bpf_object *obj; @@ -77,7 +77,7 @@ static void read_trace_pipe2(void) FILE *outf; char *outFname = "hbm_out.log"; - trace_fd = open(DEBUGFS "trace_pipe", O_RDONLY, 0); + trace_fd = open(TRACEFS "trace_pipe", O_RDONLY, 0); if (trace_fd < 0) { printf("Error opening trace_pipe\n"); return; |