From: Ingo Molnar <mingo@elte.hu>
To: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
eranian@gmail.com, Thomas Gleixner <tglx@linutronix.de>,
Philip Mucci <mucci@eecs.utk.edu>,
LKML <linux-kernel@vger.kernel.org>,
Andi Kleen <andi@firstfloor.org>,
Paul Mackerras <paulus@samba.org>,
Maynard Johnson <mpjohn@us.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
perfmon2-devel <perfmon2-devel@lists.sourceforge.net>
Subject: Re: [perfmon2] comments on Performance Counters for Linux (PCL)
Date: Thu, 28 May 2009 23:35:32 +0200 [thread overview]
Message-ID: <20090528213532.GA8589@elte.hu> (raw)
In-Reply-To: <4A1EFCC2.80805@linux.vnet.ibm.com>
* Corey Ashford <cjashfor@linux.vnet.ibm.com> wrote:
> Just a few comments below on some excerpts from this very good discussion.
>
> Peter Zijlstra wrote:
>> On Thu, 2009-05-28 at 16:58 +0200, stephane eranian wrote:
>>> - uint64_t irq_period
>>>
>>> IRQ is an x86 related name. Why not use smpl_period instead?
irq is not an x86 related name at all. There's thousands of uses of
it even in arch/powerpc:
earth4:~/tip> git grep -i irq arch/powerpc/ | wc -l
6441
>>
>> don't really care, but IRQ seems used throughout linux, we could
>> name the thing interrupt or sample period.
>
> I agree with Stephane, the name irq_period struck me as somewhat
> strange for what it does. sample_period would be much better.
sample_period would be fine - but smpl_period definitely not ;-)
>>> - uint32_t record_type
>>>
>>> This field is a bitmask. I believe 32-bit is too small to
>>> accommodate future record formats.
>>
>> It currently controls 8 aspects of the overflow entry, do you
>> really forsee the need for more than 32?
>
> record_type is probably not the best name for this either. Maybe
> "record_layout" or "sample_layout" or "sample_format" (to go along
> with read_format)
'record' is pretty established for this - so record_layout would be
fine. Peter?
>>> I would assume that on the read() side, counts are accumulated as
>>> 64-bit integers. But if it is the case, then it seems there is an
>>> asymmetry between period and counts.
>>>
>>> Given that your API is high level, I don't think tools should have to
>>> worry about the actual width of a counter. This is especially true
>>> because they don't know which counters the event is going to go into
>>> and if I recall correctly, on some PMU models, different counters can
>>> have different width (Power, I think).
>>>
>>> It is rather convenient for tools to always manipulate counters as
>>> 64-bit integers. You should provide a consistent view between counts
>>> and periods.
>>
>> So you're suggesting to artificually strech periods by say
>> composing a single overflow from smaller ones, ignoring the
>> intermediate overflow events?
>>
>> That sounds doable, again, patch welcome.
>
> I definitely agree with Stephane's point on this one. I had
> assumed that long irq_periods (longer than the width of the
> counter) would be synthesized as you suggest. If this is not the
> case, PCL should be changed so that it does, -or- at a minimum,
> the user should get an error back stating that the period is too
> long for the hardware counter.
this looks somewhat academic - at least on x86, even the fastest
events (say cycles) with a 32 bit overflow means one event per
second on 4GB. That's not a significant event count in practice.
What's the minimum width we are talking about on Power?
Ingo
next prev parent reply other threads:[~2009-05-28 21:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-28 14:58 comments on Performance Counters for Linux (PCL) stephane eranian
2009-05-28 16:25 ` Peter Zijlstra
2009-05-28 16:47 ` Peter Zijlstra
2009-05-28 21:06 ` [perfmon2] " Corey Ashford
2009-05-28 21:35 ` Ingo Molnar [this message]
2009-05-28 23:24 ` Paul Mackerras
2009-05-29 7:19 ` Ingo Molnar
2009-05-29 8:21 ` Geert Uytterhoeven
2009-05-29 14:42 ` Carl Love
2009-05-30 19:16 ` Ingo Molnar
2009-05-29 10:50 ` stephane eranian
2009-05-29 10:53 ` stephane eranian
2009-05-29 6:51 ` Andi Kleen
2009-05-29 8:19 ` Peter Zijlstra
2009-05-29 8:53 ` Andi Kleen
2009-05-29 16:13 ` [perfmon2] " Luck, Tony
2009-05-29 10:43 ` stephane eranian
2009-05-29 15:02 ` Peter Zijlstra
2009-05-29 15:59 ` stephane eranian
2009-05-29 20:32 ` Peter Zijlstra
2009-05-29 20:49 ` 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=20090528213532.GA8589@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=cjashfor@linux.vnet.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=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