All of lore.kernel.org
 help / color / mirror / Atom feed
* about use wild cards for set_ftrace_filter and so on
@ 2008-11-27 15:21 walimis
  2008-11-27 15:34 ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: walimis @ 2008-11-27 15:21 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 911 bytes --]

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.
 

[-- Attachment #2: 0001-Impact-imporve-document.patch --]
[-- Type: text/x-diff, Size: 626 bytes --]


Impact: imporve document

Signed-off-by: walimis <walimisdev@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: about use wild cards for set_ftrace_filter and so on
  2008-11-27 15:21 about use wild cards for set_ftrace_filter and so on walimis
@ 2008-11-27 15:34 ` Steven Rostedt
  2008-11-27 15:50   ` walimis
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-11-27 15:34 UTC (permalink / raw)
  To: walimis; +Cc: linux-kernel


On Thu, 27 Nov 2008, walimis wrote:

> 
> 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.

Using TB? It's best to inline the patch, that way I can comment on it 
better.

Anyway, you should fix the example. I also recommend a single quote over 
double, to prevent any other translation that bash might do.

The example in ftrace.txt should be:

 # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter


Thanks,

-- Steve

/me goes back to eating turkeys.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: about use wild cards for set_ftrace_filter and so on
  2008-11-27 15:34 ` Steven Rostedt
@ 2008-11-27 15:50   ` walimis
  2008-11-27 15:58     ` Frédéric Weisbecker
  2008-11-27 16:21     ` Ingo Molnar
  0 siblings, 2 replies; 10+ messages in thread
From: walimis @ 2008-11-27 15:50 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel

On Thu, Nov 27, 2008 at 10:34:19AM -0500, Steven Rostedt wrote:
>
>On Thu, 27 Nov 2008, walimis wrote:
>
>> 
>> 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.
>
>Using TB? It's best to inline the patch, that way I can comment on it 
>better.
Using mutt, but I don't know how to inline the patch now.

>
>Anyway, you should fix the example. I also recommend a single quote over 
>double, to prevent any other translation that bash might do.
>
>The example in ftrace.txt should be:
>
> # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
>
>
>Thanks,
>
>-- Steve
>
>/me goes back to eating turkeys.
I only add a note, but I wonder whether enough.
If needed, I can add a example to this document.

Impact: imporve document

Signed-off-by: walimis <walimisdev@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: about use wild cards for set_ftrace_filter and so on
  2008-11-27 15:50   ` walimis
@ 2008-11-27 15:58     ` Frédéric Weisbecker
  2008-11-27 16:21     ` Ingo Molnar
  1 sibling, 0 replies; 10+ messages in thread
From: Frédéric Weisbecker @ 2008-11-27 15:58 UTC (permalink / raw)
  To: walimis; +Cc: Steven Rostedt, linux-kernel, Ingo Molnar

2008/11/27 walimis <walimisdev@gmail.com>:
> On Thu, Nov 27, 2008 at 10:34:19AM -0500, Steven Rostedt wrote:
>>
>>On Thu, 27 Nov 2008, walimis wrote:
>>
>>>
>>> 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.
>>
>>Using TB? It's best to inline the patch, that way I can comment on it
>>better.
> Using mutt, but I don't know how to inline the patch now.
>
>>
>>Anyway, you should fix the example. I also recommend a single quote over
>>double, to prevent any other translation that bash might do.
>>
>>The example in ftrace.txt should be:
>>
>> # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
>>
>>
>>Thanks,
>>
>>-- Steve
>>
>>/me goes back to eating turkeys.
> I only add a note, but I wonder whether enough.
> If needed, I can add a example to this document.
>
> Impact: imporve document
>
> Signed-off-by: walimis <walimisdev@gmail.com>
> ---
>  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


Cc'ed Ingo.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: about use wild cards for set_ftrace_filter and so on
  2008-11-27 15:50   ` walimis
  2008-11-27 15:58     ` Frédéric Weisbecker
@ 2008-11-27 16:21     ` Ingo Molnar
  2008-11-28  2:32       ` [PATCH 1/1] ftrace: improve document walimis
  1 sibling, 1 reply; 10+ messages in thread
From: Ingo Molnar @ 2008-11-27 16:21 UTC (permalink / raw)
  To: walimis; +Cc: Steven Rostedt, linux-kernel


* walimis <walimisdev@gmail.com> wrote:

> I only add a note, but I wonder whether enough.
> If needed, I can add a example to this document.
> 
> Impact: imporve document

[ You need to slightly improve the commit log as well ;-) ]

> +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

Why not fix the example too? Something like:

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

looks good otherwise.

	Ingo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ftrace: improve document
  2008-11-27 16:21     ` Ingo Molnar
@ 2008-11-28  2:32       ` walimis
  2008-11-28  3:52         ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: walimis @ 2008-11-28  2:32 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: linux-kernel

Impact: add 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 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.

Signed-off-by: walimis <walimisdev@gmail.com>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
---
 Documentation/ftrace.txt |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index de05042..0012a4a 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -1251,7 +1251,10 @@ These are the only wild cards which are supported.
 
   <match>*<match> will not work.
 
- # echo hrtimer_* > /debug/tracing/set_ftrace_filter
+Note: you'd better to use '' to enclose wild cards, otherwise in some
+cases you can't get the correct result.
+
+ # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
 
 Produces:
 
@@ -1306,7 +1309,7 @@ Again, now we want to append.
  # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
  # cat /debug/tracing/set_ftrace_filter
 sys_nanosleep
- # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
+ # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
  # cat /debug/tracing/set_ftrace_filter
 hrtimer_run_queues
 hrtimer_run_pending
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ftrace: improve document
  2008-11-28  2:32       ` [PATCH 1/1] ftrace: improve document walimis
@ 2008-11-28  3:52         ` Steven Rostedt
  2008-11-28  4:21           ` walimis
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-11-28  3:52 UTC (permalink / raw)
  To: walimis; +Cc: Ingo Molnar, linux-kernel


On Fri, 28 Nov 2008, walimis wrote:

> Impact: add 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 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.
> 
> Signed-off-by: walimis <walimisdev@gmail.com>
> Reviewed-by: Ingo Molnar <mingo@elte.hu>
> ---
>  Documentation/ftrace.txt |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
> index de05042..0012a4a 100644
> --- a/Documentation/ftrace.txt
> +++ b/Documentation/ftrace.txt
> @@ -1251,7 +1251,10 @@ These are the only wild cards which are supported.
>  
>    <match>*<match> will not work.
>  
> - # echo hrtimer_* > /debug/tracing/set_ftrace_filter
> +Note: you'd better to use '' to enclose wild cards, otherwise in some
> +cases you can't get the correct result.

The above sounds awkward, perhaps something like:

 Note: It is better to use quotes to enclose the wild cards, otherwise
  the shell may expand the parameters into names of files in the local
  directory.

-- Steve



> +
> + # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
>  
>  Produces:
>  
> @@ -1306,7 +1309,7 @@ Again, now we want to append.
>   # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
>   # cat /debug/tracing/set_ftrace_filter
>  sys_nanosleep
> - # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
> + # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
>   # cat /debug/tracing/set_ftrace_filter
>  hrtimer_run_queues
>  hrtimer_run_pending
> -- 
> 1.6.0.3
> 
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ftrace: improve document
  2008-11-28  3:52         ` Steven Rostedt
@ 2008-11-28  4:21           ` walimis
  2008-11-28  6:55             ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: walimis @ 2008-11-28  4:21 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: linux-kernel

Impact: add 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 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.

Signed-off-by: walimis <walimisdev@gmail.com>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Reviewed-by: Steven Rostedt <srostedt@redhat.com>
---
 Documentation/ftrace.txt |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index de05042..803b131 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -1251,7 +1251,11 @@ These are the only wild cards which are supported.
 
   <match>*<match> will not work.
 
- # echo hrtimer_* > /debug/tracing/set_ftrace_filter
+Note: It is better to use quotes to enclose the wild cards, otherwise
+  the shell may expand the parameters into names of files in the local
+  directory.
+
+ # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
 
 Produces:
 
@@ -1306,7 +1310,7 @@ Again, now we want to append.
  # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
  # cat /debug/tracing/set_ftrace_filter
 sys_nanosleep
- # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
+ # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
  # cat /debug/tracing/set_ftrace_filter
 hrtimer_run_queues
 hrtimer_run_pending
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ftrace: improve document
  2008-11-28  4:21           ` walimis
@ 2008-11-28  6:55             ` Steven Rostedt
  2008-11-28 12:16               ` Ingo Molnar
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-11-28  6:55 UTC (permalink / raw)
  To: walimis; +Cc: Ingo Molnar, linux-kernel


On Fri, 28 Nov 2008, walimis wrote:
> 
> Signed-off-by: walimis <walimisdev@gmail.com>
> Reviewed-by: Ingo Molnar <mingo@elte.hu>
> Reviewed-by: Steven Rostedt <srostedt@redhat.com>

Acked-by: Steven Rostedt <srostedt@redhat.com>

-- Steve

> ---
>  Documentation/ftrace.txt |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
> index de05042..803b131 100644
> --- a/Documentation/ftrace.txt
> +++ b/Documentation/ftrace.txt
> @@ -1251,7 +1251,11 @@ These are the only wild cards which are supported.
>  
>    <match>*<match> will not work.
>  
> - # echo hrtimer_* > /debug/tracing/set_ftrace_filter
> +Note: It is better to use quotes to enclose the wild cards, otherwise
> +  the shell may expand the parameters into names of files in the local
> +  directory.
> +
> + # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
>  
>  Produces:
>  
> @@ -1306,7 +1310,7 @@ Again, now we want to append.
>   # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
>   # cat /debug/tracing/set_ftrace_filter
>  sys_nanosleep
> - # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
> + # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
>   # cat /debug/tracing/set_ftrace_filter
>  hrtimer_run_queues
>  hrtimer_run_pending
> -- 
> 1.6.0.3
> 
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ftrace: improve document
  2008-11-28  6:55             ` Steven Rostedt
@ 2008-11-28 12:16               ` Ingo Molnar
  0 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2008-11-28 12:16 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: walimis, linux-kernel


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> On Fri, 28 Nov 2008, walimis wrote:
> > 
> > Signed-off-by: walimis <walimisdev@gmail.com>
> > Reviewed-by: Ingo Molnar <mingo@elte.hu>
> > Reviewed-by: Steven Rostedt <srostedt@redhat.com>
> 
> Acked-by: Steven Rostedt <srostedt@redhat.com>

applied it to tip/tracing/ftrace, thanks guys! (Changed the commit log a 
bit, see the final commit below.)

	Ingo

-------------->
>From c072c24975ec4f0ccfcb6f5c8a8040b6eb75ef8f Mon Sep 17 00:00:00 2001
From: walimis <walimisdev@gmail.com>
Date: Fri, 28 Nov 2008 12:21:19 +0800
Subject: [PATCH] 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 <walimisdev@gmail.com>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 Documentation/ftrace.txt |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index de05042..803b131 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -1251,7 +1251,11 @@ These are the only wild cards which are supported.
 
   <match>*<match> will not work.
 
- # echo hrtimer_* > /debug/tracing/set_ftrace_filter
+Note: It is better to use quotes to enclose the wild cards, otherwise
+  the shell may expand the parameters into names of files in the local
+  directory.
+
+ # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
 
 Produces:
 
@@ -1306,7 +1310,7 @@ Again, now we want to append.
  # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
  # cat /debug/tracing/set_ftrace_filter
 sys_nanosleep
- # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
+ # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
  # cat /debug/tracing/set_ftrace_filter
 hrtimer_run_queues
 hrtimer_run_pending

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-11-28 12:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-27 15:21 about use wild cards for set_ftrace_filter and so on walimis
2008-11-27 15:34 ` Steven Rostedt
2008-11-27 15:50   ` walimis
2008-11-27 15:58     ` Frédéric Weisbecker
2008-11-27 16:21     ` Ingo Molnar
2008-11-28  2:32       ` [PATCH 1/1] ftrace: improve document walimis
2008-11-28  3:52         ` Steven Rostedt
2008-11-28  4:21           ` walimis
2008-11-28  6:55             ` Steven Rostedt
2008-11-28 12:16               ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.