Skip to content

Commit

Permalink
docs: Improve tracing documentation
Browse files Browse the repository at this point in the history
Improves tracing documentation.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
  • Loading branch information
Jonathan Woollett-Light committed Nov 30, 2023
1 parent 48b98a2 commit 0727ff6
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,35 @@ outputting a `Trace` level log when entering and exiting every function.
It is disabled by default at compile-time. Tracing functionality has no
impact on the release binary.

You can use `cargo run --bin clippy-tracing --` to build and run the
latest version in the repo or you can run
`cargo install --path src/clippy-tracing` to install the binary then use
`clippy-tracing` to run this binary.

You can run `clippy-tracing --help` for help.

To enable tracing in Firecracker, add instrumentation with:

```
clippy-tracing \
--action fix \
--path ./src \
--exclude vmm_config/logger.rs,virtio/gen,bindings.rs,net/gen,benches,logger/,signal_handler.rs,time.rs
--exclude \
benches,\
virtio/gen,bindings.rs,net/gen,\
log-instrument-macros/,log-instrument/,clippy-tracing/,\
vmm_config/logger.rs,logger/,signal_handler.rs,time.rs
```

and re-compile with `--features tracing`:
`--exclude` can be used to avoid adding instrumentation to specific
files, here it is used to avoid adding instrumentation in:

- tests.
- bindings.
- the instrumentation tooling.
- logger functionality that may form an infinite loop.

After adding instrumentation re-compile with `--features tracing`:

```
cargo build --features tracing
Expand Down

0 comments on commit 0727ff6

Please sign in to comment.