Re: perf, x86: Add parts of the remaining haswell PMU functionality

From: Ingo Molnar
Date: Thu Sep 05 2013 - 13:13:07 EST



* Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

> The correct way is to implement it like TopDown level 1, but I don't
> know how to put that into the kernel.

Create an event group, with some callbacks to do the
additions/subtractions to get at the right figures? (if it's plain linear
arithmetics then that could be encoded in some simple operation flags as
well, executed and calculated when the group count is accessed.)

That's something that would be useful to have in the kernel anyway, to
abstract away simple concepts that are not so simple to measure.

> http://software.intel.com/en-us/articles/how-to-tune-applications-using-a-top-down-characterization-of-microarchitectural-issues
>
> It requires running 4 counters and computing some equations.
>
> My toplev tool in http://github.com/andikleen/pmu-tools has a
> implementation on top of perf.
>
> I could put it into perf stat if you want, but it would be somewhat
> Intel specific.

Yeah, would be nice to hide this mostly transparently, behind a group of
events or so.

Thanks,

Ingo
--
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/