lkml.org 
[lkml]   [2017]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src
Date
Madhavan Srinivasan <maddy@linux.vnet.ibm.com> writes:
> On Wednesday 19 April 2017 10:20 AM, Michael Ellerman wrote:
>> It also occurred to me that we don't actually have to redefine the whole
>> union, it's only the bitfields that matter, so we could reduce the diff
>> to:
>>
>> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
>> index c66a485a24ac..97152c79df6b 100644
>> --- a/include/uapi/linux/perf_event.h
>> +++ b/include/uapi/linux/perf_event.h
>> @@ -894,12 +894,23 @@ enum perf_callchain_context {
>> union perf_mem_data_src {
>> __u64 val;
>> struct {
>> +#if defined(__LITTLE_ENDIAN_BITFIELD)
>> __u64 mem_op:5, /* type of opcode */
>> mem_lvl:14, /* memory hierarchy level */
>> mem_snoop:5, /* snoop mode */
>> mem_lock:2, /* lock instr */
>> mem_dtlb:7, /* tlb access */
>> mem_rsvd:31;
>> +#elif defined(__BIG_ENDIAN_BITFIELD)
>> + __u64 mem_rsvd:31,
>> + mem_dtlb:7, /* tlb access */
>> + mem_lock:2, /* lock instr */
>> + mem_snoop:5, /* snoop mode */
>> + mem_lvl:14, /* memory hierarchy level */
>> + mem_op:5; /* type of opcode */
>> +#else
>> +#error "Unknown endianness"
>> +#endif
>> };
>> };
>>
>>
>> That looks better to me, thoughts?
>
> Yep. Looks fine to me and also tested the same.

I merged the original version, as that's what Peterz acked and I didn't
want to block the series any longer.

I'll send an incremental patch to do the cleanup.

cheers

\
 
 \ /
  Last update: 2017-04-20 00:17    [W:0.058 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site