From: Michael Ellerman <mpe@ellerman.id.au>
To: <linuxppc-dev@ozlabs.org>
Cc: ymanton@ca.ibm.com, Paul Mackerras <paulus@samba.org>,
khandual@linux.vnet.ibm.com
Subject: [PATCH 1/5] powerpc/perf: Reject EBB events which specify a sample_type
Date: Thu, 6 Mar 2014 17:59:08 +1100 [thread overview]
Message-ID: <1394089152-603-1-git-send-email-mpe@ellerman.id.au> (raw)
Although we already block EBB events which request sampling using
sample_period, technically it's possible for an event to set sample_type
but not sample_period.
Nothing terrible will happen if an EBB event does specify sample_type,
but it signals a major confusion on the part of userspace, and so we do
them the favor of rejecting it.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/perf/core-book3s.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 67cf220..4b2ba0c 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -502,8 +502,11 @@ static int ebb_event_check(struct perf_event *event)
if (!leader->attr.pinned || !leader->attr.exclusive)
return -EINVAL;
- if (event->attr.inherit || event->attr.sample_period ||
- event->attr.enable_on_exec || event->attr.freq)
+ if (event->attr.freq ||
+ event->attr.inherit ||
+ event->attr.sample_type ||
+ event->attr.sample_period ||
+ event->attr.enable_on_exec)
return -EINVAL;
}
--
1.8.3.2
next reply other threads:[~2014-03-06 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 6:59 Michael Ellerman [this message]
2014-03-06 6:59 ` [PATCH 2/5] powerpc/perf: Clean up the EBB hash defines a little Michael Ellerman
2014-03-06 6:59 ` [PATCH 3/5] powerpc/perf: Avoid mutating event in power8_get_constraint() Michael Ellerman
2014-03-06 6:59 ` [PATCH 4/5] powerpc/perf: Add BHRB constraint and IFM MMCRA handling for EBB Michael Ellerman
2014-03-06 6:59 ` [PATCH 5/5] powerpc/perf: Enable BHRB access for EBB events Michael Ellerman
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=1394089152-603-1-git-send-email-mpe@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=khandual@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=ymanton@ca.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;
as well as URLs for NNTP newsgroup(s).