Re: [PATCH v1 01/13] perf/core: add union to struct perf_branch_entry
From: Peter Zijlstra
Date: Thu Sep 09 2021 - 15:04:12 EST
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?