Hi, Laszlo

I am ok with the format string change. 

I just have a concern about the DEBUG level change. According to comments, if 
debug msg impacts boot performance, we should use DEBUG_VERBOSE. Does it impact 
OVMF boot performance significantly? If yes, I agree to change it to VERBOSE. 
Otherwise, I would suggest to keep INFO level.

Others look good to me, Reviewed-by: Feng Tian <feng.t...@intel.com> 

#define DEBUG_INFO          0x00000040  // Informational debug messages
#define DEBUG_VERBOSE   0x00400000  // Detailed debug messages that may 
significantly impact boot performance

Thanks
Feng

-----Original Message-----
From: Laszlo Ersek [mailto:ler...@redhat.com] 
Sent: Wednesday, January 27, 2016 10:36
To: edk2-de...@ml01.01.org
Cc: Tian, Feng
Subject: [PATCH 1/3] MdeModulePkg: NvmExpressDxe: clean up NvmeRead() / 
NvmeWrite() debug msgs

These workhorse functions are part of the BlockIo protocol that NvmExpressDxe 
produces. For bulk data access, they are called very frequently. Their debug 
messages should be therefore downgraded to EFI_D_VERBOSE.

In addition, the following DEBUG() warts are cleaned up:

- The function name should be printed with %a / __FUNCTION__, so that
  renaming the function, or copying the DEBUG() elsewhere, be reflected in
  the debug output automatically. (In fact, after this patch, the DEBUG()
  calls become identical.)

- "Lba" is of type UINT64, therefore it should be printed with %Lx, not
  %x.

- "OrginalBlocks" and "Blocks" are both UINTN. The only portable way to
  print UINTN is to convert it to UINT64 manually, then format it with the
  %Lx (or %Lu) conversion specifier.

Cc: Feng Tian <feng.t...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c 
b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
index 2af2df7..5ac9074 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
@@ -198,7 +198,9 @@ NvmeRead (
     }
   }
 
-  DEBUG ((EFI_D_INFO, "NvmeRead()  Lba = 0x%08x, Original = 0x%08x, Remaining 
= 0x%08x, BlockSize = 0x%x Status = %r\n", Lba, OrginalBlocks, Blocks, 
BlockSize, Status));
+  DEBUG ((EFI_D_VERBOSE, "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
+    "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n", __FUNCTION__, Lba,
+    (UINT64)OrginalBlocks, (UINT64)Blocks, BlockSize, Status));
 
   return Status;
 }
@@ -257,7 +259,9 @@ NvmeWrite (
     }
   }
 
-  DEBUG ((EFI_D_INFO, "NvmeWrite() Lba = 0x%08x, Original = 0x%08x, Remaining 
= 0x%08x, BlockSize = 0x%x Status = %r\n", Lba, OrginalBlocks, Blocks, 
BlockSize, Status));
+  DEBUG ((EFI_D_VERBOSE, "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
+    "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n", __FUNCTION__, Lba,
+    (UINT64)OrginalBlocks, (UINT64)Blocks, BlockSize, Status));
 
   return Status;
 }
--
1.8.3.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to