Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp820334pxb; Thu, 9 Sep 2021 12:51:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQbg1Al3Dfonk2n0RfIHH0+AbpTHyMw0LGgZVrh/HthFnAicm03Sfk1IzM2EkLZ0DTZ2mY X-Received: by 2002:a17:906:d789:: with SMTP id pj9mr5123324ejb.134.1631217080751; Thu, 09 Sep 2021 12:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631217080; cv=none; d=google.com; s=arc-20160816; b=p3oFOP2obzkqgBsSE0UVyVoBof/9QmlgYXhWowN7s5/vNPaxvX1GTLDyXdthPLIzz2 F9yOUQ+NxksQPJHYK8hIbEkyusybFPU+t9JMcLrl54kUdRQ1rodBwqFRLXgJx4d4MJJ5 2NorJUrs64+4kh7jo/KGVnb3a1pP6+qbzQR7odsw+Uk06BQzJviOIAAoBbzbFYUv7Git nH9+XI9TkM04Gly1TCOic/86UHdYoyq89CUlmISCxHCSJNwHahRBecwZeDP0r5dVe/Os ap6/kwTpgDUUShfJgKMhx1GokMbU/OVfbNXcNNCmGsSU+BaPFLb2t2VmTYr2E3mmlN1Q q89Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OB/ri+5nMc+/kwsdyuBrXNBolEn6RKdR9eJ2jCAvTgU=; b=vHVsPJpfeK2EZadH4POfGRZH+R5ZWfLzZRpw0zeiH79/0CiolzcacFq+QubNIUvsSc Y7rzzsZJ/8Pk+TImMkkFzL+/ETGOJ6tAM4Dxvv6ytu/QUIxe9Q+Dx/C6Aht1OxQqXqUk oc+Y/HE6EMEuoOPKMAoXTYUly9xRfBUEIN6KfFaEM7i7Xcbin8RQbPbH+WzvmuJQHi0S v5keuzE/OoADiJsk39WnzefQVUqtXmNE8SmmZyab7jjCRocE3NhFCjEFQISiOYTb6ku6 yBigP5Bqm2oMkx/H0Y9piFriJ4gqyvkrCpen7jcEAsQNkfbEpd12pqKCja7jqW9MlPtf z2Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=D61iquw0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si2666057edv.508.2021.09.09.12.50.56; Thu, 09 Sep 2021 12:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=D61iquw0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237363AbhIITFT (ORCPT + 99 others); Thu, 9 Sep 2021 15:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbhIITFS (ORCPT ); Thu, 9 Sep 2021 15:05:18 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD4D8C061574 for ; Thu, 9 Sep 2021 12:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OB/ri+5nMc+/kwsdyuBrXNBolEn6RKdR9eJ2jCAvTgU=; b=D61iquw0nDX4HMNsroySTwxs48 bZ3M7u0ECkMl8rVYe/CWvrRN2BszuxAik9NjvvvlBMC698QepqzoAYNTyQlv3sO9Cy5bQQ4mgC3ny AKcCQfZUQbJxUjEawOZK6yCuX/vbtSfbxfJYP5AM4l1e8wHGRdpDJaSNRl0dERv3pVHKze6VyquYE jLo6kv+gUfMoqsuZxxRjAu+rowqEeM39hp1I9Rt4T49HpfhxZltr0vXrynin6GlaLAYgiUKdVb9K6 v9rKBCsksb0u3dbaUvjWcRv0R+n39jUMqZL64sJsvt1a3DmfCNhAIlAniiIILToEabkdwcPUzKbig 4E7MfwWA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOPKr-001vzK-CN; Thu, 09 Sep 2021 19:03:45 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 740BE98627A; Thu, 9 Sep 2021 21:03:42 +0200 (CEST) Date: Thu, 9 Sep 2021 21:03:42 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, acme@redhat.com, jolsa@redhat.com, kim.phillips@amd.com, namhyung@kernel.org, irogers@google.com, atrajeev@linux.vnet.ibm.com, maddy@linux.ibm.com, mpe@ellerman.id.au Subject: Re: [PATCH v1 01/13] perf/core: add union to struct perf_branch_entry Message-ID: <20210909190342.GE4323@worktop.programming.kicks-ass.net> References: <20210909075700.4025355-1-eranian@google.com> <20210909075700.4025355-2-eranian@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210909075700.4025355-2-eranian@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 09, 2021 at 12:56:48AM -0700, Stephane Eranian wrote: > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h > index f92880a15645..eb11f383f4be 100644 > --- a/include/uapi/linux/perf_event.h > +++ b/include/uapi/linux/perf_event.h > @@ -1329,13 +1329,18 @@ union perf_mem_data_src { > struct perf_branch_entry { > __u64 from; > __u64 to; > - __u64 mispred:1, /* target mispredicted */ > - predicted:1,/* target predicted */ > - in_tx:1, /* in transaction */ > - abort:1, /* transaction abort */ > - cycles:16, /* cycle count to last branch */ > - type:4, /* branch type */ > - reserved:40; > + union { > + __u64 val; /* to make it easier to clear all fields */ > + struct { > + __u64 mispred:1, /* target mispredicted */ > + predicted:1,/* target predicted */ > + in_tx:1, /* in transaction */ > + abort:1, /* transaction abort */ > + cycles:16, /* cycle count to last branch */ > + type:4, /* branch type */ > + reserved:40; > + }; > + }; > }; Hurpmh... all other bitfields have ENDIAN_BITFIELD things except this one. Power folks, could you please have a look?