From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@ZenIV.linux.org.uk>,
Masami Hiramatsu <mhiramat@kernel.org>,
Dmitry Safonov <0x7f454c46@gmail.com>,
Shuah Khan <shuah@kernel.org>
Subject: [PATCH 4/6] selftests/ftrace: Have reset_ftrace_filter handle multiple instances
Date: Fri, 09 Feb 2018 15:03:08 -0500 [thread overview]
Message-ID: <20180209200359.624796500@goodmis.org> (raw)
In-Reply-To: 20180209200304.703130163@goodmis.org
[-- Attachment #1: 0004-selftests-ftrace-Have-reset_ftrace_filter-handle-mul.patch --]
[-- Type: text/plain, Size: 1462 bytes --]
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
If a probe is attached to a static function that is in multiple files with
the same name, removing it by name will remove all instances:
# grep jump_label_unlock set_ftrace_filter
jump_label_unlock:traceoff:unlimited
jump_label_unlock:traceoff:unlimited
# echo '!jump_label_unlock:traceoff' >> set_ftrace_filter
# grep jump_label_unlock set_ftrace_filter
#
But the loop in reset_ftrace_filter will try to remove multiple instances
multiple times. If this happens the second time will error and cause the
test to fail.
At each iteration of the loop, check to see if the probe being removed still
exists.
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
tools/testing/selftests/ftrace/test.d/functions | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index e7c4c7b752a2..df3dd7fe5f9b 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -37,6 +37,9 @@ reset_ftrace_filter() { # reset all triggers in set_ftrace_filter
if [ "$tr" = "" ]; then
continue
fi
+ if ! grep -q "$t" set_ftrace_filter; then
+ continue;
+ fi
name=`echo $t | cut -d: -f1 | cut -d' ' -f1`
if [ $tr = "enable_event" -o $tr = "disable_event" ]; then
tr=`echo $t | cut -d: -f2-4`
--
2.15.1
next prev parent reply other threads:[~2018-02-09 20:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 20:03 [PATCH 0/6] [GIT PULL] tracing: Some fixes to filter parsing Steven Rostedt
2018-02-09 20:03 ` [PATCH 1/6] ftrace: Remove incorrect setting of glob search field Steven Rostedt
2018-02-09 20:03 ` [PATCH 2/6] tracing: Fix parsing of globs with a wildcard at the beginning Steven Rostedt
2018-02-09 20:03 ` [PATCH 3/6] selftests/ftrace: Have reset_ftrace_filter handle modules Steven Rostedt
2018-02-09 20:03 ` Steven Rostedt [this message]
2018-02-09 20:03 ` [PATCH 5/6] selftests/ftrace: Add some missing glob checks Steven Rostedt
2018-02-09 20:03 ` [PATCH 6/6] selftests/ftrace: Add more tests for removing of function probes 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=20180209200359.624796500@goodmis.org \
--to=rostedt@goodmis.org \
--cc=0x7f454c46@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=shuah@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).