Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Unified Diff: firmware/lib/vboot_kernel.c

Issue 6672068: Added timing data to VbSharedData. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/vboot_firmware.c ('k') | firmware/stub/utility_stub.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_kernel.c
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 83fb3fed31c61643d96756d0aafac27343d30a9c..e50fd0f6ab5713f6235e005eca82abef4345393c 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -141,6 +141,7 @@ int LoadKernel(LoadKernelParams* params) {
int retval = LOAD_KERNEL_RECOVERY;
int recovery = VBNV_RECOVERY_RO_UNSPECIFIED;
+ uint64_t timer_enter = VbGetTimer();
/* Setup NV storage */
VbNvSetup(vnc);
@@ -155,6 +156,11 @@ int LoadKernel(LoadKernelParams* params) {
goto LoadKernelExit;
}
+ /* Clear output params in case we fail */
+ params->partition_number = 0;
+ params->bootloader_address = 0;
+ params->bootloader_size = 0;
+
/* Handle test errors */
VbNvGet(vnc, VBNV_TEST_ERROR_FUNC, &test_err);
if (VBNV_TEST_ERROR_LOAD_KERNEL == test_err) {
@@ -206,11 +212,6 @@ int LoadKernel(LoadKernelParams* params) {
dev_switch = 0; /* Always do a fully verified boot */
}
- /* Clear output params in case we fail */
- params->partition_number = 0;
- params->bootloader_address = 0;
- params->bootloader_size = 0;
-
if (kBootRecovery == boot_mode) {
/* Initialize the shared data structure, since LoadFirmware() didn't do it
* for us. */
@@ -556,9 +557,13 @@ LoadKernelExit:
recovery : VBNV_RECOVERY_NOT_REQUESTED);
VbNvTeardown(vnc);
- /* Store how much shared data we used, if any */
- if (shared)
+ if (shared) {
+ /* Save timer values */
+ shared->timer_load_kernel_enter = timer_enter;
+ shared->timer_load_kernel_exit = VbGetTimer();
+ /* Store how much shared data we used, if any */
params->shared_data_size = shared->data_used;
+ }
return retval;
}
« no previous file with comments | « firmware/lib/vboot_firmware.c ('k') | firmware/stub/utility_stub.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698