Skip to content

Tracing instrument #3810

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

Conversation

JonathanWoollett-Light
Copy link
Contributor

@JonathanWoollett-Light JonathanWoollett-Light commented Jun 8, 2023

Changes

Adds code instrumentation.

Reason

This opens support for tracing and profiling via this instrumentation.

skip_all is avoided as it is removed in the latest version of tracing, while we can use it here, it would need to be removed later.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@JonathanWoollett-Light JonathanWoollett-Light added Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Enhancement Indicates new feature requests labels Jun 8, 2023
@JonathanWoollett-Light JonathanWoollett-Light self-assigned this Jun 8, 2023
@JonathanWoollett-Light JonathanWoollett-Light added the Status: Blocked Indicates that an issue or pull request cannot currently be worked on label Jun 8, 2023
@JonathanWoollett-Light
Copy link
Contributor Author

JonathanWoollett-Light commented Jun 8, 2023

Blocked on #3808

@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-instrument branch 5 times, most recently from 9ab22a0 to 8804768 Compare June 12, 2023 09:54
@JonathanWoollett-Light JonathanWoollett-Light changed the base branch from feature/tracing to main June 19, 2023 14:03
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-instrument branch 18 times, most recently from aabca1a to 3b48ad6 Compare June 23, 2023 17:03
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-instrument branch 10 times, most recently from 3ad2277 to 64082ef Compare July 17, 2023 15:43
@JonathanWoollett-Light JonathanWoollett-Light mentioned this pull request Aug 14, 2023
9 tasks
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-instrument branch 3 times, most recently from 8c27615 to cee16ee Compare August 14, 2023 01:49
@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Patch coverage: 86.95% and project coverage change: -11.60% ⚠️

Comparison is base (6bf22c2) 82.66% compared to head (40f5eaa) 71.07%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3810       +/-   ##
===========================================
- Coverage   82.66%   71.07%   -11.60%     
===========================================
  Files         221      219        -2     
  Lines       28192     9084    -19108     
===========================================
- Hits        23306     6456    -16850     
+ Misses       4886     2628     -2258     
Flag Coverage Δ
4.14-c7g.metal 66.10% <82.59%> (-12.03%) ⬇️
4.14-m5d.metal 69.92% <84.50%> (-9.98%) ⬇️
4.14-m6a.metal 69.87% <84.32%> (-9.18%) ⬇️
4.14-m6g.metal 66.10% <82.59%> (-12.03%) ⬇️
4.14-m6i.metal 69.92% <84.50%> (-9.98%) ⬇️
5.10-c7g.metal 67.13% <85.53%> (-13.94%) ⬇️
5.10-m5d.metal 70.83% <87.45%> (-11.76%) ⬇️
5.10-m6a.metal 70.78% <87.28%> (-11.05%) ⬇️
5.10-m6g.metal 67.13% <85.53%> (-13.94%) ⬇️
5.10-m6i.metal 70.83% <87.45%> (-11.75%) ⬇️
6.1-c7g.metal 67.13% <85.53%> (-13.94%) ⬇️
6.1-m5d.metal 70.83% <87.45%> (-11.76%) ⬇️
6.1-m6a.metal 70.78% <87.28%> (-11.05%) ⬇️
6.1-m6g.metal 67.13% <85.53%> (-13.94%) ⬇️
6.1-m6i.metal 70.83% <87.45%> (-11.76%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/firecracker/src/api_server_adapter.rs 0.00% <0.00%> (ø)
src/firecracker/src/main.rs 1.16% <0.00%> (+0.93%) ⬆️
src/jailer/src/chroot.rs 0.00% <0.00%> (ø)
...c/vmm/src/arch/aarch64/gic/gicv2/regs/dist_regs.rs 0.00% <0.00%> (ø)
...rc/vmm/src/arch/aarch64/gic/gicv2/regs/icc_regs.rs 0.00% <0.00%> (ø)
src/vmm/src/arch/aarch64/gic/gicv2/regs/mod.rs 0.00% <0.00%> (ø)
src/vmm/src/signal_handler.rs 28.04% <ø> (-53.49%) ⬇️
src/vmm/src/vmm_config/balloon.rs 85.71% <ø> (-12.02%) ⬇️
src/vmm/src/vmm_config/boot_source.rs 50.00% <ø> (-40.48%) ⬇️
src/vmm/src/vmm_config/drive.rs 100.00% <ø> (+2.06%) ⬆️
... and 195 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-instrument branch 4 times, most recently from 3c5d953 to e1697a3 Compare August 17, 2023 16:15
Re-exports logging macros from `logger` to allow more atomic changes
in `logger`.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Jonathan Woollett-Light added 5 commits August 18, 2023 11:28
Replaces `log` with `tracing` and the custom logger with
`tracing_subscriber::Fmt`.

Adding support for re-configuring the logger at run-time and
removing the old logger format.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Add the ` FilterFn` layer to support filtering by crates, modules and
spans. With `tracing::instrument` spans wrap functions, this would
support filtering to specific functions.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Adds code instrumentation. This opens support for tracing and
profiling via this instrumentation.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Runs `clippy-tracing --check` to assert code is properly instrumented.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Enables the `max_level_debug` tracing features to omit instrumentation
by default.

Signed-off-by: Jonathan Woollett-LIght <jcawl@amazon.co.uk>
@JonathanWoollett-Light
Copy link
Contributor Author

Moved to feature branch to store work for historical reference https://github.com/firecracker-microvm/firecracker/tree/feature/tokio-tracing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Status: Blocked Indicates that an issue or pull request cannot currently be worked on Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant