Hello I was looking at GuestProfiler the other day and was wanting to tie the results into our existing profiling infrastructure. Having the ability to grab raw stacktraces and tie those into our existing profiling results would be great - is WasmBacktrace::force_capture the right thing to do in this case? The GuestProfiler is a little too high level in our case since it's output is raw JSON.
I think that morally that would work but practically it may be a bit too expensive. The underlying Backtrace
is captured the same way but the symbolication and attaching of metadata I think is a bit more expensive. If that still works for your use case then no worries, but if it's too pricy to use then it'd be fine to add some lower-level methods to WasmBacktrace
to make it cheaper to capture and/or defer symbolication/etc
I think at the end we'd want to symbolize the backtrace - would it be cheaper to batch that operation? I guess it just moves when that step happens to be out of the signal handler... I guess there is also the question of if that's async-signal-safe (I'm going to assume no?)
oh definitely not async-signal-safe, no, if you need that you'll need to take extreme care
and it may also be the case that WasmBacktrace
just collects too much data for your use case, e.g. names of stuff you don't care about
I'd probably start with force_backtrace
and profile-the-profiler to see if it's too expensive
Last updated: Nov 22 2024 at 16:03 UTC