Skip to content

Commit

Permalink
chore: print DeviceDiscoverDriver's caller
Browse files Browse the repository at this point in the history
This prepends DEBUG print messages in the DeviceDiscoverDriver library
with the calling driver's name, to enable distinguishing where the
messages are coming from.

Example output:
TegraPwmDxe:DeviceDiscoveryStart, Failed supported check
QspiControllerDxe:DeviceDiscoveryStart, Failed supported check
TegraControllerEnableDxe:DeviceDiscoveryStart, failed to enable clocks Device Error
TegraControllerEnableDxe:DeviceDiscoveryStart, failed to deassert Pg 21: Device Error
TegraUartDxe:DeviceDiscoveryStart, Failed supported check

Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
Reviewed-by: Ashish Singhal <ashishsingha@nvidia.com>
  • Loading branch information
jeshuasmith authored and jgarver committed Jun 6, 2024
1 parent 81572c6 commit 7f2a749
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Device Discovery Driver Library private structures
Copyright (c) 2018-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -33,4 +33,16 @@ typedef struct {
IN NVIDIA_DEVICE_TREE_NODE_PROTOCOL *Node;
} NVIDIA_DEVICE_DISCOVERY_THREAD_CONTEXT;

// Make the DEBUG prints in this Library print the name of the Driver that called them
#ifdef _DEBUG_PRINT
#undef _DEBUG_PRINT
#define _DEBUG_PRINT(PrintLevel, ...) \
do { \
if (DebugPrintLevelEnabled (PrintLevel)) { \
DebugPrint (PrintLevel, "%a:", gEfiCallerBaseName); \
DebugPrint (PrintLevel, ##__VA_ARGS__); \
} \
} while (FALSE)
#endif

#endif

0 comments on commit 7f2a749

Please sign in to comment.