Re: [PATCH 6/18] perfmon2 patch for review: sampling format support

From: Stephane Eranian
Date: Wed Aug 23 2006 - 06:52:51 EST


On Wed, Aug 23, 2006 at 12:31:05PM +0200, Andi Kleen wrote:
> Stephane Eranian <eranian@xxxxxxxxxxxxxxxxx> writes:
> > This files contains the sampling format support.
> >
> > Perfmon2 supports an in-kernel sampling buffer for performance
> > reasons. Yet to ensure maximum flexibility to applications,
> > the formats is which infmration is recorded into the kernel
> > buffer is not specified by the interface. Instead it is
> > delegated to a kernel plug-in modules called sampling formats.
> This seems quote complicated. Who are the users of different sampling formats?
The best example I have is PEBS. With PEBS the sampling buffer
format is dictated by HW not software. Lots of people are using
PEBS, this is a really useful feature, that has been very hard to
get to so far.

Without the sampling format mechanism, I could certainly hardcode
the default format and be done. But then I would have to hack
something in just for PEBS on P4.

One day, someone would come along and ask for another type of
format, that would add more complexity. Instead of this, I designed
some flexible and fairly simple that provides enough flexibility
to support lots of different formats (including Oprofile).
I have already received requests for a format that does double-buffering
for instance.

> I assume the code would be considerable simpler if you hardcoded
> the perfmon2 format, right?

Maybe at the beginning, but it would quickly becomes complicated as
new HW features emerge.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at