Skip to content
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

Capture native stack in Pf2c #47

Merged
merged 2 commits into from
Mar 2, 2025
Merged

Capture native stack in Pf2c #47

merged 2 commits into from
Mar 2, 2025

Conversation

osyoyu
Copy link
Owner

@osyoyu osyoyu commented Mar 2, 2025

Capture native stack frames (the current PC to be more specific) when the sample capture process runs.

This implementation uses libbacktrace as its backend, which is the same as the Rust implementation.

There should be no problems calling backtrace_simple() in the signal handler as it is marked as async-signal-safe. The first 2 frames will be skipped (not included in the capture) since they will always be capture_native_backtrace() and sigprof_handler().

osyoyu added 2 commits March 2, 2025 01:59
Capture native stack frames (the current PC to be more specific) when
the sample capture process runs.

This implementation uses libbacktrace as its backend, which is the same
as the Rust implementation.

There should be no problems calling backtrace_simple() in the signal
handler as it is marked as async-signal-safe. The first 2 frames will be
skipped (not included in the capture) since they will always be
capture_native_backtrace() and sigprof_handler().
Main functionaility ported from Ser2 in the Rust implementation.
@osyoyu osyoyu merged commit 2dccb04 into main Mar 2, 2025
6 of 12 checks passed
@osyoyu osyoyu deleted the pf2c-native branch March 8, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant