-
Notifications
You must be signed in to change notification settings - Fork 50
patina_internal_depex: Report protocol present status #1552
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
d4a0688
bea1472
aa8fa25
f02fd80
bcc2168
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,6 +282,27 @@ impl Depex { | |
| false | ||
| } | ||
|
|
||
| /// Report protocol present status in the DEPEX expression. | ||
| pub fn report_protocol_present(&self) { | ||
| for opcode in self.expression.iter() { | ||
| match opcode { | ||
| Opcode::Push(guid, present) => { | ||
| log::debug!( | ||
| target: "patina_depex_report", | ||
| " {guid:?} : {present}" | ||
| ); | ||
|
Comment on lines
+290
to
+293
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having this at This type of print should be at least But I really think this code should really just return something like an iterator of protocols present for a given
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| Opcode::End => { | ||
| log::debug!( | ||
| target: "patina_depex_report", | ||
| " {opcode:?}" | ||
| ); | ||
| } | ||
| _ => {} | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// If the depex expression is an associated dependency, it returns the associated dependency. | ||
| pub fn is_associated(&self) -> Option<AssociatedDependency> { | ||
| match self.expression.first() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,30 @@ impl<P: PlatformInfo> PiDispatcher<P> { | |
| guid_fmt!(driver.file_name) | ||
| ); | ||
| } | ||
|
|
||
| const EVAL_REPORT: &str = "patina_depex_report"; | ||
|
|
||
| if log::log_enabled!(target: EVAL_REPORT, log::Level::Debug) { | ||
| log::debug!(target: EVAL_REPORT, "Begin Detail Report:"); | ||
| for driver in self.dispatcher_context.lock().pending_drivers.iter() { | ||
| log::debug!( | ||
| target: EVAL_REPORT, | ||
| "Driver {} ({:?}) found but not dispatched. Protocols present:", | ||
|
joschock marked this conversation as resolved.
Outdated
|
||
| driver.name.as_deref().unwrap_or("Unnamed"), | ||
| guid_fmt!(driver.file_name) | ||
| ); | ||
|
|
||
| match &driver.depex { | ||
| Some(depex) => { | ||
| depex.report_protocol_present(); | ||
| } | ||
| _ => { | ||
| log::debug!(target: EVAL_REPORT, " No Depex"); | ||
| } | ||
| } | ||
| } | ||
| log::debug!(target: EVAL_REPORT, "End Detail Report."); | ||
| } | ||
| } | ||
|
Comment on lines
+117
to
136
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The messages in this "detailed report" should be at The normal case of a driver not dispatched is already covered by |
||
|
|
||
| /// Initializes the dispatcher by registering for FV protocol installation events. | ||
|
|
||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"