diff options
-rw-r--r-- | firmware/lib/vboot_kernel.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c index 741890e4..8ac409a6 100644 --- a/firmware/lib/vboot_kernel.c +++ b/firmware/lib/vboot_kernel.c @@ -320,6 +320,7 @@ static int vb2_load_partition(struct vb2_context *ctx, VbSharedDataKernelPart *shpart, struct vb2_workbuf *wb) { + uint64_t read_us = 0, start_ts; struct vb2_workbuf wblocal = *wb; /* Allocate kernel header buffer in workbuf */ @@ -327,12 +328,13 @@ static int vb2_load_partition(struct vb2_context *ctx, if (!kbuf) return VB2_ERROR_LOAD_PARTITION_WORKBUF; - + start_ts = VbExGetTimer(); if (VbExStreamRead(stream, KBUF_SIZE, kbuf)) { VB2_DEBUG("Unable to read start of partition.\n"); shpart->check_result = VBSD_LKP_CHECK_READ_START; return VB2_ERROR_LOAD_PARTITION_READ_VBLOCK; } + read_us += VbExGetTimer() - start_ts; if (VB2_SUCCESS != vb2_verify_kernel_vblock(ctx, kbuf, KBUF_SIZE, kernel_subkey, @@ -387,11 +389,17 @@ static int vb2_load_partition(struct vb2_context *ctx, body_readptr += body_copied; /* Read the kernel data */ + start_ts = VbExGetTimer(); if (body_toread && VbExStreamRead(stream, body_toread, body_readptr)) { VB2_DEBUG("Unable to read kernel data.\n"); shpart->check_result = VBSD_LKP_CHECK_READ_DATA; return VB2_ERROR_LOAD_PARTITION_READ_BODY; } + read_us += VbExGetTimer() - start_ts; + VB2_DEBUG("read %" PRIu32 " KB in %" PRIu64 " ms at %" PRIu64 " KB/s.\n", + (body_toread + KBUF_SIZE) / 1024, read_us / 1000, + ((uint64_t)(body_toread + KBUF_SIZE) * 1000 * 1000) / + (read_us * 1024)); /* Get key for preamble/data verification from the key block. */ struct vb2_public_key data_key; |