about use wild cards for set_ftrace_filter and so on

From: walimis
Date: Thu Nov 27 2008 - 10:21:43 EST


Hi Steven and Ingo,

I encountered an issue when using ftrace.
We know that we can use wild cards to set set_ftrace_filter, but there's
problem when using 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 files' name to set_ftrace_filter, not "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 enclose 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.
I suppose that we can add some notes to document, so a patch attached.


Impact: imporve document

Signed-off-by: walimis <walimisdev@xxxxxxxxx>
---
Documentation/ftrace.txt | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index de05042..9735434 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -1251,6 +1251,9 @@ These are the only wild cards which are supported.

<match>*<match> will not work.

+Note: you'd better to use "" to enclose wild cards, otherwise in some
+case you can't get the correct result.
+
# echo hrtimer_* > /debug/tracing/set_ftrace_filter

Produces:
--
1.6.0.3