lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <149551979426.30231.14771247680865325373.stgit@devbox>
Date:   Tue, 23 May 2017 15:10:04 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     linux-kselftest@...r.kernel.org, shuah@...nel.org,
        Steven Rostedt <rostedt@...dmis.org>
Cc:     mhiramat@...nel.org, Ingo Molnar <mingo@...hat.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 7/7] selftests/ftrace: Return unsupported if it detects older kernel

Return unsupported if the kernel is too old to support
instance independent ftrace filter for some testcases.

Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
 .../ftrace/test.d/ftrace/func_event_triggers.tc    |    9 +++++++++
 .../test.d/ftrace/func_traceonoff_triggers.tc      |    9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
index aa31368..77dfb6b 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
@@ -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"
 
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
index 1b0817b..9cf3852 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
@@ -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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ