Skip to content

Commit 8a297ad

Browse files
Jonathan Woollett-LightJonathanWoollett-Light
authored andcommitted
feat: Instrumentation tooling
Adds a crate (`log-instrument`) with an instrumentation macro. Adds a binary (`clippy-tracing`) to add, remove and check for instrumentation. Signed-off-by: Jonathan Woollett-Light <[email protected]>
1 parent 734ba5a commit 8a297ad

File tree

29 files changed

+1704
-19
lines changed

29 files changed

+1704
-19
lines changed

Cargo.lock

Lines changed: 105 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["src/cpu-template-helper", "src/firecracker", "src/jailer", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor"]
2+
members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/jailer", "src/log-instrument", "src/log-instrument-macros", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor"]
33
default-members = ["src/firecracker"]
44
resolver = "2"
55

src/api_server/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ serde_derive = "1.0.136"
1515
serde_json = "1.0.78"
1616
thiserror = "1.0.32"
1717
displaydoc = "0.2.4"
18+
log-instrument = { path = "../log-instrument", optional = true }
1819

1920
micro_http = { git = "https://github.com/firecracker-microvm/micro-http" }
2021
seccompiler = { path = "../seccompiler" }
@@ -23,3 +24,6 @@ vmm = { path = "../vmm" }
2324

2425
[dev-dependencies]
2526
libc = "0.2.117"
27+
28+
[features]
29+
tracing = ["log-instrument"]

src/api_server/swagger/firecracker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,7 @@ definitions:
997997
module:
998998
type: string
999999
description: The module path to filter log messages by.
1000+
example: api_server::request
10001001

10011002
MachineConfiguration:
10021003
type: object

src/clippy-tracing/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "clippy-tracing"
3+
version = "0.1.0"
4+
authors = ["Amazon Firecracker team <[email protected]>"]
5+
edition = "2021"
6+
license = "Apache-2.0"
7+
8+
[[bin]]
9+
name = "clippy-tracing"
10+
bench = false
11+
12+
[dependencies]
13+
clap = { version = "4.3.2", features = ["derive"] }
14+
itertools = "0.11.0"
15+
proc-macro2 = { version = "1.0.63", features = ["span-locations"] }
16+
quote = "1.0.28"
17+
syn = { version = "2.0.17", features = ["full", "extra-traits", "visit", "visit-mut", "printing"] }
18+
walkdir = "2.3.3"
19+
20+
[dev-dependencies]
21+
uuid = { version = "1.4.1", features = ["v4"] }

0 commit comments

Comments
 (0)