Re: [RFC -tip] perf, x86: Add PERF_COUNT_HW_NMI_WATCHDOG event v2

From: Cyrill Gorcunov
Date: Tue Jun 21 2011 - 14:32:37 EST


On Tue, Jun 21, 2011 at 08:06:54PM +0200, Stephane Eranian wrote:
...
>
> If in arch/x86/kernel/cpu/perf_event.c I add a callback which
> checks:
>
> if (netburst_host) {
> attr.type = PERF_TYPE_RAW
> attr.config = 0x3c
> } else {
> attr.type = PERF_TYPE_HARDWARE
> attr.config = PERF_COUNT_HW__CPU_CYCLES
> }
>
> I simply don't think PERF_COUNT_HW_NMI_WATCHDOG should
> ever be exposed to users.

yes, and peterz pointed it out as well, i agree of course.

>

So, you mean to put it into x86_pmu_event_init, right? How would
we know if this event comes from watchdog.c or not? And what if
user wanted to pass _exactly_ this crazy values to RAW event but
I will threat it as a sign for nmi-watchdog event and will map
it internally to P4_EVENT_EXECUTION_EVENT?

Don't get me wrong, Stephane, this approach will work and it's
not a problem (actually I think I would put -1ULL into config
since it's kinda "icorrect" and can be treated as special one)
but I think it introduce more complexity, it should not be like
this.

Gimme some time, probably I invent something more convenient.

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