From: Ingo Molnar <mingo@elte.hu>
To: eranian@gmail.com
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Robert Richter <robert.richter@amd.com>,
Paul Mackerras <paulus@samba.org>,
Andi Kleen <andi@firstfloor.org>,
Maynard Johnson <mpjohn@us.ibm.com>, Carl Love <cel@us.ibm.com>,
Corey J Ashford <cjashfor@us.ibm.com>,
Philip Mucci <mucci@eecs.utk.edu>,
Dan Terpstra <terpstra@eecs.utk.edu>,
perfmon2-devel <perfmon2-devel@lists.sourceforge.net>
Subject: Re: perf_counters issue with PERF_SAMPLE_GROUP
Date: Thu, 13 Aug 2009 11:46:35 +0200 [thread overview]
Message-ID: <20090813094635.GA26612@elte.hu> (raw)
In-Reply-To: <7c86c4470908120522m1eaf891bqb394df072dddc701@mail.gmail.com>
* stephane eranian <eranian@googlemail.com> wrote:
> On Wed, Aug 12, 2009 at 11:02 AM, Ingo Molnar<mingo@elte.hu> wrote:
>
> > Not sure we want to change it. Mixing PID and CPU into the same
> > space disallows the simultaneous application of both. I.e. right
> > now we allow 3 models:
> >
> > - PID-ish
> > - CPU-ish
> > - PID and CPU [say measure CPU#2 component of an inherited workload.]
>
> How useful is that last model, especially why only one CPU?
It's somewhat useful: say on an inherited workload one could 'cut
out' just a single CPU worth of samples.
Or a tool could implement a more scalable sampling model: say on a
quad core CPU one could have four counters in an inherited workload:
cycles:cpu0
cycles:cpu1
cycles:cpu2
cycles:cpu3
... and depending on which CPU a sub-process or sub-thread is
running on, would the according (nicely per cpu local) sampling
buffer be used.
> > Also, i dont really see the use-cases for new targets. (i've
> > seen a few mentioned but none seemed valid) What new targets do
> > people have in mind?
>
> I seem to recall people mentioned:
> 1- CPU socket, e.g., uncore PMU
> 2- chipset
> 3- GPU
>
> I can see 1/ being indirectly achievable by specifying a CPU.
Correct.
( Note, it's not just indirectly achievable as a side-effect - for
example the Intel uncore PMU has a target CPU irq-mask, so it
makes sense to allow the specification of the specific CPU we are
measuring on as well. The physical socket maps from the CPU. )
> [...] But the others are uncorrelated to either a CPU or thread. I
> have already seen requests for accessing chipsets, and seems GPU
> are around the corner now.
>
> Why do you think those would be invalid targets given the goal of
> this API?
No.
Chipset and GPU measurements are very much possible via perfcounters
as well - but that does not require the touching of the pid,cpu
target parameters to sys_perf_counter_open().
I think the confusion in this discussion comes from the fact that
there are two different types of 'targets':
The first type of target, the <pid,cpu> target is a _scheduling_,
task management abstraction. Adding a chipset ID or GPU ID to that
makes little sense! Tasks dont get scheduled on a 'chipset' - to
each task the chipset looks like an external entity.
The second type of target is the 'event source itself'. (and it's
not really a target but a source.)
A chipset or GPU should be abstracted via an _event source_
abstraction. We've got wide possibilities to do that, and we already
abstract a fair amount of non-CPU-sourced events that way: say we
have irq tracepoint counters:
aldebaran:~> perf list 2>&1 | grep irq
irq:irq_handler_entry [Tracepoint event]
irqs come from the chipset, so in an (unintended) way perfcounters
already instruments the chipset today.
So yes, both chipset and GPU sampling is very much possible, and it
does not require the tweaking of the syscall target parameters -
each CPU has a typically symmetric view on it.
Note that there's overlap: a CPU can be an event source and a
scheduling target as well. I think some of the confusion in
terminology comes from that.
To support chipset or GPU sampling, the perf_type_id and/or the
struct perf_counter_attr space can be extended.
We'd have to see the patches to decide the best way forward - it's
difficult to argue this hypothetically, as there are so many
solutions (with different levels of complexity and utility) to
expose chipsets and GPUs to perfcounters. In any case, the counter
scheduling target parameters dont need to be touched for them.
Ingo
next prev parent reply other threads:[~2009-08-13 9:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 15:41 perf_counters issue with PERF_SAMPLE_GROUP stephane eranian
2009-08-11 16:05 ` Peter Zijlstra
2009-08-11 19:40 ` stephane eranian
2009-08-11 20:55 ` Peter Zijlstra
2009-08-11 21:08 ` stephane eranian
2009-08-12 8:32 ` Peter Zijlstra
2009-08-12 9:02 ` Ingo Molnar
2009-08-12 12:22 ` stephane eranian
2009-08-13 9:46 ` Ingo Molnar [this message]
2009-08-13 19:15 ` stephane eranian
2009-08-13 23:13 ` Corey Ashford
2009-08-13 23:49 ` Paul Mackerras
2009-08-12 20:54 ` 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=20090813094635.GA26612@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=cel@us.ibm.com \
--cc=cjashfor@us.ibm.com \
--cc=eranian@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpjohn@us.ibm.com \
--cc=mucci@eecs.utk.edu \
--cc=paulus@samba.org \
--cc=perfmon2-devel@lists.sourceforge.net \
--cc=robert.richter@amd.com \
--cc=terpstra@eecs.utk.edu \
--cc=tglx@linutronix.de \
/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