Commit 104f62a
authored
Update hyperlight-guest-tracing crate to conditionally enable traces at compile time (#752)
* [trace] Add check for empty message to trace macro
Signed-off-by: Doru Blânzeanu <[email protected]>
* [trace] move tracing logic inside tracing module
- this helps with later conditionally compiling only the tracing code
depending on a feature
Signed-off-by: Doru Blânzeanu <[email protected]>
* [trace] add 'trace' feature to guest tracing crates
- This allows the use of the 'hyperlight-guest-tracing'
without having the tracing enabled
- Now the user can select at compile time whether the
macros enable tracing or not
- Before this change, the crate using the macros from
hyperlight-guest-tracing-macro needed to define a features
called 'trace_guest' because the generated code would gate
everything with that feature
- The change makes the generation of code dependent on the
'trace' feature
- Some of the variables used in the macros were prefixed with
an '_' to avoid warnings when the 'trace' feature is not set
Signed-off-by: Doru Blânzeanu <[email protected]>
* [trace] move macros tests to the tracing crate
- This is needed for the tests to pass because the macros
use 'hyperlight_guest_tracing::' which cannot be imported by
'hyperlight_guest_tracing_macro' bacause it would create a
circular dependency.
- The caveat is that when using 'hyperlight_guest_tracing_macro'
one needs to have as a dependency 'hyperlight_guest_tracing'
also
Signed-off-by: Doru Blânzeanu <[email protected]>
* update guests to use the tracing crate to intrument functions
Signed-off-by: Doru Blânzeanu <[email protected]>
---------
Signed-off-by: Doru Blânzeanu <[email protected]>1 parent 0e5d419 commit 104f62a
File tree
14 files changed
+422
-298
lines changed- src
- hyperlight_guest_bin
- hyperlight_guest_tracing_macro
- src
- hyperlight_guest_tracing
- src
- hyperlight_guest
- hyperlight_host
- tests/rust_guests
- callbackguest
- src
- simpleguest
- src
- witguest
14 files changed
+422
-298
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments