From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 09/10] ftrace: force pass of preemptoff selftest
Date: Fri, 07 Nov 2008 22:46:14 -0500 [thread overview]
Message-ID: <20081108034750.383808318@goodmis.org> (raw)
In-Reply-To: <20081108034605.289816911@goodmis.org>
[-- Attachment #1: 0009-ftrace-force-pass-of-preemptoff-selftest.patch --]
[-- Type: text/plain, Size: 2177 bytes --]
Impact: preemptoff not tested in selftest
Due to the BKL not being preemptable anymore, the selftest of the
preemptoff code can not be tested. It requires that it is called
with preemption enabled, but since the BKL is held, that is no
longer the case.
This patch simply skips those tests if it detects that the context
is not preemptable. The following will now show up in the tests:
Testing tracer preemptoff: can not test ... force PASSED
Testing tracer preemptirqsoff: can not test ... force PASSED
When the BKL is removed, or it becomes preemptable once again, then
the tests will be performed.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
kernel/trace/trace_selftest.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index ea4e5d3..0728a10 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -257,6 +257,19 @@ trace_selftest_startup_preemptoff(struct tracer *trace, struct trace_array *tr)
unsigned long count;
int ret;
+ /*
+ * Now that the big kernel lock is no longer preemptable,
+ * and this is called with the BKL held, it will always
+ * fail. If preemption is already disabled, simply
+ * pass the test. When the BKL is removed, or becomes
+ * preemptible again, we will once again test this,
+ * so keep it in.
+ */
+ if (preempt_count()) {
+ printk(KERN_CONT "can not test ... force ");
+ return 0;
+ }
+
/* start the tracing */
trace->init(tr);
/* reset the max latency */
@@ -293,6 +306,19 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
unsigned long count;
int ret;
+ /*
+ * Now that the big kernel lock is no longer preemptable,
+ * and this is called with the BKL held, it will always
+ * fail. If preemption is already disabled, simply
+ * pass the test. When the BKL is removed, or becomes
+ * preemptible again, we will once again test this,
+ * so keep it in.
+ */
+ if (preempt_count()) {
+ printk(KERN_CONT "can not test ... force ");
+ return 0;
+ }
+
/* start the tracing */
trace->init(tr);
--
1.5.6.5
--
next prev parent reply other threads:[~2008-11-08 3:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-08 3:46 [PATCH 00/10] ftrace: various updates Steven Rostedt
2008-11-08 3:46 ` [PATCH 01/10] ftrace: fix set_ftrace_filter Steven Rostedt
2008-11-08 3:46 ` [PATCH 02/10] ftrace: fix boot trace sched startup Steven Rostedt
2008-11-08 4:12 ` Frédéric Weisbecker
2008-11-08 12:17 ` Steven Rostedt
2008-11-08 3:46 ` [PATCH 03/10] ftrace: fix sched_switch API Steven Rostedt
2008-11-08 4:20 ` Frédéric Weisbecker
2008-11-08 3:46 ` [PATCH 04/10] ftrace: irqsoff tracer incorrect reset Steven Rostedt
2008-11-08 3:46 ` [PATCH 05/10] ftrace: enable trace_printk by default Steven Rostedt
2008-11-08 3:46 ` [PATCH 06/10] ftrace: remove ctrl_update method Steven Rostedt
2008-11-08 3:46 ` [PATCH 07/10] ftrace: remove trace array ctrl Steven Rostedt
2008-11-08 3:46 ` [PATCH 08/10] ftrace: Align __mcount_loc sections Steven Rostedt
2008-11-08 3:55 ` Steven Rostedt
2008-11-08 3:46 ` Steven Rostedt [this message]
2008-11-08 3:46 ` [PATCH 10/10] ftrace: display start of CPU buffer in trace output Steven Rostedt
2008-11-08 8:42 ` [PATCH 00/10] ftrace: various updates Ingo Molnar
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=20081108034750.383808318@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=srostedt@redhat.com \
/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
all inboxes | Powered by JetHome®