Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2210: Tracing printouts for FFI calls #2211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bendk
Copy link
Contributor

@bendk bendk commented Aug 9, 2024

Added the uniffi:ffi-trace feature. If enabled, UniFFI will printout tracing-level logs for FFI calls. I hooked up the futures code to this, in the future we could also log more stuff. Lowering/lifting/cloning arcs is the first example that comes to mind.

To see tracing, use the --features=ffi-trace when running a tests, for example:

  • cd fixtures/futures/src
  • cargo test --features=ffi-trace

Here's an example of the tracing printouts when running tests from the futures fixtures:

rust_future_new: Handle(94402427620656)
rust_future_poll: Handle(94402427620656)
RustFuture::wake called
rust_future_poll: Handle(94402427620656)
RustFuture::poll is ready (canceled: false)
rust_future_complete: Handle(94402427620656)
rust_future_free: Handle(94402427620656)

@bendk bendk requested a review from a team as a code owner August 9, 2024 18:32
@bendk bendk requested review from mhammond and removed request for a team August 9, 2024 18:32
Added the `uniffi:ffi-trace` feature.  If enabled, UniFFI will printout
tracing-level logs for FFI calls.  I hooked up the futures code to this,
in the future we could also log more stuff.  Lowering/lifting/cloning
arcs is the first example that comes to mind.

To see tracing, use the `--features=ffi-trace` when running a tests, for example:
  - `cd fixtures/futures/src`
  - `cargo test --features=ffi-trace`

Here's an example of the tracing printouts when running tests from the
futures fixtures:

```
rust_future_new: Handle(94402427620656)
rust_future_poll: Handle(94402427620656)
RustFuture::wake called
rust_future_poll: Handle(94402427620656)
RustFuture::poll is ready (canceled: false)
rust_future_complete: Handle(94402427620656)
rust_future_free: Handle(94402427620656)
```
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.

2 participants