]> Gentwo Git Trees - linux/.git/commit
perf jitdump: Add sym/str-tables to build-ID generation
authorNamhyung Kim <namhyung@kernel.org>
Tue, 25 Nov 2025 08:07:46 +0000 (00:07 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 3 Dec 2025 00:06:57 +0000 (16:06 -0800)
commit25d498e636d1f8d138d65246cfb5b1fc3069ca56
treeb7d7b1c489e9f77f8c625b2baa60b50dd0f5ca19
parent44f6b44027910eb9e6e6a67840f818038946e24f
perf jitdump: Add sym/str-tables to build-ID generation

It was reported that python backtrace with JIT dump was broken after the
change to built-in SHA-1 implementation.  It seems python generates the
same JIT code for each function.  They will become separate DSOs but the
contents are the same.  Only difference is in the symbol name.

But this caused a problem that every JIT'ed DSOs will have the same
build-ID which makes perf confused.  And it resulted in no python
symbols (from JIT) in the output.

Looking back at the original code before the conversion, it used the
load_addr as well as the code section to distinguish each DSO.  But it'd
be better to use contents of symtab and strtab instead as it aligns with
some linker behaviors.

This patch adds a buffer to save all the contents in a single place for
SHA-1 calculation.  Probably we need to add sha1_update() or similar to
update the existing hash value with different contents and use it here.
But it's out of scope for this change and I'd like something that can be
backported to the stable trees easily.

Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Pablo Galindo <pablogsal@gmail.com>
Cc: Fangrui Song <maskray@sourceware.org>
Link: https://github.com/python/cpython/issues/139544
Fixes: e3f612c1d8f3945b ("perf genelf: Remove libcrypto dependency and use built-in sha1()")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/genelf.c