From 95110d67f6c85ae3af5885ef19e6b5431a6602d6 Mon Sep 17 00:00:00 2001 From: "Chen, Gang G" Date: Tue, 15 Aug 2023 21:51:50 +0800 Subject: [PATCH] Suppress NVME logs for user build This can improve boot performance Tracked-On: OAM-111735 Signed-off-by: Chen, Gang G --- drivers/nvme/NvmExpress.h | 15 +++++++++++++++ libefiwrapper/ewdrv.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/nvme/NvmExpress.h b/drivers/nvme/NvmExpress.h index 7044801..f86302b 100644 --- a/drivers/nvme/NvmExpress.h +++ b/drivers/nvme/NvmExpress.h @@ -28,8 +28,23 @@ #define EFI_D_INFO "NVME Info: " #define EFI_D_ERROR "NVME Error: " +#ifdef DISABLE_DEBUG_PRINT +#define DEBUG_MESSAGES 0 +#else +#ifdef USER +#define DEBUG_MESSAGES 0 +#else +#define DEBUG_MESSAGES 1 +#endif +#endif + +#if DEBUG_MESSAGES #define nvme_dbg(a, ...) printf(a __VA_ARGS__) #define DEBUG_NVME(a) (nvme_dbg a) +#else +#define nvme_dbg(a, ...) +#define DEBUG_NVME(a) +#endif #define DEBUG_CODE_BEGIN() if (0) { #define DEBUG_CODE_END() } diff --git a/libefiwrapper/ewdrv.c b/libefiwrapper/ewdrv.c index 4aaa5f0..9f984f7 100644 --- a/libefiwrapper/ewdrv.c +++ b/libefiwrapper/ewdrv.c @@ -39,6 +39,8 @@ EFI_STATUS ewdrv_init(EFI_SYSTEM_TABLE *st) EFI_STATUS ret = EFI_SUCCESS; size_t i, j; + printf("ewdrv_init start\n"); + if (!ew_drivers) return EFI_UNSUPPORTED;