Stream: wasmtime

Topic: Lower level backtrace API


view this post on Zulip Tyler Rockwood (Apr 16 2024 at 14:35):

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.

view this post on Zulip Alex Crichton (Apr 16 2024 at 14:38):

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

view this post on Zulip Tyler Rockwood (Apr 16 2024 at 14:50):

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?)

view this post on Zulip Alex Crichton (Apr 16 2024 at 14:51):

oh definitely not async-signal-safe, no, if you need that you'll need to take extreme care

view this post on Zulip Alex Crichton (Apr 16 2024 at 14:52):

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

view this post on Zulip Alex Crichton (Apr 16 2024 at 14:52):

I'd probably start with force_backtrace and profile-the-profiler to see if it's too expensive


Last updated: Dec 23 2024 at 14:03 UTC