Skip to content

ELF binary doesn't ship with build id, making it unusable with Linux perf #4223

@caizixian

Description

@caizixian

Please provide a brief summary of the bug

sudo perf probe --verbose -x /usr/lib/jvm/temurin-21-jdk-amd64/lib/server/libjvm.so --add sdt_hotspot:gc__begin
probe-definition(0): sdt_hotspot:gc__begin
0 arguments
Failed to get build-id from /usr/lib/jvm/temurin-21-jdk-amd64/lib/server/libjvm.so.
Cache open error: -1
  Error: Failed to add events. Reason: No such file or directory (Code: -2)

Adding perf probe is necessary to use Linux perf record to capture SDT events.

Did you test with the latest update version?

  • Yes

Please provide steps to reproduce where possible

No response

Expected Results

perf probe adds the SDT probes.

Actual Results

perf probe exits because build-id cannot be found in the ELF file

What Java Version are you using?

openjdk 21.0.5 2024-10-15 LTS OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11-LTS, mixed mode, sharing)

What is your operating system and platform?

Ubuntu 22.04 LTS

How did you install Java?

apt

Did it work before?

Did you test with other Java versions?

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues that are problems in the code as reported by the communitytestingIssues that enhance or fix our test suites

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions