[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241216232459.427642-1-irogers@google.com>
Date: Mon, 16 Dec 2024 15:24:54 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>, Sun Haiyong <sunhaiyong@...ngson.cn>,
Yanteng Si <siyanteng@...ngson.cn>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v3 0/5] perf file align features, avoid UB
Features like hostname may not be 8-byte aligned. Add padding to make
the feature aligned to avoid undefined behavior (UB). Modify the
writing of the CPU topology features to always write die_cpus_list
even if empty, as the size could have been aligned and not allow the
missing list to be detected. As die_id may be invalid (< 0) ensure it
isn't for platforms like ARM. Avoid UB also in machine where a NULL
may be incremented.
v3: Additional patch to avoid invalid die_ids
v2: Fix CPU topology as described in replies to v1.
v1: https://lore.kernel.org/lkml/20241212080530.1329601-1-irogers@google.com/
Ian Rogers (5):
perf cpumap: If the die_id is missing use socket/physical_package_id
perf header: Write out even empty die_cpus_list
perf synthetic-events: Ensure features are aligned
perf machine: Avoid UB by delaying computing branch entries
perf record: Assert synthesized events are 8-byte aligned
tools/perf/builtin-record.c | 5 ++++-
tools/perf/util/cpumap.c | 3 ++-
tools/perf/util/header.c | 10 ++++------
tools/perf/util/machine.c | 2 +-
tools/perf/util/synthetic-events.c | 2 ++
5 files changed, 13 insertions(+), 9 deletions(-)
--
2.47.1.613.gc27f4b7a9f-goog
Powered by blists - more mailing lists