Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932343AbdCFP3a (ORCPT ); Mon, 6 Mar 2017 10:29:30 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:41348 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753518AbdCFP3X (ORCPT ); Mon, 6 Mar 2017 10:29:23 -0500 Date: Mon, 6 Mar 2017 16:28:56 +0100 From: Peter Zijlstra To: David Laight Cc: Madhavan Srinivasan , Wang Nan , Alexander Shishkin , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , Alexei Starovoitov , Ingo Molnar , Stephane Eranian , Sukadev Bhattiprolu , "linuxppc-dev@lists.ozlabs.org" Subject: Re: [PATCH v2 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src Message-ID: <20170306152856.GO6500@twins.programming.kicks-ass.net> References: <1488796993-25495-1-git-send-email-maddy@linux.vnet.ibm.com> <1488796993-25495-2-git-send-email-maddy@linux.vnet.ibm.com> <20170306112228.GZ6515@twins.programming.kicks-ass.net> <063D6719AE5E284EB5DD2968C1650D6DCFE78C84@AcuExch.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DCFE78C84@AcuExch.aculab.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1133 Lines: 22 On Mon, Mar 06, 2017 at 02:59:07PM +0000, David Laight wrote: > From: Peter Zijlstra > > Sent: 06 March 2017 11:22 > > To: Madhavan Srinivasan > > Cc: Wang Nan; Alexander Shishkin; linux-kernel@vger.kernel.org; Arnaldo Carvalho de Melo; Alexei > > Starovoitov; Ingo Molnar; Stephane Eranian; Sukadev Bhattiprolu; linuxppc-dev@lists.ozlabs.org > > Subject: Re: [PATCH v2 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src > > > > On Mon, Mar 06, 2017 at 04:13:08PM +0530, Madhavan Srinivasan wrote: > > > From: Sukadev Bhattiprolu > > > > > > perf_mem_data_src is an union that is initialized via the ->val field > > > and accessed via the bitmap fields. For this to work on big endian > > > platforms, we also need a big-endian represenation of perf_mem_data_src. > > > > Doesn't this break interpreting the data on a different endian machine? > > Best to avoid bitfields if you ever care about the bit order. Too late for that. But perf tool has quite a bit of code to muck fields between different endians. With the full intent that generation on one machine is readable by another.