From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Robert Richter <robert.richter@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Don Zickus <dzickus@redhat.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC perf,x86] P4 PMU early draft
Date: Mon, 15 Feb 2010 23:32:30 +0300 [thread overview]
Message-ID: <20100215203230.GE5119@lenovo> (raw)
In-Reply-To: <20100215201102.GN13205@erda.amd.com>
On Mon, Feb 15, 2010 at 09:11:02PM +0100, Robert Richter wrote:
> On 08.02.10 21:45:04, Cyrill Gorcunov wrote:
> > Hi all,
> >
> > first of all the patches are NOT for any kind of inclusion. It's not
> > ready yet. More likely I'm asking for glance review, ideas, criticism.
> >
> > The main problem in implementing P4 PMU is that it has much more
> > restrictions for event to MSR mapping. So to fit into current
> > perf_events model I made the following:
> >
> > 1) Event representation. P4 uses a tuple of ESCR+CCCR+COUNTER
> > as an "event". Since every CCCR register mapped directly to
> > counter itself and ESCR and CCCR uses only 32bits of their
> > appropriate MSRs, I decided to use "packed" config in
> > in hw_perf_event::config. So that upper 31 bits are ESCR
> > and lower 32 bits are CCCR values. The bit 64 is for HT flag.
> >
> > So the base idea here is to pack into 64bit hw_perf_event::config
> > as much info as possible.
> >
> > Due to difference in bitfields I needed to implement
> > hw_perf_event::config helper which unbind hw_perf_event::config field
> > from processor specifics and allow to use it in P4 PMU.
>
> If we introduce model specific configuration, we should put more model
> specific code in here and then remove
>
> u64 (*raw_event)(u64);
>
> in struct x86_pmu.
>
It seems we should still support raw_events, if I understand the idea
right -- raw_events could be used for say OProfile (if we are going
to substitute oprofile with perfevents subsystem). So the only
difference with other architectural events is that raw_event
need to be "packed" before being set into.
Putting/packing more specific code into config could make code
even more complex. Dunno Robert...
> > 3) I've started unbinding x86_schedule_events into per x86_pmu::schedule_events
> > and there I hit hardness in binding HT bit. Have to think...
>
> Instead of implemting x86_pmu.schedule_events() you should rather
> abstract x86_pmu_enable(). This will be much more flexible to
> implement other model spcific features.
But I would need collect events and so on -- ie code duplication
will be there. Or you mean something else?
>
> -Robert
>
> --
> Advanced Micro Devices, Inc.
> Operating System Research Center
> email: robert.richter@amd.com
>
-- Cyrill
next prev parent reply other threads:[~2010-02-15 20:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-08 18:45 [RFC perf,x86] P4 PMU early draft Cyrill Gorcunov
2010-02-08 21:56 ` Cyrill Gorcunov
2010-02-09 4:17 ` Ingo Molnar
2010-02-09 6:54 ` Cyrill Gorcunov
2010-02-09 22:39 ` Cyrill Gorcunov
2010-02-10 10:12 ` Peter Zijlstra
2010-02-10 10:38 ` Cyrill Gorcunov
2010-02-10 10:52 ` Peter Zijlstra
2010-02-10 11:23 ` Cyrill Gorcunov
2010-02-11 12:21 ` Peter Zijlstra
2010-02-11 15:22 ` Cyrill Gorcunov
2010-02-26 10:25 ` [tip:perf/core] perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in() tip-bot for Peter Zijlstra
2010-02-09 4:23 ` [RFC perf,x86] P4 PMU early draft Paul Mackerras
2010-02-09 6:57 ` Cyrill Gorcunov
2010-02-09 8:54 ` Peter Zijlstra
2010-02-09 21:13 ` Stephane Eranian
2010-02-09 21:35 ` Cyrill Gorcunov
2010-02-15 20:11 ` Robert Richter
2010-02-15 20:32 ` Cyrill Gorcunov [this message]
2010-02-17 22:14 ` Cyrill Gorcunov
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=20100215203230.GE5119@lenovo \
--to=gorcunov@gmail.com \
--cc=dzickus@redhat.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox