gdbprofiler icon indicating copy to clipboard operation
gdbprofiler copied to clipboard

This tool works on windows wsl2 and macOS 12.

Open arbipher opened this issue 2 years ago • 2 comments

It is not really an issue but I want to share if people are wondering whether this tool works on other platforms other than real linux.

I test it under OCaml 4.14.0.

wsl2 (work)

For ubuntu 20.04 on windows wsl2, just follow the instructions in Readme.md.

mac + lldb (work)

For macOS 12, I build lldb-mi from the source. I follow the instructions in section Building against custom LLDB with llvm installed from homebrew:

cmake . -DLLVM_DIR=/usr/local/opt/llvm/lib/cmake/llvm
cmake --build .

Then I change the command a bit:

gdbprofiler -p `pgrep my_example_program.native` --cpuprofile example.cpuprofile --callgrind callgrind.out --use-lldb

mac + gdb (not work)

I don't figure out how to use gdb mode on mac.

I installed gdb from homebrew and followed the certificate signing suggested in the brew installation log. After doing the manual steps, I can enter the normal gdb. However, when running gdbprofiler, my program always exits immediately. I guess there may be some interrupt.

(since mac+llvm works, I don't delve into it)

arbipher avatar Jul 27 '22 21:07 arbipher

Thanks for letting me know!

I mostly prefer perf over gdbprofiler these days (see this thread), since it has much less overhead. perf should also work on wsl2, but not on Macs.

copy avatar Aug 04 '22 10:08 copy

I see! I am attempting several OCaml profiling tools recently. perf looks good to me. Thanks for sharing the link.

arbipher avatar Aug 04 '22 15:08 arbipher