aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2016-05-10 10:53:05 -0400
committerShuah Khan <shuahkh@osg.samsung.com>2016-05-16 11:01:49 -0400
commit5a614ec8a7cfe9098475fa1221b409fb7eec6054 (patch)
tree20b5f1687c46d778514306ec70f21bc1a1ac05a9 /tools
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
kselftests/ftrace: Detect tracefs mount point
Currently ftracetest assumes tracing directory is located under $DEBUGFS/tracing. But it's possible to mount tracefs directly without debugfs. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/ftrace/ftracetest9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index da48812ab95e..4c6a0bf8ba79 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -88,7 +88,12 @@ parse_opts() { # opts
88 88
89# Parameters 89# Parameters
90DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1` 90DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1`
91TRACING_DIR=$DEBUGFS_DIR/tracing 91if [ -z "$DEBUGFS_DIR" ]; then
92 TRACING_DIR=`grep tracefs /proc/mounts | cut -f2 -d' ' | head -1`
93else
94 TRACING_DIR=$DEBUGFS_DIR/tracing
95fi
96
92TOP_DIR=`absdir $0` 97TOP_DIR=`absdir $0`
93TEST_DIR=$TOP_DIR/test.d 98TEST_DIR=$TOP_DIR/test.d
94TEST_CASES=`find_testcases $TEST_DIR` 99TEST_CASES=`find_testcases $TEST_DIR`
@@ -102,7 +107,7 @@ parse_opts $*
102[ $DEBUG -ne 0 ] && set -x 107[ $DEBUG -ne 0 ] && set -x
103 108
104# Verify parameters 109# Verify parameters
105if [ -z "$DEBUGFS_DIR" -o ! -d "$TRACING_DIR" ]; then 110if [ -z "$TRACING_DIR" -o ! -d "$TRACING_DIR" ]; then
106 errexit "No ftrace directory found" 111 errexit "No ftrace directory found"
107fi 112fi
108 113