From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>,
linux-kernel@vger.kernel.org, mingo@elte.hu, paulus@samba.org,
davem@davemloft.net, perfmon2-devel@lists.sf.net
Subject: [PATCH] perf: fix the is_software_event() definition
Date: Mon, 18 Jan 2010 12:53:36 +0100 [thread overview]
Message-ID: <1263815616.4283.332.camel@laptop> (raw)
In-Reply-To: <1263813189.4283.245.camel@laptop>
On Mon, 2010-01-18 at 12:13 +0100, Peter Zijlstra wrote:
> On Sun, 2010-01-17 at 15:12 +0100, Frederic Weisbecker wrote:
>
> > You need to also call pmu->disable() if it is a software event,
> > because a breakpoint needs to be unregistered in hardware level
> > too.
>
> breakpoint isn't a software pmu. But yeah, enable and disable need to
> match.
That is, it shouldn't be a software pmu, because we assume software
events can always be scheduled, whereas that's definitely not so for the
breakpoint one.
Which seems to suggest the following
---
Subject: perf: fix the is_software_event() definition
When adding the breakpoint pmu Frederic forgot to exclude it from being
a software event. While we're at it, make it an inclusive expression.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/perf_event.h | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c66b34f..835ba26 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -814,9 +814,13 @@ extern int perf_event_overflow(struct perf_event *event, int nmi,
*/
static inline int is_software_event(struct perf_event *event)
{
- return (event->attr.type != PERF_TYPE_RAW) &&
- (event->attr.type != PERF_TYPE_HARDWARE) &&
- (event->attr.type != PERF_TYPE_HW_CACHE);
+ switch (event->attr.type) {
+ case PERF_TYPE_SOFTWARE:
+ case PERF_TYPE_TRACEPOINT:
+ case PERF_TYPE_HW_CACHE:
+ return 1;
+ }
+ return 0;
}
extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];
next prev parent reply other threads:[~2010-01-18 11:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 10:50 [PATCH] perf_events: improve x86 event scheduling Stephane Eranian
2010-01-12 16:10 ` Peter Zijlstra
2010-01-13 9:54 ` Stephane Eranian
2010-01-13 16:29 ` Peter Zijlstra
2010-01-13 16:52 ` Stephane Eranian
2010-01-13 17:22 ` Stephane Eranian
2010-01-17 14:12 ` Frederic Weisbecker
2010-01-17 14:42 ` Stephane Eranian
2010-01-17 16:19 ` Frederic Weisbecker
2010-01-17 21:53 ` Stephane Eranian
2010-01-18 11:13 ` Peter Zijlstra
2010-01-18 11:53 ` Peter Zijlstra [this message]
2010-01-18 12:07 ` [PATCH] perf: fix the is_software_event() definition Frederic Weisbecker
2010-01-18 12:19 ` Peter Zijlstra
2010-01-18 13:46 ` [perfmon2] " stephane eranian
2010-01-18 12:57 ` stephane eranian
2010-01-18 13:06 ` Frederic Weisbecker
2010-01-18 12:53 ` stephane eranian
2010-01-18 13:00 ` Peter Zijlstra
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=1263815616.4283.332.camel@laptop \
--to=peterz@infradead.org \
--cc=davem@davemloft.net \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=perfmon2-devel@lists.sf.net \
/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