All of lore.kernel.org
 help / color / mirror / Atom feed
From: markus.t.metzger@intel.com
To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com
Cc: markus.t.metzger@gmail.com, a.p.zijlstra@chello.nl,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zjilstra@chello.nl>,
	Markus Metzger <markus.t.metzger@intel.com>
Subject: [patch 3/3] x86, perf_counter, bts: do not allow kernel BTS tracing.
Date: Wed, 02 Sep 2009 16:04:48 +0200	[thread overview]
Message-ID: <20090902140616.901253000@intel.com> (raw)
In-Reply-To: 20090902140445.125358000@intel.com

[-- Attachment #1: tip.master.perf_counter.disable_kernel_bts.patch --]
[-- Type: text/plain, Size: 1074 bytes --]

Kernel BTS tracing generates too much data too fast for us to handle,
causing the kernel to hang.

Fail for BTS requests for kernel code.

CC: Peter Zijlstra <a.p.zjilstra@chello.nl>
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
---
 arch/x86/kernel/cpu/perf_counter.c |   11 	9 +	2 -	0 !
 1 files changed, 9 insertions(+), 2 deletions(-)

Index: b/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -984,8 +984,15 @@ static int __hw_perf_counter_init(struct
 	 * Branch tracing:
 	 */
 	if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
-	    (hwc->sample_period == 1) && !bts_available())
-		return -EOPNOTSUPP;
+	    (hwc->sample_period == 1)) {
+		/* BTS is not supported by this architecture. */
+		if (!bts_available())
+			return -EOPNOTSUPP;
+
+		/* BTS is currently only allowed for user-mode. */
+		if (hwc->config & ARCH_PERFMON_EVENTSEL_OS)
+			return -EOPNOTSUPP;
+	}
 
 	hwc->config |= config;
 

-- 

[-- Attachment #2: Type: text/plain, Size: 656 bytes --]

---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

  parent reply	other threads:[~2009-09-02 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02 14:04 [patch 0/3] x86, perf_counter, bts: incorporate review feedback and fix bugs markus.t.metzger
2009-09-02 14:04 ` [patch 1/3] x86, perf_counter, bts: fail if BTS is not available markus.t.metzger
2009-09-04  7:58   ` [tip:perfcounters/core] x86, perf_counter, bts: Fail " tip-bot for markus.t.metzger@intel.com
2009-09-02 14:04 ` [patch 2/3] x86, perf_counter, bts: correct pointer-to-u64 casts markus.t.metzger
2009-09-04  7:58   ` [tip:perfcounters/core] x86, perf_counter, bts: Correct " tip-bot for markus.t.metzger@intel.com
2009-09-02 14:04 ` markus.t.metzger [this message]
2009-09-04  7:58   ` [tip:perfcounters/core] x86, perf_counter, bts: Do not allow kernel BTS tracing for now tip-bot for markus.t.metzger@intel.com

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=20090902140616.901253000@intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=a.p.zjilstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.t.metzger@gmail.com \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.