Skip to content

Commit c0ace2a

Browse files
authored
patina_performance: Log cross-module phase markers (#1476)
The current implement does not log the cross-module markers for the transitions from PEI to DXE. In EDK2, these are logged by the DXE Core. Here we need to do this from the component because it initializes the underlying functionality. This is not ideal, but it is the best we can do without merging the performance component into the core.
1 parent 02d7a3a commit c0ace2a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

components/patina_performance/src/component/performance.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ use patina::{
2323
guids::PERFORMANCE_PROTOCOL,
2424
performance::{
2525
globals::{get_static_state, set_load_image_count, set_perf_measurement_mask, set_static_state},
26-
measurement::{PerformanceProperty, event_callback},
26+
logging::{perf_cross_module_begin, perf_cross_module_end},
27+
measurement::{PerformanceProperty, create_performance_measurement, event_callback},
2728
record::{
2829
GenericPerformanceRecord, PerformanceRecordHeader,
2930
hob::{HobPerformanceData, HobPerformanceDataExtractor},
@@ -171,6 +172,12 @@ impl Performance {
171172
)?
172173
};
173174

175+
// This is not ideal. This PEI end and DXE begin are way too late into DXE phase. However, this cannot be
176+
// improved without integrating performance earlier, and mostly likely merging into the core.
177+
let dxe_core_guid = patina::guids::DXE_CORE.into_inner();
178+
perf_cross_module_end("PEI", &dxe_core_guid, create_performance_measurement);
179+
perf_cross_module_begin("DXE", &dxe_core_guid, create_performance_measurement);
180+
174181
Ok(())
175182
}
176183
}

0 commit comments

Comments
 (0)