Skip to content

wasmtime component bindgen: when tracing is enabled, emit an event for args & results#6209

Merged
pchickey merged 3 commits into
mainfrom
pch/component-bindgen-tracing
Apr 13, 2023
Merged

wasmtime component bindgen: when tracing is enabled, emit an event for args & results#6209
pchickey merged 3 commits into
mainfrom
pch/component-bindgen-tracing

Conversation

@pchickey
Copy link
Copy Markdown
Contributor

This is consistient with what wiggle does (see
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wiggle/generate/src/funcs.rs#L266), with the exceptions that

  1. wiggle has a facility for disabling tracing on a per-function basis, a requirement which was driven by functions which pass secrets into wasm. this will be added to wasmtime-wit-bindgen at a later date.
  2. wiggle doesn't actually emit an event when calling a function which takes no arguments (see && func.params.len() > 0 in predicate), in this case we emit an event with the body "call", to ensure these calls are observable.

…r arguments and results

This is consistient with what wiggle does (see
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wiggle/generate/src/funcs.rs#L266), with the exceptions that
1. wiggle has a facility for disabling tracing on a per-function basis,
a requirement which was driven by functions which pass secrets into wasm. this will be added to wasmtime-wit-bindgen at a later date.
2. wiggle doesn't actually emit an event when calling a function which
takes no arguments (see `&& func.params.len() > 0` in predicate), in
this case we emit an event with the body `"call"`, to ensure these calls
are observable.
@pchickey pchickey requested a review from a team as a code owner April 13, 2023 21:20
@pchickey pchickey requested review from alexcrichton and elliottt and removed request for a team and alexcrichton April 13, 2023 21:20
@alexcrichton alexcrichton added this pull request to the merge queue Apr 13, 2023
Copy link
Copy Markdown
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just one suggestion about always including "call" in traces.

Comment thread crates/wit-bindgen/src/lib.rs Outdated
@pchickey pchickey removed this pull request from the merge queue due to a manual request Apr 13, 2023
@pchickey pchickey enabled auto-merge April 13, 2023 22:36
@pchickey pchickey added this pull request to the merge queue Apr 13, 2023
Merged via the queue into main with commit cc1c14a Apr 13, 2023
@pchickey pchickey deleted the pch/component-bindgen-tracing branch April 13, 2023 23:39
pchickey pushed a commit to bytecodealliance/preview2-prototyping that referenced this pull request Apr 14, 2023
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Apr 16, 2023
…r args & results (bytecodealliance#6209)

* wasmtime component bindgen: when tracing is enabled, emit an event for arguments and results

This is consistient with what wiggle does (see
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wiggle/generate/src/funcs.rs#L266), with the exceptions that
1. wiggle has a facility for disabling tracing on a per-function basis,
a requirement which was driven by functions which pass secrets into wasm. this will be added to wasmtime-wit-bindgen at a later date.
2. wiggle doesn't actually emit an event when calling a function which
takes no arguments (see `&& func.params.len() > 0` in predicate), in
this case we emit an event with the body `"call"`, to ensure these calls
are observable.

* review feedback: add call and return messages to events

* consistiency: dont drop `guest` from `wit-bindgen guest export` in span
pchickey pushed a commit to pchickey/wasmtime that referenced this pull request May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants