The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: ftrace: preemptoff selftest not working
Date: Tue, 18 Nov 2008 14:48:35 +0100	[thread overview]
Message-ID: <20081118134835.GC31146@elte.hu> (raw)
In-Reply-To: <20081118125359.GA4417@osiris.boeblingen.de.ibm.com>


* Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

> Hi Steven,
> 
> I was wondering why the preemptoff and preemptirqsoff tracer 
> selftests don't work on s390. After all its just that they get 
> called from non-preemptible context:
> 
> kernel_init() will execute all initcalls, however the first line in 
> kernel_init() is lock_kernel(), which causes the preempt_count to be 
> increased. Any later calls to add_preempt_count() (especially those 
> from the selftests) will therefore not result in a call to 
> trace_preempt_off() since the check below in add_preempt_count() 
> will be false:
> 
> 	if (preempt_count() == val)
> 		trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1));
> 
> Hence the trace buffer will be empty.

ah, indeed :-)

side-effect of the removal of CONFIG_PREEMPT_BKL - these things were 
written before that and nobody noticed that the self-test stopped 
working for real.

> The patch below makes the selftests working for me, since then they 
> run in preemptible context. But it is ugly and I'm not proposing it 
> for upstream ;)
> 
> Just wanted to make you aware that there is a bug.

indeed it's ugly. We could perhaps drop the BKL in the selftests?

	Ingo

  reply	other threads:[~2008-11-18 13:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18 12:54 ftrace: preemptoff selftest not working Heiko Carstens
2008-11-18 13:48 ` Ingo Molnar [this message]
2008-11-18 13:49 ` Steven Rostedt
2008-11-18 13:52   ` Ingo Molnar
2008-11-18 14:32     ` Steven Rostedt
2008-11-18 14:47       ` Ingo Molnar
2008-11-18 17:06         ` Heiko Carstens
2008-11-18 17:21           ` Steven Rostedt
2008-11-18 20:55             ` Ingo Molnar
2008-11-19  9:02               ` Ingo Molnar
2008-11-19  9:23                 ` Heiko Carstens

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=20081118134835.GC31146@elte.hu \
    --to=mingo@elte.hu \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=schwidefsky@de.ibm.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