From: Eric Biggers <ebiggers@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
linux-perf-users@vger.kernel.org,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Fangrui Song <maskray@sourceware.org>,
Pablo Galindo <pablogsal@gmail.com>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH] perf genelf: Switch from SHA-1 to BLAKE2s for build ID generation
Date: Mon, 8 Dec 2025 17:19:16 -0800 [thread overview]
Message-ID: <20251209011916.GA1619@sol> (raw)
In-Reply-To: <CAP-5=fWaOTh6h-xP5y2SBG7Xe03jG0zTawkrT2kbc-GyhBG_oA@mail.gmail.com>
On Fri, Dec 05, 2025 at 10:53:38AM -0800, Ian Rogers wrote:
> > static struct buildid_note {
> > Elf_Note desc; /* descsz: size of build-id, must be multiple of 4 */
> > char name[4]; /* GNU\0 */
> > - u8 build_id[SHA1_DIGEST_SIZE];
> > + u8 build_id[20];
>
> nit: Could we add a comment on where the value of 20 is coming from?
> We could use something like: sizeof(((struct
> perf_record_header_build_id*)0)->data). But a comment is enough imo.
>
> Tested-by: Ian Rogers <irogers@google.com>
>
> Thanks,
> Ian
It was already a literal 20 before "perf genelf: Remove libcrypto
dependency and use built-in sha1()". So this change just restores the
previous literal 20.
This entire struct, not just the build ID field, appears to be an
external data format. If you'd like to add a comment that describes
where this external data format is defined, presumably either the ELF
specification or binutils, that would be helpful. But it seems outside
the scope of this change.
(I did put the literal 20 in the BLAKE2s test as well. I'll put a
comment there that mentions that it matches the length used in the
non-test code.)
- Eric
next prev parent reply other threads:[~2025-12-09 1:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-05 4:31 [PATCH] perf genelf: Switch from SHA-1 to BLAKE2s for build ID generation Eric Biggers
2025-12-05 4:39 ` Eric Biggers
2025-12-05 18:53 ` Ian Rogers
2025-12-09 1:19 ` Eric Biggers [this message]
2025-12-05 21:23 ` Namhyung Kim
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=20251209011916.GA1619@sol \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maskray@sourceware.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=pablogsal@gmail.com \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).