Skip to content

Commit

Permalink
ftracetest: Take the first debugfs mount found
Browse files Browse the repository at this point in the history
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.

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Nov 3, 2014
1 parent 89c5497 commit e7dbb48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/ftrace/ftracetest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7dbb48

Please sign in to comment.