Re: [patch] Performance Counters for Linux, v3

From: Tony Luck
Date: Thu Dec 11 2008 - 14:11:21 EST


> /*
> * Special "software" counters provided by the kernel, even if
> * the hardware does not support performance counters. These
> * counters measure various physical and sw events of the
> * kernel (and allow the profiling of them as well):
> */
> PERF_COUNT_CPU_CLOCK = -1,
> PERF_COUNT_TASK_CLOCK = -2,
> /*
> * Future software events:
> */
> /* PERF_COUNT_PAGE_FAULTS = -3,
> PERF_COUNT_CONTEXT_SWITCHES = -4, */

...
> +[ Note: more hw_event_types are supported as well, but they are CPU
> + specific and are enumerated via /sys on a per CPU basis. Raw hw event
> + types can be passed in as negative numbers. For example, to count
> + "External bus cycles while bus lock signal asserted" events on Intel
> + Core CPUs, pass in a -0x4064 event type value. ]

It looks like you have an overlap here. You are using some negative numbers
to denote your special software events, but also as "raw" hardware events.
What if these conflict?

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