From: Ingo Molnar <mingo@elte.hu>
To: eranian@gmail.com
Cc: David Miller <davem@davemloft.net>,
paulus@samba.org, a.p.zijlstra@chello.nl,
linux-kernel@vger.kernel.org, perfmon2-devel@lists.sf.net
Subject: Re: [PATCH 2/2] perf_events: add event constraints support for Intel processors
Date: Mon, 12 Oct 2009 11:05:15 +0200 [thread overview]
Message-ID: <20091012090515.GA24031@elte.hu> (raw)
In-Reply-To: <7c86c4470910081328r24be0f63ha436b008b66077c4@mail.gmail.com>
* stephane eranian <eranian@googlemail.com> wrote:
> On Thu, Oct 8, 2009 at 10:08 PM, Ingo Molnar <mingo@elte.hu> wrote:
> >
> > * David Miller <davem@davemloft.net> wrote:
> >
> >> From: stephane eranian <eranian@googlemail.com>
> >> Date: Wed, 7 Oct 2009 14:31:58 +0200
> >>
> >> > What PPC does is probably the only way to do this given the interface between
> >> > generic and machine-specific code. The one advantage I see is that it works
> >> > inside an event group but also across event groups because that code does not
> >> > look at group boundary, it only looks at the events and the number of available
> >> > registers. The downside is that you duplicate state.
> >> >
> >> > Did I get this right, Paul?
> >>
> >> That's basically how his code works, yes. I intend on duplicating it
> >> to some extent on sparc64 since I'm operating in a similar problem
> >> space.
> >>
> >> So if at least some of this engine went to a generic place, there'd be
> >> at least a 3rd user :-)
> >
> > Yeah, i'd definitely suggest to generalize this. We've missed updating
> > PowerPC lowlevel details a couple of times in perf core updates, just
> > because it's in a non-obvious place. Even if it's used by just a single
> > arch, generic code is much more visible.
> >
>
> It is not clear how you can do this without creating a monster. As I
> said the constraints can be far more difficult than just event X =>
> allowed_counter_bitmask.
The event constraints we are interested in come from the physics of
CPUs, not from inherent properties of particular architectures.
If you check the various constraints you'll see there's many repeating
patterns and many of those will repeat between architectures.
Arbitrary, random constraints (that stem from design stupidity/laziness)
can be kept at arch level, as a quirk in essence.
Spreading them all out into architecture code is the far worse solution,
it creates a fragile distributed monster with repeating patterns -
instead we want a manageable central monster ;-) [We are also quite good
at controlling and shrinking monsters in the core kernel.]
So we could start all this by factoring out the sane looking bits of
PowerPC and x86 constraints into generic helpers, and go step by step
starting from that point.
Would you be interested in trying that, to finish what you started with
'struct event_constraint' in arch/x86/kernel/cpu/perf_event.c?
Thanks,
Ingo
next prev parent reply other threads:[~2009-10-12 9:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 14:42 [PATCH 0/2] perf_events: correct event assignments on Intel processors Stephane Eranian
2009-10-06 14:42 ` [PATCH 1/2] perf_events: check for filters on fixed counter events Stephane Eranian
2009-10-06 14:42 ` [PATCH 2/2] perf_events: add event constraints support for Intel processors Stephane Eranian
2009-10-06 16:29 ` Peter Zijlstra
2009-10-06 17:26 ` stephane eranian
2009-10-06 18:57 ` [perfmon2] " Vince Weaver
2009-10-07 10:31 ` Peter Zijlstra
2009-10-07 11:15 ` Paul Mackerras
2009-10-07 12:31 ` stephane eranian
2009-10-07 20:46 ` David Miller
2009-10-07 21:30 ` stephane eranian
2009-10-08 20:08 ` Ingo Molnar
2009-10-08 20:28 ` stephane eranian
2009-10-12 9:05 ` Ingo Molnar [this message]
2009-10-13 7:17 ` stephane eranian
2009-10-13 7:29 ` Ingo Molnar
2009-10-08 23:18 ` Paul Mackerras
2009-10-09 14:22 ` [tip:perf/core] perf, x86: Add simple group validation tip-bot for Peter Zijlstra
2009-10-09 13:55 ` [PATCH 2/2] perf_events: add event constraints support for Intel processors Ingo Molnar
2009-10-09 14:22 ` [tip:perf/core] perf_events: Add " tip-bot for Stephane Eranian
2009-10-09 14:22 ` [tip:perf/core] perf_events: Check for filters on fixed counter events tip-bot for Stephane Eranian
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=20091012090515.GA24031@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=davem@davemloft.net \
--cc=eranian@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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