[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABg4E-nOWV-xyrXHy0i9Yf1iEaM4cH6esLnbVHRXnK-85TMUtw@mail.gmail.com>
Date: Mon, 13 Jan 2025 11:26:56 -0500
From: Tavian Barnes <tavianator@...ianator.com>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: linux-perf-users@...r.kernel.org, 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>, "Liang, Kan" <kan.liang@...ux.intel.com>,
Andrew Kreimer <algonell@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf intel-pt: don't zero the whole perf_sample
On Mon, Jan 13, 2025 at 3:15 AM Adrian Hunter <adrian.hunter@...el.com> wrote:
> On 11/01/25 19:56, Tavian Barnes wrote:
> > C designated initializers like
> >
> > struct perf_sample sample = { .ip = 0, };
> >
> > set every unmentioned field of the struct to zero. But since
> > sizeof(struct perf_sample) == 1384, this takes a long time.
> >
> > struct perf_sample does not need to be fully initialized, and even
>
> Yes it does need to be fully initialized. Leaving members
> uninitialized in the hope that they never get used adds to
> code complexity e.g. how do you know they never are used,
> or future members never will be used.
Right, please ignore this patch then. I thought I had seen other
cases where perf_sample was not fully initialized but I wasn't reading
the code carefully enough. Sorry for the noise!
Powered by blists - more mailing lists