Skip to content

Add optional unwind dependency to py-spy to enable native tracing #227

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HackToHell
Copy link

Since benfred/py-spy#768 unwind became optional, unfortunately without this, native=True flag doesn't really work.

The commit is synced into grafana/py-spy as well.

@HackToHell HackToHell requested review from a team as code owners July 23, 2025 20:06
@CLAassistant
Copy link

CLAassistant commented Jul 23, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Gowtham Sundara seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@korniltsev
Copy link
Collaborator

The unwind feature has been disabled and removed from pyroscope-rs to "reduce maintenance surface".

@korniltsev
Copy link
Collaborator

grafana/py-spy@20ecc5b

@HackToHell
Copy link
Author

@korniltsev What would be the recommended alternative? Should I use the alloy ebpf tracer

@korniltsev
Copy link
Collaborator

Can you share what is your use case? What type of app do you have to profile? How do stack traces look if obtained from py-spy?

You may try alloy's pyroscope.ebpf profiler or opentelemetry-ebpf-profiler and see if it satisfies your needs

@HackToHell
Copy link
Author

Can you share what is your use case? What type of app do you have to profile? How do stack traces look if obtained from py-spy?

I am running it on ML pipelines, they have a dataloader written in CPP which is loaded with pybind11. I tried using pyroscope.ebpf with alloy main, but it dooesn't seem to load native traces either ( I suspect, it detects python process and discards anything else).

Sample from a version with native switched on with py bind - A demo I used for testing
image

@korniltsev
Copy link
Collaborator

Yes, this is perfectly valid use case. We need either bring back libunwind ( :( ) or have native unwinding in rust.

@korniltsev
Copy link
Collaborator

korniltsev commented Jul 30, 2025

@HackToHell would you like to continue work on this and revert my changes that removed libunwind? Or would you prefer me to do this?
I think removing libunwind was a mistake. And short term we should return it. Long term we better have rust written native unwinder, but that will take forever to implement

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.

3 participants