timestamps: You can never have enough of them!

Now that we have timestamps in pre-RAM stages, let's actually make use
of them. This patch adds several timestamps to both the bootblock and
especially the verstage to allow more fine-grained boot time tracking.

Some of the introduced timestamps can appear more than once per boot.
This doesn't seem to be a problem for both coreboot and the cbmem
utility, and the context makes it clear which operation was timestamped
at what point.

Also simplifies cbmem's timestamp printing routine a bit, fixing a
display bug when a timestamp had a section of exactly ",000," in it
(e.g. 1,000,185).

BRANCH=None
BUG=None
TEST=Booted Pinky, Blaze and Falco, confirmed that all timestamps show
up and contained sane values. Booted Storm (no timestamps here since it
doesn't support pre-RAM timestamps yet).

Change-Id: I5979bfa9445a9e0aba98ffdf8006c21096743456
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/234063
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Julius Werner 2014-12-02 20:51:19 -08:00 committed by chrome-internal-fetch
commit 7a2ce81722
11 changed files with 116 additions and 42 deletions

View file

@ -13,6 +13,7 @@
#include <console/console.h>
#include <string.h>
#include <lib.h>
#include <timestamp.h>
unsigned long ulzma(unsigned char * src, unsigned char * dst)
{
@ -26,6 +27,8 @@ unsigned long ulzma(unsigned char * src, unsigned char * dst)
MAYBE_STATIC unsigned char scratchpad[15980];
unsigned char *cp;
/* Note: these timestamps aren't useful for memory-mapped media (x86) */
timestamp_add_now(TS_START_ULZMA);
memcpy(properties, src, LZMA_PROPERTIES_SIZE);
/* The outSize in LZMA stream is a 64bit integer stored in little-endian
* (ref: lzma.cc@LZMACompress: put_64). To prevent accessing by
@ -49,5 +52,6 @@ unsigned long ulzma(unsigned char * src, unsigned char * dst)
printk(BIOS_WARNING, "lzma: Decoding error = %d\n", res);
return 0;
}
timestamp_add_now(TS_END_ULZMA);
return outSize;
}

View file

@ -26,9 +26,9 @@
#include <timestamp.h>
#include <arch/early_variables.h>
#define MAX_TIMESTAMPS 30
#define MAX_TIMESTAMPS 60
#define MAX_TIMESTAMP_CACHE 16
#define MAX_TIMESTAMP_CACHE 30
struct __attribute__((__packed__)) timestamp_cache {
uint16_t cache_state;