lkml.org 
[lkml]   [2009]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] perfcounters: fix type/event_id layout on big-endian systems

    * Paul Mackerras <paulus@samba.org> wrote:

    > struct perf_counter_hw_event {
    > union {
    > +#ifndef __BIG_ENDIAN_BITFIELD
    > struct {
    > __u64 event_id : 56,
    > type : 8;
    > @@ -94,6 +96,16 @@ struct perf_counter_hw_event {
    > __u64 raw_event_id : 63,
    > raw_type : 1;
    > };
    > +#else
    > + struct {
    > + __u64 type : 8,
    > + event_id : 56;
    > + };
    > + struct {
    > + __u64 raw_type : 1,
    > + raw_event_id : 63;
    > + };
    > +#endif /* __BIT_ENDIAN_BITFIELD */

    hm, this ifdef really looks ugly. How about just changing event_id
    to 64 bits and having a separate u32 type field? The size impact is
    minimal, the cleanliness win is significant :-)

    Ingo


    \
     
     \ /
      Last update: 2009-03-21 10:47    [W:0.022 / U:29.760 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site