Re: [PATCH 2/3] perf_counter: allow arch to supply event misc flags and instruction pointer

Peter Zijlstra
2009-05-14T09:52:04Z

On Thu, 2009-05-14 at 19:47 +1000, Paul Mackerras wrote:
> Peter Zijlstra writes:
>
> > On Thu, 2009-05-14 at 13:29 +1000, Paul Mackerras wrote:
>
> > > #define PERF_EVENT_MISC_KERNEL (1 << 0)
> > > #define PERF_EVENT_MISC_USER (1 << 1)
> > > #define PERF_EVENT_MISC_OVERFLOW (1 << 2)
> > > +#define PERF_EVENT_MISC_HYPERVISOR (1 << 3)
> >
> > Ah, I think I've taught userspace that either !USER && !KERNEL or USER
> > && KERNEL is HV information, since neither really makes sense :-)
>
> OK, should we do something like this?
>
> #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0)
> #define PERF_EVENT_MISC_CPUMODE_UNKNOWN (0 << 0)
> #define PERF_EVENT_MISC_USER (1 << 0)
> #define PERF_EVENT_MISC_KERNEL (2 << 0)
> #define PERF_EVENT_MISC_HYPERVISOR (3 << 0)

Yep, that reads nicer :-)