Re: [patch 0/3] [Announcement] Performance Counters for Linux

From: David Miller
Date: Fri Dec 05 2008 - 02:58:05 EST


From: Ingo Molnar <mingo@xxxxxxx>
Date: Fri, 5 Dec 2008 08:03:29 +0100

>
> * Ingo Molnar <mingo@xxxxxxx> wrote:
>
> > This can be done in a very natural way with our abstraction, and the
> > "hello.c" example happens to do exactly that:
>
> multiple people pointed out that we have not posted hello.c :-/

Because it's completely not providing the facility. This is not how
people want to use the performance counters at all.

And it doesn't even do what Paulus said is necessary, he said:

--------------------
> One thing that this sort of thing can't do is to get values from
> multiple counters that correlate with each other. For instance, we
> would often want to count, say, L2 cache misses and instructions
> completed at the same time, and be able to read both counters at very
> close to the same time, so that we can measure average L2 cache misses
> per instruction completed, which is useful.
--------------------

And if you read one counter then read the other as seperate operations,
you get extra events in there as a side effect of going back into
userspace between the two reads.

Nobody wants that, it's inaccurate and if you're looking for if one
event happens at all it's not only inaccurate it's useless if the
reads trigger that counter event. Also, correlation has other
meanings.

What people want is blocking on overflow events, and a monitoring task
or thread doing all of the tricky control register management and task
inspection.

I mean look at some of the test cases and sample programs in the PAPI
and perfmon2 librarys, that stuff is extremely cool and this proposal
cannot do half of that stuff correctly.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/