wzprof
wzprof copied to clipboard
WebAssembly Profiler based on Wazero
Now that Python 3.12 is out, we should check whether the current approach still works. It may require https://github.com/stealthrocket/wzprof/issues/97 to adjust modified field offsets, if any.
Currently, field offsets in structs are hardcoded: https://github.com/stealthrocket/wzprof/blob/ba3fa22d8ada53862bf029d023b7213bbcecc07c/python.go#L113-L153 They have been generated by adding the following C code inside CPython's 3.11 `Python/sysmodule.c`: ```c void print_offsets(void) __attribute__((constructor)) { printf("// --- start...
The Python3.11 support captures the interpreter call stack. It would be great also to capture the C call stack and merge it with the interpreter's stack when it calls a...
As of https://github.com/stealthrocket/wzprof/pull/95, symbolization is performed at stack capture time, which needs to be as fast as possible. It should be deferred to profile generation time. The main issue is...
In addition to reporting line information, we should be able to also column information. The `lineForFrame` function can probably be extended to also decode the column information from the location...
I can compile this with `zig cc --target=wasm32-wasi -o math.wasm math.c`, and run it with `wzprof -sample 1 -memprofile /tmp/profile math.wasm` and end up an image like this on `go...
Running `make` in the root directory yield this on my ubuntu machine: ``` # # Install the startup files (crt1.o etc). # mkdir -p "/home/thomas/src/github.com/stealthrocket/wzprof/testdata/.wasi-libc/sysroot/lib/wasm32-wasi" && \ cp build/wasm32-wasi/libc-bottom-half/crt/crt1.o build/wasm32-wasi/libc-bottom-half/crt/crt1-command.o...
A common mistake is to forget to call `Profiling.Prepare` on the compile module. This should not be optional and wzprof should error if this action has not been performed. cf...
See: * https://github.com/tetratelabs/wazero/pull/1488 * https://dwarfstd.org/issues/200609.1.html
Right now we only profile the guest execution but to have a complete view, it would be interesting to link with the execution of the host-functions in the host itself....