Re: [PATCH] perf tools: Avoid unaligned pointer operations

From: Arnaldo Carvalho de Melo
Date: Thu Dec 12 2024 - 13:41:30 EST


On Wed, Nov 27, 2024 at 04:51:15PM -0800, Ian Rogers wrote:
> On Wed, Nov 27, 2024 at 1:26 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > The sample data is 64-bit aligned basically but raw data starts with
> > 32-bit length field and data follows. In perf_event__synthesize_sample
> > it treats the sample data as a 64-bit array. And it needs some trick
> > to update the raw data properly.

> > But it seems some compilers are not happy with this and the program dies
> > siliently. I found the sample parsing test failed without any messages
> > on affected systems.

> > Let's update the code to use a 32-bit pointer directly and make sure the
> > result is 64-bit aligned again. No functional changes intended.

> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>

> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Looks good, applied to perf-tools-next since this is something that is
not new nor looks urgent.

I think that since we have multiple maintainers, one for not urgent
stuff/development and the other for the current window/urgent stuff,
that we should express the expectation about where a patch should be
processed, by having on the subject the tree the submitter thinks should
take the patch, i.e. for this one:

[PATCH next] perf tools: Avoid unaligned pointer operations

While for urgent stuff we could do:

[PATCH urgent] perf tools: Avoid unaligned pointer operations

wdyt?

- Arnaldo