Re: [patch] Performance Counters for Linux, v3

Peter Zijlstra
2008-12-12T08:29:57Z

On Thu, 2008-12-11 at 20:34 +0100, Ingo Molnar wrote:

> struct perf_counter_hw_event {
> s64 type;
>
> u64 irq_period;
> u32 record_type;
>
> u32 disabled : 1, /* off by default */
> nmi : 1, /* NMI sampling */
> raw : 1, /* raw event type */
> __reserved_1 : 29;
>
> u64 __reserved_2;
> };
>
> if the hw_event.raw bit is set to 1, then the hw_event.type is fully
> 'raw'. The default is for raw to be 0. So negative numbers can be used
> for sw events, positive numbers for hw events. Both can be extended
> gradually, without arbitrarily limits introduced.

On that, I still don't think its a good idea to use bitfields in an ABI.
The C std is just not strict enough on them, and I guess that is the
reason this would be the first such usage.