From: Masami Hiramatsu <mhiramat@kernel.org>
To: linux-kselftest@vger.kernel.org, shuah@kernel.org,
Steven Rostedt <rostedt@goodmis.org>
Cc: mhiramat@kernel.org, Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/7] selftests/ftrace: Skip full-glob-matching filter test on older kernel
Date: Tue, 23 May 2017 15:03:43 +0900 [thread overview]
Message-ID: <149551941319.30231.14904655534340495286.stgit@devbox> (raw)
In-Reply-To: <149551934796.30231.12544755801380678045.stgit@devbox>
Skip a part of ftrace filter test related to full-glob
matching if we are sure that the testing kernel is so old
that it does not support full-glob-matching yet.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
.../ftrace/test.d/ftrace/func-filter-glob.tc | 28 ++++++++++++--------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
index 9dcd0ca..8095e12 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
@@ -11,17 +11,6 @@ fi
disable_tracing
clear_trace
-# filter by ?, schedule is always good
-if ! echo "sch?dule" > set_ftrace_filter; then
- # test for powerpc 64
- if ! echo ".sch?dule" > set_ftrace_filter; then
- fail "can not enable schedule filter"
- fi
- cat set_ftrace_filter | grep '^.schedule$'
-else
- cat set_ftrace_filter | grep '^schedule$'
-fi
-
ftrace_filter_check() { # glob grep
echo "$1" > set_ftrace_filter
cut -f1 -d" " set_ftrace_filter > $TMPDIR/actual
@@ -39,11 +28,28 @@ ftrace_filter_check '*schedule*' '^.*schedule.*$'
# filter by *, end match
ftrace_filter_check 'schedule*' '^schedule.*$'
+# Advanced full-glob matching feature is recently supported.
+# Skip the tests if we are sure the kernel does not support it.
+if grep -q 'accepts: .* glob-matching-pattern' README ; then
+
# filter by *, both side match
ftrace_filter_check 'sch*ule' '^sch.*ule$'
# filter by char class.
ftrace_filter_check '[Ss]y[Ss]_*' '^[Ss]y[Ss]_.*$'
+# filter by ?, schedule is always good
+if ! echo "sch?dule" > set_ftrace_filter; then
+ # test for powerpc 64
+ if ! echo ".sch?dule" > set_ftrace_filter; then
+ fail "can not enable schedule filter"
+ fi
+ cat set_ftrace_filter | grep '^.schedule$'
+else
+ cat set_ftrace_filter | grep '^schedule$'
+fi
+
+fi
+
echo > set_ftrace_filter
enable_tracing
next prev parent reply other threads:[~2017-05-23 6:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 6:02 [PATCH 0/7] selftests/ftrace: Some improvements of ftracetest Masami Hiramatsu
2017-05-23 6:03 ` Masami Hiramatsu [this message]
2017-05-23 6:04 ` [PATCH 2/7] selftests/ftrace: Reduce trace buffer checking overhead Masami Hiramatsu
2017-05-23 6:05 ` [PATCH 3/7] ftrace/kprobes: selftests: Check kretprobe maxactive is supported Masami Hiramatsu
2017-05-23 6:06 ` [PATCH 4/7] selftests/ftrace: Reset ftrace filter on older kernel Masami Hiramatsu
2017-05-23 6:07 ` [PATCH 5/7] selftests/ftrace: Add instance indication in test log Masami Hiramatsu
2017-05-23 6:09 ` [PATCH 6/7] selftests/ftrace: Use top-level available_filter_function Masami Hiramatsu
2017-05-23 6:10 ` [PATCH 7/7] selftests/ftrace: Return unsupported if it detects older kernel Masami Hiramatsu
2017-06-07 22:42 ` [PATCH 0/7] selftests/ftrace: Some improvements of ftracetest Shuah Khan
2017-06-07 22:56 ` Steven Rostedt
2017-06-07 23:01 ` Shuah Khan
2017-06-08 17:37 ` Steven Rostedt
2017-06-08 20:06 ` Shuah Khan
2017-06-08 21:08 ` Steven Rostedt
2017-06-08 21:14 ` Shuah Khan
2017-06-08 21:26 ` Steven Rostedt
2017-06-08 21:33 ` Shuah Khan
2017-06-08 21:39 ` Steven Rostedt
2017-06-08 21:44 ` Shuah Khan
2017-06-08 21:51 ` Steven Rostedt
2017-06-14 2:12 ` Masami Hiramatsu
2017-06-14 4:53 ` Masami Hiramatsu
2017-06-14 14:17 ` Shuah Khan
2017-06-30 14:18 ` Shuah Khan
2017-06-08 21:11 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=149551941319.30231.14904655534340495286.stgit@devbox \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox