From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org,
peterz@infradead.org
Cc: David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
Robert Richter <robert.richter@amd.com>,
Gleb Natapov <gleb@redhat.com>, Avi Kivity <avi@redhat.com>
Subject: [PATCH 2/3] perf: require exclude_guest to use PEBS - kernel side enforcement
Date: Mon, 10 Sep 2012 10:40:15 -0600 [thread overview]
Message-ID: <1347295216-1202-3-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1347295216-1202-1-git-send-email-dsahern@gmail.com>
From: Peter Zijlstra <peterz@infradead.org>
See https://lkml.org/lkml/2012/7/9/298
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
---
arch/x86/kernel/cpu/perf_event.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 915b876..4bc96c5 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -338,6 +338,9 @@ int x86_setup_perfctr(struct perf_event *event)
/* BTS is currently only allowed for user-mode. */
if (!attr->exclude_kernel)
return -EOPNOTSUPP;
+
+ if (!attr->exclude_guest)
+ return -EOPNOTSUPP;
}
hwc->config |= config;
@@ -380,6 +383,9 @@ int x86_pmu_hw_config(struct perf_event *event)
if (event->attr.precise_ip) {
int precise = 0;
+ if (!event->attr.exclude_guest)
+ return -EOPNOTSUPP;
+
/* Support for constant skid */
if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) {
precise++;
--
1.7.10.1
next prev parent reply other threads:[~2012-09-10 16:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 16:40 [PATCH 0/3] perf: precise mode and exclude_guest David Ahern
2012-09-10 16:40 ` [PATCH 1/3] perf tool: precise mode requires exclude_guest David Ahern
2012-09-10 17:23 ` Peter Zijlstra
2012-09-10 16:40 ` David Ahern [this message]
2012-09-10 17:24 ` [PATCH 2/3] perf: require exclude_guest to use PEBS - kernel side enforcement Peter Zijlstra
2012-09-10 16:40 ` [PATCH 3/3] perf tool: give user better message if precise is not supported David Ahern
2012-09-11 9:20 ` Robert Richter
2012-09-11 13:22 ` David Ahern
2012-09-11 14:01 ` Robert Richter
2012-09-11 14:32 ` David Ahern
2012-09-11 15:11 ` Robert Richter
2012-09-12 14:59 ` David Ahern
2012-09-10 16:57 ` [PATCH 0/3] perf: precise mode and exclude_guest Peter Zijlstra
2012-09-10 17:01 ` David Ahern
2012-09-10 17:13 ` Peter Zijlstra
-- strict thread matches above, loose matches on Subject: below --
2012-09-12 15:16 [PATCH 0/3 v2] " David Ahern
2012-09-12 15:16 ` [PATCH 2/3] perf: require exclude_guest to use PEBS - kernel side enforcement David Ahern
2012-09-13 2:38 ` Namhyung Kim
2012-09-13 4:33 ` David Ahern
2012-09-13 4:45 ` Arnaldo Carvalho de Melo
2012-09-13 20:59 [PATCH 0/3 v3] perf: precise mode and exclude_guest David Ahern
2012-09-13 20:59 ` [PATCH 2/3] perf: require exclude_guest to use PEBS - kernel side enforcement David Ahern
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=1347295216-1202-3-git-send-email-dsahern@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=robert.richter@amd.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 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.