diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-05-10 10:53:05 -0400 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2016-05-16 11:01:49 -0400 |
commit | 5a614ec8a7cfe9098475fa1221b409fb7eec6054 (patch) | |
tree | 20b5f1687c46d778514306ec70f21bc1a1ac05a9 /tools | |
parent | f55532a0c0b8bb6148f4e07853b876ef73bc69ca (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-x | tools/testing/selftests/ftrace/ftracetest | 9 |
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 |
90 | DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1` | 90 | DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1` |
91 | TRACING_DIR=$DEBUGFS_DIR/tracing | 91 | if [ -z "$DEBUGFS_DIR" ]; then |
92 | TRACING_DIR=`grep tracefs /proc/mounts | cut -f2 -d' ' | head -1` | ||
93 | else | ||
94 | TRACING_DIR=$DEBUGFS_DIR/tracing | ||
95 | fi | ||
96 | |||
92 | TOP_DIR=`absdir $0` | 97 | TOP_DIR=`absdir $0` |
93 | TEST_DIR=$TOP_DIR/test.d | 98 | TEST_DIR=$TOP_DIR/test.d |
94 | TEST_CASES=`find_testcases $TEST_DIR` | 99 | TEST_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 |
105 | if [ -z "$DEBUGFS_DIR" -o ! -d "$TRACING_DIR" ]; then | 110 | if [ -z "$TRACING_DIR" -o ! -d "$TRACING_DIR" ]; then |
106 | errexit "No ftrace directory found" | 111 | errexit "No ftrace directory found" |
107 | fi | 112 | fi |
108 | 113 | ||