[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fXAhYGmBpnCZ_YkePAD5hOpiKoXZ8agHWPi_wHyzjWyTg@mail.gmail.com>
Date: Fri, 13 Dec 2024 12:57:56 -0800
From: Ian Rogers <irogers@...gle.com>
To: "Liang, Kan" <kan.liang@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>, Arnaldo Carvalho de Melo <acme@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v2] perf tools: Avoid unaligned pointer operations
On Thu, Nov 28, 2024 at 6:59 AM Liang, Kan <kan.liang@...ux.intel.com> wrote:
>
> On 2024-11-27 8:03 p.m., Namhyung Kim 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.
> >
> > Reviewed-by: Ian Rogers <irogers@...gle.com>
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
>
> Reviewed-by: Kan Liang <kan.liang@...ux.intel.com>
nit: The commit message subject is somewhat generic. Perhaps "perf
synthetic-events: Avoid unaligned accesses for raw samples".
Thanks,
Ian
Powered by blists - more mailing lists