-
Notifications
You must be signed in to change notification settings - Fork 108
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
Windows support #9
Comments
We cannot use For compiling and using this lib in windows, I will remove the usage of thread name (when it is used in windows). I know little about windows programming. Do you have any suggestion on how to identify threads on windows? Do it have thread name or something similar? |
This has been done in #15 . Can you help me test on windows? |
Awesome. I may not be able to test for a while (moved off of Rust project for a bit), but will try to soon... |
@cretz Sorry, it still cannot work on windows, because we use |
Hello, I can help with testing (and maybe development) on Windows and interested in decent rust profiler :)
Let me know if I can help. |
So, I did a little research and looks like it isn't that easy, but doable. Gonna leave it here so I won't forget or someone has more time than me. |
@LK4D4 Cool! Thanks for your research 🍻 . It's a good start for someone (like me) to consider about the implementation on windows 😺 . |
Before we can get it work on Windows, is it possible to at least compile on Windows? I received report that my tests doesn't compile on Windows because I use pprof in my benchmark code. |
FWIW I think compilation on windows should be easy, I actually got it to compile, but not working. |
@sunng87 I don't think "compile but not work" is a good choice. You could use conditional compilation and platform specific dependencies to avoid pprof-rs on windows target. |
@YangKeao Thank you! That's better solution. |
Bump. Though I don't know if the backtrace is correct. The following code generates the following backtrace on windows 11 build 22489.1000
I haven't bothered with naming the threads, so the name is just their id. 43dc is the main thread. The worker thread filters itself away, so it's not shown. |
@Jardynq Could you send a PR for us to try? |
Sorry for the late reply. Got a throat infection that knocked me out. After tidying up the code for a PR, i encountered some bugs that made me experiment with a few other methods: SetWaitableTimer QueueUserAPC QueueUserAPC2 Manually: SuspendThread, GetThreadContext, ResumeThread From my testing it seems that the manual method is the best and most consistent. |
I opened a pull request for backtrace-rs. This should make it possible to rework #122. |
support this initiative as well. having win support would be great! at the bare minimum to be able to compile at least... which is super useful for a cross-platform development |
See rust-lang/backtrace-rs#473 |
@aminya I think the correct solution is to fork backtrace-rs. Luckily, it isn't updated often and the changes we need are so minor, that should be able to keep the fork up to date with upstream without any merge conflicts. |
I think so. The You'll also need to give the forked |
Yeah, I think forking is a better solution than copy-pasting code. I can call the fork something like @Jardynq I will merge the changes into my branch and publish it. I made some changes to your original fork as it was not ready for a PR and had some issues. |
also support a forking solution 👍 |
Disabled on windows, see tikv/pprof-rs#9
pprof doesn't work on Windows. It's disabled in most of the Lance libraries, except for two: lance-index and lance-io. This PR disables it for those two in the same manner. See also tikv/pprof-rs#9
pprof doesn't work on Windows. It's disabled in most of the Lance libraries, except for two: lance-index and lance-io. This PR disables it for those two in the same manner. See also tikv/pprof-rs#9 Co-authored-by: Lei Xu <[email protected]>
Just tossing this issue out here for others that may reach this lib. Build fails since
pthread_self
andpthread_getname_np
are, predictably, not present. Canstd::thread::current
andstd::thread::Thread.name
be used instead? Would it even matter with how signals work here?The text was updated successfully, but these errors were encountered: