selftests/ftrace: Return unsupported if it detects older kernel
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 23 May 2017 06:10:04 +0000 (15:10 +0900)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 7 Jun 2017 17:00:16 +0000 (11:00 -0600)
Return unsupported if the kernel is too old to support
instance independent ftrace filter for some testcases.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc

index aa31368..77dfb6b 100644 (file)
@@ -72,6 +72,15 @@ run_enable_disable() {
     test_event_enabled $check_disable
 
     echo "schedule:${enable}_event:$EVENT" > set_ftrace_filter
+    if [ -d ../../instances ]; then # Check instances
+       cur=`cat set_ftrace_filter`
+       top=`cat ../../set_ftrace_filter`
+       if [ "$cur" = "$top" ]; then
+           echo "This kernel is too old to support per instance filter"
+           reset_ftrace_filter
+           exit_unsupported
+       fi
+    fi
 
     echo " make sure it works 5 times"
 
index 1b0817b..9cf3852 100644 (file)
@@ -75,6 +75,15 @@ fi
 echo '** SET TRACEOFF'
 
 echo "$func:traceoff" > set_ftrace_filter
+if [ -d ../../instances ]; then # Check instances
+    cur=`cat set_ftrace_filter`
+    top=`cat ../../set_ftrace_filter`
+    if [ "$cur" = "$top" ]; then
+       echo "This kernel is too old to support per instance filter"
+       reset_ftrace_filter
+       exit_unsupported
+    fi
+fi
 
 cnt=`grep schedule set_ftrace_filter | wc -l`
 if [ $cnt -ne 1 ]; then