bytecodealliance / bytecodealliance/wasmtime
Ability to retrieve name of invoked hostcall in call hook
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
#### Feature
I'd like a way to retrieve the name of the invoked hostcall in a [call hook](https://docs.rs/wasmtime/latest/wasmtime/struct.Store.html#method.call_hook). Ideally getting the arguments and return values would also be useful.
#### Benefit
Adding this feature would allow me to log the name of the invoked hostcall. We have third party developers writing wasm modules running on something we've built around wasmtime and we'd like to offer a trace feature so those developers can see what hostcalls are being invoked and roughly when they are invoked relative to other parts of their modules. Including arguments and return values could also be useful in that context.
#### Implementation
I do not have an implementation plan at this time.
#### Alternatives
I'd be open to using a different API than the call hook one if it allows me to do something similar where a callback is invoked with sufficient context available to determine the hostcall name. Alternatively, if there were a way to define a decorator around the WASI hostcalls, that could also work, since I could just instrument other hostcalls.
Contributor guide
Assessment
This issue has not been assessed yet.