public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ftracetest: Take the first debugfs mount found
@ 2014-10-31 22:06 Steven Rostedt
  2014-11-03  8:18 ` Masami Hiramatsu
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2014-10-31 22:06 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: LKML, Andrew Morton


Running ftracetests on a box that mounted debugfs in two locations
made the ftracetests fail. This is because the tests uses a grep
of debugfs from the /proc/mounts file to find the debugfs mount
point, and then appends "/tracing" to that string to get the tracing
directory.

If the debugfs directory is mounted twice, then that grep will return
two answers and appending "/tracing" to a string with two lines will
not work.

Use "head -1" to only take the first mount point found.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/selftests/ftrace/ftracetest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index a8f81c782856..515247601df4 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -82,7 +82,7 @@ parse_opts() { # opts
 }
 
 # Parameters
-DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' '`
+DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1`
 TRACING_DIR=$DEBUGFS_DIR/tracing
 TOP_DIR=`absdir $0`
 TEST_DIR=$TOP_DIR/test.d
-- 
1.8.1.4


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

* Re: [PATCH] ftracetest: Take the first debugfs mount found
  2014-10-31 22:06 [PATCH] ftracetest: Take the first debugfs mount found Steven Rostedt
@ 2014-11-03  8:18 ` Masami Hiramatsu
  0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2014-11-03  8:18 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Andrew Morton

(2014/11/01 7:06), Steven Rostedt wrote:
> 
> Running ftracetests on a box that mounted debugfs in two locations
> made the ftracetests fail. This is because the tests uses a grep
> of debugfs from the /proc/mounts file to find the debugfs mount
> point, and then appends "/tracing" to that string to get the tracing
> directory.
> 
> If the debugfs directory is mounted twice, then that grep will return
> two answers and appending "/tracing" to a string with two lines will
> not work.
> 
> Use "head -1" to only take the first mount point found.

Indeed :)

> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thank you!


> ---
>  tools/testing/selftests/ftrace/ftracetest | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> index a8f81c782856..515247601df4 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -82,7 +82,7 @@ parse_opts() { # opts
>  }
>  
>  # Parameters
> -DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' '`
> +DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1`
>  TRACING_DIR=$DEBUGFS_DIR/tracing
>  TOP_DIR=`absdir $0`
>  TEST_DIR=$TOP_DIR/test.d
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



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

end of thread, other threads:[~2014-11-03  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 22:06 [PATCH] ftracetest: Take the first debugfs mount found Steven Rostedt
2014-11-03  8:18 ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox