summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2016-05-10 23:53:05 +0900
committerShuah Khan <shuahkh@osg.samsung.com>2016-05-16 09:01:49 -0600
commit5a614ec8a7cfe9098475fa1221b409fb7eec6054 (patch)
tree20b5f1687c46d778514306ec70f21bc1a1ac05a9 /tools
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
downloadop-kernel-dev-5a614ec8a7cfe9098475fa1221b409fb7eec6054.zip
op-kernel-dev-5a614ec8a7cfe9098475fa1221b409fb7eec6054.tar.gz
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 da48812..4c6a0bf 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -88,7 +88,12 @@ parse_opts() { # opts
# Parameters
DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1`
-TRACING_DIR=$DEBUGFS_DIR/tracing
+if [ -z "$DEBUGFS_DIR" ]; then
+ TRACING_DIR=`grep tracefs /proc/mounts | cut -f2 -d' ' | head -1`
+else
+ TRACING_DIR=$DEBUGFS_DIR/tracing
+fi
+
TOP_DIR=`absdir $0`
TEST_DIR=$TOP_DIR/test.d
TEST_CASES=`find_testcases $TEST_DIR`
@@ -102,7 +107,7 @@ parse_opts $*
[ $DEBUG -ne 0 ] && set -x
# Verify parameters
-if [ -z "$DEBUGFS_DIR" -o ! -d "$TRACING_DIR" ]; then
+if [ -z "$TRACING_DIR" -o ! -d "$TRACING_DIR" ]; then
errexit "No ftrace directory found"
fi
OpenPOWER on IntegriCloud