Skip to content

patina_internal_depex: Report protocol present status#1552

Open
yangrongwei wants to merge 5 commits into
OpenDevicePartnership:mainfrom
uefi-lab:ray-report-depex-log
Open

patina_internal_depex: Report protocol present status#1552
yangrongwei wants to merge 5 commits into
OpenDevicePartnership:mainfrom
uefi-lab:ray-report-depex-log

Conversation

@yangrongwei

@yangrongwei yangrongwei commented Jun 3, 2026

Copy link
Copy Markdown

Description

pi_dispatcher.rs reports a detailed dependency list for each "found but not dispatched" driver.

  • [ N] Impacts functionality?
  • [ N] Impacts security?
  • [ N] Breaking change?
  • [ N] Includes tests?
  • [ N] Includes documentation?

How This Was Tested

Tested on real hardware.

Integration Instructions

No action.

@patina-automation

patina-automation Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

❌ QEMU Readiness Check Failed

patina-dxe-core-qemu needs to be updated before QEMU validation can run.

  • Local patina workspace version: 21.1.1 (major: 21)
  • patina dependency in patina-dxe-core-qemu: 22 (major: 22)
  • Latest release (informational only):
    • Latest patina release major: 22 (tag: patina-v22.0.0)

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/27247084172

Dependencies

Repository Ref
patina bcc2168
patina-dxe-core-qemu d4bf009
patina-fw-patcher 5b82a50
patina-qemu firmware v4.0.1
patina-qemu build script b6dff72

Note: Previous results are available in this comment's edit history.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
@antklein antklein requested a review from Copilot June 3, 2026 17:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a detailed “DEPEX evaluation report” logging path to help diagnose why drivers remain pending/not dispatched.

Changes:

  • Added optional detailed pending-driver reporting in the PI dispatcher guarded by a log-enabled check.
  • Introduced a Depex::eval_with_report API that logs DEPEX evaluation under a dedicated log target.
  • Switched DEPEX debug logs to use explicit log targets (default vs report).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
patina_dxe_core/src/pi_dispatcher.rs Adds a “detail report” loop that logs pending drivers and evaluates DEPEX with reporting enabled.
core/patina_internal_depex/src/lib.rs Adds report log target constants and routes DEPEX debug output through an overridable target via eval_with_report.

Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
Comment thread core/patina_internal_depex/src/lib.rs Outdated
Comment thread core/patina_internal_depex/src/lib.rs Outdated
@makubacki makubacki self-requested a review June 3, 2026 18:38
@yangrongwei yangrongwei changed the title patina_internal_depex: Report eval steps on demand patina_internal_depex: Report protocol present status Jun 6, 2026
@yangrongwei yangrongwei force-pushed the ray-report-depex-log branch from aa8fa25 to 2726141 Compare June 7, 2026 01:29
Comment thread patina_dxe_core/src/pi_dispatcher.rs Outdated
@yangrongwei yangrongwei force-pushed the ray-report-depex-log branch from 2726141 to f02fd80 Compare June 8, 2026 09:14
Comment thread core/patina_internal_depex/src/lib.rs Outdated
match opcode {
Opcode::Push(guid, present) => {
log::debug!(
target: "patina_depex_report",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this information is generally useful, I don’t think it needs to be hidden behind a target

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

"patina_depex_report" target removed.

Using the same target and level of the summary section, which is log::warn!(target: "patina_dxe_core"

image

@os-d os-d requested a review from Javagedes June 9, 2026 17:44
@os-d

os-d commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@Javagedes @makubacki can one of you please review?

@makubacki

Copy link
Copy Markdown
Collaborator

@Javagedes @makubacki can one of you please review?

I was out of office Mon & Tue. I'm reviewing now.

Comment on lines +290 to +293
log::warn!(
target: "patina_dxe_core",
" {guid:?} : {present}"
);

@makubacki makubacki Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Having this at warn level coupled with the patina_dxe_core target is a code smell in terms of coupling. Basically, this assumes code exists a certain way in the code (patina_dxe_core) that uses this crate (patina_internal_depex) as a dependency.

This type of print should be at least info or a more verbose type if left at the patina_dxe_core target level.

But I really think this code should really just return something like an iterator of protocols present for a given Depex so all logging stays in the caller.

@os-d os-d Jun 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed. I just meant don't use a target at all for the logging. It will inherit the patina_internal_depex target if a consumer wants to filter it.

But, to Michael's point, I think that returning an iterator here and letting the caller print it works well.

Comment on lines +117 to 136
// Detail report
log::warn!("Begin Detail Report:");
for driver in self.dispatcher_context.lock().pending_drivers.iter() {
log::warn!(
"Driver {} ({:?}) found but not dispatched. Protocols present:",
driver.name.as_deref().unwrap_or("Unnamed"),
guid_fmt!(driver.file_name)
);

match &driver.depex {
Some(depex) => {
depex.report_protocol_present();
}
_ => {
log::warn!(" No Depex");
}
}
}
log::warn!("End Detail Report.");
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The messages in this "detailed report" should be at info level or higher. I think debug level.

The normal case of a driver not dispatched is already covered by warn above. This is debug information.

}

// Detail report
log::warn!("Begin Detail Report:");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"Begin Detail Report" is too ambiguous. Please change to something like "Begin Report of Drivers Not Dispatched".

@makubacki

Copy link
Copy Markdown
Collaborator

@yangrongwei, can you please put an example of output in the PR description to help reviewers and those reading the release notes (that come from the PR description) to know what to expect?

@makubacki

Copy link
Copy Markdown
Collaborator

@yangrongwei, please rebase your branch locally for your next push. It is 59 commits behind now and that should allow it to run against the latest CI checks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants