cbmem: Sort timestamp entries
commitd4fec689fd125c92388dc1dd4775ea21d0e1e447
authorRaul E Rangel <rrangel@chromium.org>
Fri, 11 May 2018 17:08:07 +0000 (11 11:08 -0600)
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>
Sun, 13 May 2018 10:14:35 +0000 (13 10:14 +0000)
tree6114d2613e3699d5a9546ab6fcfa35e529463e06
parent7f268eab7816c6521502c16695402f67cd18e7a7
cbmem: Sort timestamp entries

If the timestamp entries are added out of order, the duration
calculation will be wrong.

AGESA collects timestamp data through all the stages. Then in AmdInitPost
it asks for a buffer to write TP_Perf_STRUCT into. agesawrapper will then
take the data and call timestamp_add on each entry. This results in
the entries being out of order.

TEST=Built firmware for grunt that manually added entries and then ran
cbmem -t/-T to verify the entries were in the correct order.

Change-Id: I6946a844b71d714141b3372e4c43807cfe3528ad
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/26168
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
util/cbmem/cbmem.c