Skip to content

BPF: hotspot: add limited heuristic for x86-64 epilogue #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 29, 2024

Conversation

fabled
Copy link
Contributor

@fabled fabled commented Aug 27, 2024

Add a simple heuristic for x86-64 epilogue checking that should be able to not produce too many false positives and yet catch the most probable asynchronous stop points where the CPU perf might fire.

Also ensure that epilogue parsing is attempted only on the top frames to further reduce likelyness of false positives and reduce ebpf code size.

fixes #136

@fabled fabled added the enhancement New feature or request label Aug 27, 2024
@fabled fabled self-assigned this Aug 27, 2024
Copy link

linux-foundation-easycla bot commented Aug 27, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Add a simple heuristic for x86-64 epilogue checking that should
be able to not produce too many false positives and yet catch
the most probable asynchronous stop points where the CPU perf
might fire.

Also ensure that epilogue parsing is attempted only on the top
frames to further reduce likelyness of false positives and reduce
ebpf code size.

fixes open-telemetry#136
fabled added 5 commits August 27, 2024 11:25
The maximum distance from 'popq %rbp' to 'retq' seems to be 12 bytes,
and we need at least one byte before rip.

Report the used epilogue method in debug messages
@fabled fabled marked this pull request as ready for review August 27, 2024 14:19
@fabled fabled requested review from a team August 27, 2024 14:19
Copy link
Member

@athre0z athre0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ARM64 coredump tests all still passing (I'm assuming that you checked X86 -- don't have a machine at hand).

Copy link
Contributor

@florianl florianl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine here and also tested with the x86 coredumps 👍

@fabled fabled merged commit 954a859 into open-telemetry:main Aug 29, 2024
22 checks passed
florianl pushed a commit to florianl/opentelemetry-ebpf-profiler that referenced this pull request Aug 30, 2024
…ry#138)

Add a simple heuristic for x86-64 epilogue checking that should be able to not produce too many false positives and yet catch the most probable asynchronous stop points where the CPU perf might fire.

Also ensure that epilogue parsing is attempted only on the top frames to further reduce likelyness of false positives and reduce ebpf code size.

fixes open-telemetry#136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hotspot unwind error, metricID_UnwindHotspotErrInvalidRA value is increasing
3 participants