Skip to content

Commit 2455f0e

Browse files
Ross Zwislerrostedt
authored andcommitted
tracing: Always 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 Kconfig help messages in the tracing code still refer to this older debugfs path, so let's update them to avoid confusion. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Acked-by: Masami Hiramatsu (Google) <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Signed-off-by: Ross Zwisler <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent d8f0ae3 commit 2455f0e

File tree

11 files changed

+25
-25
lines changed

11 files changed

+25
-25
lines changed

include/linux/kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ bool mac_pton(const char *s, u8 *mac);
297297
*
298298
* Use tracing_on/tracing_off when you want to quickly turn on or off
299299
* tracing. It simply enables or disables the recording of the trace events.
300-
* This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
300+
* This also corresponds to the user space /sys/kernel/tracing/tracing_on
301301
* file, which gives a means for the kernel and userspace to interact.
302302
* Place a tracing_off() in the kernel where you want tracing to end.
303303
* From user space, examine the trace, and then echo 1 > tracing_on

include/linux/tracepoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
471471
* * This is how the trace record is structured and will
472472
* * be saved into the ring buffer. These are the fields
473473
* * that will be exposed to user-space in
474-
* * /sys/kernel/debug/tracing/events/<*>/format.
474+
* * /sys/kernel/tracing/events/<*>/format.
475475
* *
476476
* * The declared 'local variable' is called '__entry'
477477
* *
@@ -531,7 +531,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
531531
* tracepoint callback (this is used by programmatic plugins and
532532
* can also by used by generic instrumentation like SystemTap), and
533533
* it is also used to expose a structured trace record in
534-
* /sys/kernel/debug/tracing/events/.
534+
* /sys/kernel/tracing/events/.
535535
*
536536
* A set of (un)registration functions can be passed to the variant
537537
* TRACE_EVENT_FN to perform any (un)registration work.

kernel/trace/Kconfig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ config DYNAMIC_FTRACE
239239
enabled, and the functions not enabled will not affect
240240
performance of the system.
241241

242-
See the files in /sys/kernel/debug/tracing:
242+
See the files in /sys/kernel/tracing:
243243
available_filter_functions
244244
set_ftrace_filter
245245
set_ftrace_notrace
@@ -299,7 +299,7 @@ config STACK_TRACER
299299
select KALLSYMS
300300
help
301301
This special tracer records the maximum stack footprint of the
302-
kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
302+
kernel and displays it in /sys/kernel/tracing/stack_trace.
303303

304304
This tracer works by hooking into every function call that the
305305
kernel executes, and keeping a maximum stack depth value and
@@ -339,7 +339,7 @@ config IRQSOFF_TRACER
339339
disabled by default and can be runtime (re-)started
340340
via:
341341

342-
echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
342+
echo 0 > /sys/kernel/tracing/tracing_max_latency
343343

344344
(Note that kernel size and overhead increase with this option
345345
enabled. This option and the preempt-off timing option can be
@@ -363,7 +363,7 @@ config PREEMPT_TRACER
363363
disabled by default and can be runtime (re-)started
364364
via:
365365

366-
echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
366+
echo 0 > /sys/kernel/tracing/tracing_max_latency
367367

368368
(Note that kernel size and overhead increase with this option
369369
enabled. This option and the irqs-off timing option can be
@@ -515,7 +515,7 @@ config TRACER_SNAPSHOT
515515
Allow tracing users to take snapshot of the current buffer using the
516516
ftrace interface, e.g.:
517517

518-
echo 1 > /sys/kernel/debug/tracing/snapshot
518+
echo 1 > /sys/kernel/tracing/snapshot
519519
cat snapshot
520520

521521
config TRACER_SNAPSHOT_PER_CPU_SWAP
@@ -527,7 +527,7 @@ config TRACER_SNAPSHOT_PER_CPU_SWAP
527527
full swap (all buffers). If this is set, then the following is
528528
allowed:
529529

530-
echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
530+
echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot
531531

532532
After which, only the tracing buffer for CPU 2 was swapped with
533533
the main tracing buffer, and the other CPU buffers remain the same.
@@ -574,7 +574,7 @@ config PROFILE_ANNOTATED_BRANCHES
574574
This tracer profiles all likely and unlikely macros
575575
in the kernel. It will display the results in:
576576

577-
/sys/kernel/debug/tracing/trace_stat/branch_annotated
577+
/sys/kernel/tracing/trace_stat/branch_annotated
578578

579579
Note: this will add a significant overhead; only turn this
580580
on if you need to profile the system's use of these macros.
@@ -587,7 +587,7 @@ config PROFILE_ALL_BRANCHES
587587
taken in the kernel is recorded whether it hit or miss.
588588
The results will be displayed in:
589589

590-
/sys/kernel/debug/tracing/trace_stat/branch_all
590+
/sys/kernel/tracing/trace_stat/branch_all
591591

592592
This option also enables the likely/unlikely profiler.
593593

@@ -638,8 +638,8 @@ config BLK_DEV_IO_TRACE
638638
Tracing also is possible using the ftrace interface, e.g.:
639639

640640
echo 1 > /sys/block/sda/sda1/trace/enable
641-
echo blk > /sys/kernel/debug/tracing/current_tracer
642-
cat /sys/kernel/debug/tracing/trace_pipe
641+
echo blk > /sys/kernel/tracing/current_tracer
642+
cat /sys/kernel/tracing/trace_pipe
643643

644644
If unsure, say N.
645645

kernel/trace/kprobe_event_gen_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Then:
2222
*
2323
* # insmod kernel/trace/kprobe_event_gen_test.ko
24-
* # cat /sys/kernel/debug/tracing/trace
24+
* # cat /sys/kernel/tracing/trace
2525
*
2626
* You should see many instances of the "gen_kprobe_test" and
2727
* "gen_kretprobe_test" events in the trace buffer.

kernel/trace/ring_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ rb_check_timestamp(struct ring_buffer_per_cpu *cpu_buffer,
28862886
sched_clock_stable() ? "" :
28872887
"If you just came from a suspend/resume,\n"
28882888
"please switch to the trace global clock:\n"
2889-
" echo global > /sys/kernel/debug/tracing/trace_clock\n"
2889+
" echo global > /sys/kernel/tracing/trace_clock\n"
28902890
"or add trace_clock=global to the kernel command line\n");
28912891
}
28922892

kernel/trace/synth_event_gen_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Then:
2323
*
2424
* # insmod kernel/trace/synth_event_gen_test.ko
25-
* # cat /sys/kernel/debug/tracing/trace
25+
* # cat /sys/kernel/tracing/trace
2626
*
2727
* You should see several events in the trace buffer -
2828
* "create_synth_test", "empty_synth_test", and several instances of

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ void tracing_snapshot_instance(struct trace_array *tr)
11871187
*
11881188
* Note, make sure to allocate the snapshot with either
11891189
* a tracing_snapshot_alloc(), or by doing it manually
1190-
* with: echo 1 > /sys/kernel/debug/tracing/snapshot
1190+
* with: echo 1 > /sys/kernel/tracing/snapshot
11911191
*
11921192
* If the snapshot buffer is not allocated, it will stop tracing.
11931193
* Basically making a permanent snapshot.

samples/user_events/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#endif
2424

2525
/* Assumes debugfs is mounted */
26-
const char *data_file = "/sys/kernel/debug/tracing/user_events_data";
27-
const char *status_file = "/sys/kernel/debug/tracing/user_events_status";
26+
const char *data_file = "/sys/kernel/tracing/user_events_data";
27+
const char *status_file = "/sys/kernel/tracing/user_events_status";
2828

2929
static int event_status(long **status)
3030
{

scripts/tracing/draw_functrace.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
1313
Usage:
1414
Be sure that you have CONFIG_FUNCTION_TRACER
15-
# mount -t debugfs nodev /sys/kernel/debug
16-
# echo function > /sys/kernel/debug/tracing/current_tracer
17-
$ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func
15+
# mount -t tracefs nodev /sys/kernel/tracing
16+
# echo function > /sys/kernel/tracing/current_tracer
17+
$ cat /sys/kernel/tracing/trace_pipe > ~/raw_trace_func
1818
Wait some times but not too much, the script is a bit slow.
1919
Break the pipe (Ctrl + Z)
2020
$ scripts/tracing/draw_functrace.py < ~/raw_trace_func > draw_functrace

tools/lib/api/fs/tracing_path.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include "tracing_path.h"
1515

1616
static char tracing_mnt[PATH_MAX] = "/sys/kernel/debug";
17-
static char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing";
18-
static char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events";
17+
static char tracing_path[PATH_MAX] = "/sys/kernel/tracing";
18+
static char tracing_events_path[PATH_MAX] = "/sys/kernel/tracing/events";
1919

2020
static void __tracing_path_set(const char *tracing, const char *mountpoint)
2121
{

0 commit comments

Comments
 (0)