Skip to content

Commit c072c24

Browse files
walimisIngo Molnar
authored andcommitted
ftrace: improve documentation
Impact: extend documentation with notice of using wild cards correctly We know that we can use wild cards to set set_ftrace_filter, but there's problem when using them naively such as: echo h* > /debug/tracing/set_ftrace_filter If there are files named with "h" prefix in current directory, echo "h*" will echo these filenames to set_ftrace_filter, not the intended "h*". For example: $ cat /debug/tracing/available_filter_functions |grep ^hr |wc -l 23 $ ls $ touch hraa hrdd $ ls hraa hrdd $ echo hr* > /debug/tracing/set_ftrace_filter $ cat /debug/tracing/set_ftrace_filter No output in /debug/tracing/set_ftrace_filter! If we use '' to escape wild cards, it works: $ ls hraa hrdd $ echo "hr*" > /debug/tracing/set_ftrace_filter $ cat /debug/tracing/set_ftrace_filter |wc -l 23 This problem can lead to unexpected result if current directory has a lot of files. Signed-off-by: walimis <[email protected]> Acked-by: Steven Rostedt <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 50cdaf0 commit c072c24

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Documentation/ftrace.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,11 @@ These are the only wild cards which are supported.
12511251

12521252
<match>*<match> will not work.
12531253

1254-
# echo hrtimer_* > /debug/tracing/set_ftrace_filter
1254+
Note: It is better to use quotes to enclose the wild cards, otherwise
1255+
the shell may expand the parameters into names of files in the local
1256+
directory.
1257+
1258+
# echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
12551259

12561260
Produces:
12571261

@@ -1306,7 +1310,7 @@ Again, now we want to append.
13061310
# echo sys_nanosleep > /debug/tracing/set_ftrace_filter
13071311
# cat /debug/tracing/set_ftrace_filter
13081312
sys_nanosleep
1309-
# echo hrtimer_* >> /debug/tracing/set_ftrace_filter
1313+
# echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
13101314
# cat /debug/tracing/set_ftrace_filter
13111315
hrtimer_run_queues
13121316
hrtimer_run_pending

0 commit comments

Comments
 (0)