From: Corey Ashford <cjashfor@linux.vnet.ibm.com>
To: eranian@gmail.com
Cc: Ingo Molnar <mingo@elte.hu>,
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 16:13:24 -0700 [thread overview]
Message-ID: <4A849E14.7030007@linux.vnet.ibm.com> (raw)
In-Reply-To: <7c86c4470908131215se9b81d4v18d4d881a70f1aad@mail.gmail.com>
stephane eranian wrote:
> On Thu, Aug 13, 2009 at 11:46 AM, Ingo Molnar<mingo@elte.hu> wrote:
>> * stephane eranian <eranian@googlemail.com> wrote:
>>
>>> On Wed, Aug 12, 2009 at 11:02 AM, Ingo Molnar<mingo@elte.hu> wrote:
[snip]
>>
>> 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.
>>
>
> Except there can be many GPUs, I/O devices and other pieces of
> hardware with PMU-like capabilities in a single system. In that case,
> you need to be able to name them: I want to measure GPUcycles on
> GPU0. When you are down at that level, you don't really care about
> the CPU or thread. So what would you pass for those in that case?
>
>> 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.
>>
One solution might be to split up the cpu argument to sys_perf_counter_open into
two fields, for example:
union {
int cpu;
__u32 pmu_type : 12, /* 0 = CPU, 1 = Socket, 2 = GPU,
3-4095 = arch-defined ... */
pmu_number : 20; /* when pmu_type is 0, 0 = CPU0, 1 = CPU1, etc. */
}
If cpu is not equal to -1, then it would be interpreted as the union above. For
the most common case where you are monitoring CPU's, you just pass the cpu
number in without worrying about the upper bits (as long as the cpu number is
less than 2^20!).
As time goes on, I think we will see more chips with fancy integrated GPU's and
other types of accelerators, as well as other off-chip processors/accelerators,
that developers will want to monitor.
- Corey
Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
cjashfor@us.ibm.com
next prev parent reply other threads:[~2009-08-13 23:13 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
2009-08-13 19:15 ` stephane eranian
2009-08-13 23:13 ` Corey Ashford [this message]
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=4A849E14.7030007@linux.vnet.ibm.com \
--to=cjashfor@linux.vnet.ibm.com \
--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=mingo@elte.hu \
--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