From: Dapeng Mi <dapeng1.mi@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Zide Chen <zide.chen@intel.com>,
Falcon Thomas <thomas.falcon@intel.com>,
Dapeng Mi <dapeng1.mi@intel.com>,
Xudong Hao <xudong.hao@intel.com>,
Dapeng Mi <dapeng1.mi@linux.intel.com>
Subject: [Patch v9 02/10] perf util: Add missed fields in _attr__fprintf() and __attr_swap()
Date: Mon, 6 Jul 2026 10:34:36 +0800 [thread overview]
Message-ID: <20260706023444.3067660-3-dapeng1.mi@linux.intel.com> (raw)
In-Reply-To: <20260706023444.3067660-1-dapeng1.mi@linux.intel.com>
Some new introduced perf_event_attr fields, like config3 and config4,
are forgotten to add into perf_event_attr__fprintf() and
perf_event__attr_swap() helpers. Add these missed fields into these 2
helpers.
The aux_action is an exception. aux_action aliases bitfields
(e.g. aux_start_paused) in a union. Bitfields and plain u32 fields
follow different endian rules, so both views cannot be swapped
correctly at the same time. Leave aux_action unswapped until the ABI
is represented in a byte-order-safe form.
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
---
tools/perf/util/perf_event_attr_fprintf.c | 4 ++++
tools/perf/util/session.c | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/tools/perf/util/perf_event_attr_fprintf.c b/tools/perf/util/perf_event_attr_fprintf.c
index 3933639d76c5..cc817294ad3d 100644
--- a/tools/perf/util/perf_event_attr_fprintf.c
+++ b/tools/perf/util/perf_event_attr_fprintf.c
@@ -405,6 +405,10 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
PRINT_ATTRf_bf(aux_pause, p_unsigned);
PRINT_ATTRf_bf(aux_resume, p_unsigned);
}
+ if (attr_size >= offsetof(struct perf_event_attr, config4))
+ PRINT_ATTRf(config3, p_hex);
+ if (attr_size > offsetof(struct perf_event_attr, config4))
+ PRINT_ATTRf(config4, p_hex);
return ret;
}
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 3237870a1a34..212506aa8baa 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -629,6 +629,16 @@ do { \
bswap_field_32(aux_watermark);
bswap_field_16(sample_max_stack);
bswap_field_32(aux_sample_size);
+ /*
+ * aux_action aliases bitfields (e.g. aux_start_paused) in a union.
+ * Bitfields and plain u32 fields follow different endian rules, so
+ * both views cannot be swapped correctly at the same time.
+ * Leave aux_action unswapped until the ABI is represented in a
+ * byte-order-safe form.
+ */
+ bswap_field_64(sig_data);
+ bswap_field_64(config3);
+ bswap_field_64(config4);
/*
* After read_format are bitfields. Check read_format because
--
2.34.1
next prev parent reply other threads:[~2026-07-06 2:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 2:34 [Patch v9 00/10] Perf tools: Support eGPRs/SSP/SIMD registers sampling Dapeng Mi
2026-07-06 2:34 ` [Patch v9 01/10] perf dwarf-regs: Fix DWARF register index bounds check Dapeng Mi
2026-07-06 2:34 ` Dapeng Mi [this message]
2026-07-06 2:34 ` [Patch v9 03/10] tools headers: Sync x86 headers with kernel sources Dapeng Mi
2026-07-06 2:54 ` sashiko-bot
2026-07-08 2:05 ` Mi, Dapeng
2026-07-06 2:34 ` [Patch v9 04/10] perf headers: Sync perf_event.h/perf_regs.h with the kernel headers Dapeng Mi
2026-07-06 2:34 ` [Patch v9 05/10] perf regs: Support x86 eGPRs/SSP sampling Dapeng Mi
2026-07-06 2:59 ` sashiko-bot
2026-07-08 2:15 ` Mi, Dapeng
2026-07-06 2:34 ` [Patch v9 06/10] perf regs: Support x86 SIMD registers sampling Dapeng Mi
2026-07-06 2:34 ` [Patch v9 07/10] perf regs: Enable dumping of SIMD registers Dapeng Mi
2026-07-06 2:55 ` sashiko-bot
2026-07-08 2:21 ` Mi, Dapeng
2026-07-06 2:34 ` [Patch v9 08/10] perf dwarf-regs: Add SIMD/eGPRs support for x86 DWARF registers Dapeng Mi
2026-07-06 2:34 ` [Patch v9 09/10] perf tests: Add x86 eGPRs/SSP registers sampling test Dapeng Mi
2026-07-06 3:00 ` sashiko-bot
2026-07-08 2:30 ` Mi, Dapeng
2026-07-06 2:34 ` [Patch v9 10/10] perf tests: Add SIMD " Dapeng Mi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260706023444.3067660-3-dapeng1.mi@linux.intel.com \
--to=dapeng1.mi@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dapeng1.mi@intel.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=thomas.falcon@intel.com \
--cc=xudong.hao@intel.com \
--cc=zide.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.