Skip to content

Conversation

@dblnz
Copy link
Contributor

@dblnz dblnz commented Oct 24, 2025

This closes #990.
Currently, when tracing guests, the max log level parameter provided to the guest is not used to filter out traces.

This PR adds the filtering capability for the guest tracing and also modifies some of the trace levels in the guest.
For that to work, a change in the integration_tests.rs was necessary to update the number of expected logs in log_message test

@dblnz dblnz added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Oct 24, 2025
@dblnz dblnz self-assigned this Oct 24, 2025
@dblnz dblnz force-pushed the fix-tracing-filter branch from 489acde to 7ff7b03 Compare October 24, 2025 15:19
dblnz added 2 commits January 23, 2026 14:29
…arent

Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
@dblnz dblnz force-pushed the fix-tracing-filter branch from 7ff7b03 to 58caf0d Compare January 23, 2026 12:30
@dblnz dblnz marked this pull request as ready for review January 23, 2026 12:31
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but it would be nice if it was possible to remove all uses of tracing::log::LeverFilter and log::Levelfilter for tracing_core::LevelFilter/tracing::LevelFilter instead

Comment on lines +40 to +48
fn convert_level_filter(filter: tracing::log::LevelFilter) -> tracing_core::LevelFilter {
match filter {
tracing::log::LevelFilter::Off => tracing_core::LevelFilter::OFF,
tracing::log::LevelFilter::Error => tracing_core::LevelFilter::ERROR,
tracing::log::LevelFilter::Warn => tracing_core::LevelFilter::WARN,
tracing::log::LevelFilter::Info => tracing_core::LevelFilter::INFO,
tracing::log::LevelFilter::Debug => tracing_core::LevelFilter::DEBUG,
tracing::log::LevelFilter::Trace => tracing_core::LevelFilter::TRACE,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to tracing_core::LevelFilter everywhere instead of having this? (in entrypoint of hyperlight_guest_bin + whatever the host passes to the guest)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix guest tracing filtering

2 participants