Jakub Czapiga has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62709 )
Change subject: commonlib/timestamp_serialized: Add timestamp enum to name mapping ......................................................................
commonlib/timestamp_serialized: Add timestamp enum to name mapping
Some solutions require readable form of timestamps, which does not contain spaces. Current descriptive timestamp names do not meet this criteria. Also, mapping enums to their text representation allows for quick grepping (use of grep command) to find relevant timestamps in the code.
Signed-off-by: Jakub Czapiga jacz@semihalf.com Change-Id: Ifd49f20d6b00a5bbd21804cea3a50b8cef074cd1 --- M src/commonlib/include/commonlib/timestamp_serialized.h 1 file changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/62709/1
diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h index 492508e..0952011 100644 --- a/src/commonlib/include/commonlib/timestamp_serialized.h +++ b/src/commonlib/include/commonlib/timestamp_serialized.h @@ -313,4 +313,140 @@ { TS_END_POSTCAR, "end of postcar" }, };
+#define ts_str(x) #x +#define ts_enum_to_name_pair(e) { e, ts_str(e) } + +static const struct timestamp_id_to_enum_name { + uint32_t id; + const char *name; +} timestamp_enum_ids[] = { + { 0, "TS_START"}, + ts_enum_to_name_pair(TS_START_ROMSTAGE), + ts_enum_to_name_pair(TS_BEFORE_INITRAM), + ts_enum_to_name_pair(TS_AFTER_INITRAM), + ts_enum_to_name_pair(TS_END_ROMSTAGE), + ts_enum_to_name_pair(TS_START_VBOOT), + ts_enum_to_name_pair(TS_END_VBOOT), + ts_enum_to_name_pair(TS_START_COPYRAM), + ts_enum_to_name_pair(TS_END_COPYRAM), + ts_enum_to_name_pair(TS_START_RAMSTAGE), + ts_enum_to_name_pair(TS_START_BOOTBLOCK), + ts_enum_to_name_pair(TS_END_BOOTBLOCK), + ts_enum_to_name_pair(TS_START_COPYROM), + ts_enum_to_name_pair(TS_END_COPYROM), + ts_enum_to_name_pair(TS_START_ULZMA), + ts_enum_to_name_pair(TS_END_ULZMA), + ts_enum_to_name_pair(TS_START_ULZ4F), + ts_enum_to_name_pair(TS_END_ULZ4F), + ts_enum_to_name_pair(TS_DEVICE_ENUMERATE), + ts_enum_to_name_pair(TS_DEVICE_CONFIGURE), + ts_enum_to_name_pair(TS_DEVICE_ENABLE), + ts_enum_to_name_pair(TS_DEVICE_INITIALIZE), + ts_enum_to_name_pair(TS_OPROM_INITIALIZE), + ts_enum_to_name_pair(TS_OPROM_COPY_END), + ts_enum_to_name_pair(TS_OPROM_END), + ts_enum_to_name_pair(TS_DEVICE_DONE), + ts_enum_to_name_pair(TS_CBMEM_POST), + ts_enum_to_name_pair(TS_WRITE_TABLES), + ts_enum_to_name_pair(TS_FINALIZE_CHIPS), + ts_enum_to_name_pair(TS_LOAD_PAYLOAD), + ts_enum_to_name_pair(TS_ACPI_WAKE_JUMP), + ts_enum_to_name_pair(TS_SELFBOOT_JUMP), + ts_enum_to_name_pair(TS_START_POSTCAR), + ts_enum_to_name_pair(TS_END_POSTCAR), + ts_enum_to_name_pair(TS_DELAY_START), + ts_enum_to_name_pair(TS_DELAY_END), + ts_enum_to_name_pair(TS_READ_UCODE_START), + ts_enum_to_name_pair(TS_READ_UCODE_END), + ts_enum_to_name_pair(TS_ELOG_INIT_START), + ts_enum_to_name_pair(TS_ELOG_INIT_END), + ts_enum_to_name_pair(TS_START_COPYVER), + ts_enum_to_name_pair(TS_END_COPYVER), + ts_enum_to_name_pair(TS_START_TPMINIT), + ts_enum_to_name_pair(TS_END_TPMINIT), + ts_enum_to_name_pair(TS_START_VERIFY_SLOT), + ts_enum_to_name_pair(TS_END_VERIFY_SLOT), + ts_enum_to_name_pair(TS_START_HASH_BODY), + ts_enum_to_name_pair(TS_DONE_LOADING), + ts_enum_to_name_pair(TS_DONE_HASHING), + ts_enum_to_name_pair(TS_END_HASH_BODY), + ts_enum_to_name_pair(TS_START_TPMPCR), + ts_enum_to_name_pair(TS_END_TPMPCR), + ts_enum_to_name_pair(TS_START_TPMLOCK), + ts_enum_to_name_pair(TS_END_TPMLOCK), + ts_enum_to_name_pair(TS_START_EC_SYNC), + ts_enum_to_name_pair(TS_EC_HASH_READY), + ts_enum_to_name_pair(TS_EC_POWER_LIMIT_WAIT), + ts_enum_to_name_pair(TS_END_EC_SYNC), + ts_enum_to_name_pair(TS_START_COPYVPD), + ts_enum_to_name_pair(TS_END_COPYVPD_RO), + ts_enum_to_name_pair(TS_END_COPYVPD_RW), + ts_enum_to_name_pair(TS_START_TPM_ENABLE_UPDATE), + ts_enum_to_name_pair(TS_END_TPM_ENABLE_UPDATE), + ts_enum_to_name_pair(TS_AGESA_INIT_RESET_START), + ts_enum_to_name_pair(TS_AGESA_INIT_RESET_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_EARLY_START), + ts_enum_to_name_pair(TS_AGESA_INIT_EARLY_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_POST_START), + ts_enum_to_name_pair(TS_AGESA_INIT_POST_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_ENV_START), + ts_enum_to_name_pair(TS_AGESA_INIT_ENV_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_MID_START), + ts_enum_to_name_pair(TS_AGESA_INIT_MID_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_LATE_START), + ts_enum_to_name_pair(TS_AGESA_INIT_LATE_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_RTB_START), + ts_enum_to_name_pair(TS_AGESA_INIT_RTB_DONE), + ts_enum_to_name_pair(TS_AGESA_INIT_RESUME_START), + ts_enum_to_name_pair(TS_AGESA_INIT_RESUME_DONE), + ts_enum_to_name_pair(TS_AGESA_S3_LATE_START), + ts_enum_to_name_pair(TS_AGESA_S3_LATE_DONE), + ts_enum_to_name_pair(TS_AGESA_S3_FINAL_START), + ts_enum_to_name_pair(TS_AGESA_S3_FINAL_DONE), + ts_enum_to_name_pair(TS_AMD_APOB_READ_START), + ts_enum_to_name_pair(TS_AMD_APOB_ERASE_START), + ts_enum_to_name_pair(TS_AMD_APOB_WRITE_START), + ts_enum_to_name_pair(TS_AMD_APOB_DONE), + ts_enum_to_name_pair(TS_ME_INFORM_DRAM_WAIT), + ts_enum_to_name_pair(TS_ME_INFORM_DRAM_DONE), + ts_enum_to_name_pair(TS_ME_BEFORE_END_OF_POST), + ts_enum_to_name_pair(TS_ME_AFTER_END_OF_POST), + ts_enum_to_name_pair(TS_ME_BOOT_STALL_DONE), + ts_enum_to_name_pair(TS_ME_ICC_CONFIG_START), + ts_enum_to_name_pair(TS_ME_HOST_BOOT_PREP_DONE), + ts_enum_to_name_pair(TS_ME_RECEIVED_CRDA_FROM_PMC), + ts_enum_to_name_pair(TS_START_CSE_FW_SYNC), + ts_enum_to_name_pair(TS_END_CSE_FW_SYNC), + ts_enum_to_name_pair(TS_FSP_MEMORY_INIT_START), + ts_enum_to_name_pair(TS_FSP_MEMORY_INIT_END), + ts_enum_to_name_pair(TS_FSP_TEMP_RAM_EXIT_START), + ts_enum_to_name_pair(TS_FSP_TEMP_RAM_EXIT_END), + ts_enum_to_name_pair(TS_FSP_SILICON_INIT_START), + ts_enum_to_name_pair(TS_FSP_SILICON_INIT_END), + ts_enum_to_name_pair(TS_FSP_BEFORE_ENUMERATE), + ts_enum_to_name_pair(TS_FSP_AFTER_ENUMERATE), + ts_enum_to_name_pair(TS_FSP_BEFORE_FINALIZE), + ts_enum_to_name_pair(TS_FSP_AFTER_FINALIZE), + ts_enum_to_name_pair(TS_FSP_BEFORE_END_OF_FIRMWARE), + ts_enum_to_name_pair(TS_FSP_AFTER_END_OF_FIRMWARE), + ts_enum_to_name_pair(TS_FSP_MULTI_PHASE_SI_INIT_START), + ts_enum_to_name_pair(TS_FSP_MULTI_PHASE_SI_INIT_END), + ts_enum_to_name_pair(TS_FSP_MEMORY_INIT_LOAD), + ts_enum_to_name_pair(TS_FSP_SILICON_INIT_LOAD), + ts_enum_to_name_pair(TS_ME_ROM_START), + ts_enum_to_name_pair(TS_DC_START), + ts_enum_to_name_pair(TS_RO_PARAMS_INIT), + ts_enum_to_name_pair(TS_RO_VB_INIT), + ts_enum_to_name_pair(TS_RO_VB_SELECT_FIRMWARE), + ts_enum_to_name_pair(TS_RO_VB_SELECT_AND_LOAD_KERNEL), + ts_enum_to_name_pair(TS_RW_VB_SELECT_AND_LOAD_KERNEL), + ts_enum_to_name_pair(TS_VB_SELECT_AND_LOAD_KERNEL), + ts_enum_to_name_pair(TS_VB_EC_VBOOT_DONE), + ts_enum_to_name_pair(TS_VB_STORAGE_INIT_DONE), + ts_enum_to_name_pair(TS_VB_READ_KERNEL_DONE), + ts_enum_to_name_pair(TS_VB_VBOOT_DONE), + ts_enum_to_name_pair(TS_START_KERNEL), + ts_enum_to_name_pair(TS_KERNEL_DECOMPRESSION), +}; + #endif