Skip to content

Commit

Permalink
Merge branch 'main' into fix_patch_async_drives
Browse files Browse the repository at this point in the history
  • Loading branch information
bchalios authored Nov 30, 2023
2 parents ed072a4 + e03ae44 commit 516e9ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
27 changes: 23 additions & 4 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
--action fix \
--path ./src \
--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
4 changes: 2 additions & 2 deletions src/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ versionize = "0.1.10"
versionize_derive = "0.1.6"
vmm-sys-util = "0.11.2"
vm-memory = { version = "0.13.0", features = ["backend-mmap", "backend-bitmap"] }
log-instrument = { path = "../log-instrument", optional = true }
log-instrument = { path = "../log-instrument" }

[dev-dependencies]
serde_json = "1.0.99"

[features]
tracing = ["log-instrument"]
tracing = []

0 comments on commit 516e9ed

Please sign in to comment.