Files
linux-legacy/include/linux
Paul Mackerras 9aaa131a27 perf_counter: fix type/event_id layout on big-endian systems
Impact: build fix for powerpc

Commit db3a944aca35ae61 ("perf_counter: revamp syscall input ABI")
expanded the hw_event.type field into a union of structs containing
bitfields.  In particular it introduced a type field and a raw_type
field, with the intention that the 1-bit raw_type field should
overlay the most-significant bit of the 8-bit type field, and in fact
perf_counter_alloc() now assumes that (or at least, assumes that
raw_type doesn't overlay any of the bits that are 1 in the values of
PERF_TYPE_{HARDWARE,SOFTWARE,TRACEPOINT}).

Unfortunately this is not true on big-endian systems such as PowerPC,
where bitfields are laid out from left to right, i.e. from most
significant bit to least significant.  This means that setting
hw_event.type = PERF_TYPE_SOFTWARE will set hw_event.raw_type to 1.

This fixes it by making the layout depend on whether or not
__BIG_ENDIAN_BITFIELD is defined.  It's a bit ugly, but that's what
we get for using bitfields in a user/kernel ABI.

Also, that commit didn't fix up some places in arch/powerpc/kernel/
perf_counter.c where hw_event.raw and hw_event.event_id were used.
This fixes them too.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-06 09:30:18 +02:00
..
…
…
…
…
2009-04-05 00:32:22 +02:00
2009-03-18 19:45:11 -07:00
2009-03-31 09:56:26 +01:00
…
…
…
2009-03-05 14:39:32 -05:00
…
…
…
2009-04-05 02:14:15 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-04-01 08:59:23 -07:00
2009-04-01 08:59:23 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-04-03 14:53:32 -07:00
…
…
…
…
…
…
…
…
…
…
…
2009-03-27 14:43:59 -04:00
2009-03-01 00:19:35 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
2009-04-03 14:53:32 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
2009-03-16 08:32:27 -06:00
…
…
…
…
2009-04-01 08:59:29 -07:00
…
…
…
…
…
…
…
2009-02-18 15:37:56 -08:00
…
…
…
…
…
2009-03-24 12:35:17 +01:00
…
…
…
…
…
2009-03-30 15:14:53 +02:00
…
…
2009-04-03 09:48:29 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-03-31 20:15:33 +02:00
2009-04-02 19:04:53 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-03-13 14:32:29 +01:00
…
…
…
…
…
…
…
…
…
2009-04-02 19:04:49 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-03-30 15:21:59 +02:00
…
…
…
…
…
…
…
…
2009-04-01 08:59:17 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-04-02 19:04:48 -07:00
…
…
…
2009-03-26 10:56:35 -07:00
…
…
…
2009-03-20 10:48:14 -07:00
…
…
…
…
…
…
…
2009-03-15 19:59:13 -07:00
…
…
…
…
2009-04-01 13:28:15 -04:00
…
2009-03-10 20:33:18 -04:00
…
…
…
…
…
…
…
…
…
…
…
2009-04-01 08:59:13 -07:00
2009-04-01 08:59:13 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2009-04-01 08:59:13 -07:00
…
…
2009-03-13 16:09:12 -07:00
…
…
…
2009-03-30 15:22:01 +02:00
…
2009-03-26 02:18:35 +01:00
…
…
…
…
…
2009-02-26 23:42:11 -08:00
…
…
2009-03-30 14:28:58 -07:00
…
…
…
…
…
…
…
…
…
2009-04-01 08:59:24 -07:00
…
…
…
…
…
2009-02-16 00:03:10 -08:00
…
…
…
…
…
…
…
…
…
2009-02-27 16:53:50 +09:00
…
…
2009-02-20 17:57:48 -08:00
2009-04-03 16:42:35 +01:00
…
…
…
…
…
…
…
…
…
2009-03-27 12:18:56 -04:00
…
…
…
…
…
…
…
…
…
2009-04-01 08:59:15 -07:00
…
…
2009-04-02 19:05:01 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
2009-02-18 15:37:53 -08:00
…
…
…
…
…
2009-03-26 18:14:21 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…