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

Add a mode to automatically capture a trace and exit #258

Closed
knrafto opened this issue Sep 8, 2022 · 3 comments
Closed

Add a mode to automatically capture a trace and exit #258

knrafto opened this issue Sep 8, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@knrafto
Copy link

knrafto commented Sep 8, 2022

We have a script to automatically run magic-trace during tests. Right now we have to start magic-trace, wait for some amount of time, and then send SIGINT to magic-trace using pkill. Unfortunately, the time we need to wait is not predictable (it could be 5s or more for large binaries) so this occasionally sends SIGINT too early. If would be nice if we could tell magic-trace to take a snapshot and exit when it's done.

I tried to implement this myself but I couldn't find a good way to know when perf is "ready". It looks like magic-trace itself has a hardcoded 500ms timeout, which is definitely not long enough for our binaries. Do you have any ideas?

@knrafto knrafto added the bug Something isn't working label Sep 8, 2022
@knrafto
Copy link
Author

knrafto commented Sep 8, 2022

(sorry, this is a feature request, not a bug report, but I don't see how to change the labels now)

@Xyene
Copy link
Member

Xyene commented Sep 8, 2022

I think #230 should address this. You could write magic-trace attach -p [your process' pid] -- true and that would do the right thing.

@knrafto
Copy link
Author

knrafto commented Sep 8, 2022

Interesting, thanks! Closing to dedup

@knrafto knrafto closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants