From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Murray Date: Wed, 31 Aug 2011 23:20:56 +0100 Subject: [U-Boot] [PATCH 2/7] Add macros for recording init calls during UBoot execution In-Reply-To: <1314829261-13996-1-git-send-email-amurray@theiet.org> References: <1314829261-13996-1-git-send-email-amurray@theiet.org> Message-ID: <1314829261-13996-3-git-send-email-amurray@theiet.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Andrew Murray This patch adds macros which allow for the instrumentation of UBoot boot time. The macros can be used to call existing initialisation functions during start up. Each macro adds printf statements before and after the initialisation call. Signed-off-by: Andrew Murray --- include/common.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/include/common.h b/include/common.h index 1e21b7a..aa21b10 100644 --- a/include/common.h +++ b/include/common.h @@ -176,6 +176,29 @@ typedef void (interrupt_handler_t)(void *); #endif /* CONFIG_SERIAL_MULTI */ +#if defined(CONFIG_BOOT_TRACE) +#define DO_INITCALL(x, ...) \ + do { \ + printf("calling 0x%pF\n", x); \ + (x)(__VA_ARGS__); \ + printf("initcall 0x%pF returned\n", x); \ + } while (0) +#define DO_INITCALL_RET(x, ret, ...) \ + do { \ + printf("calling 0x%pF\n", x); \ + ret = (x)(__VA_ARGS__); \ + printf("initcall 0x%pF returned\n", x); \ + } while (0) +#define DO_INITCALL_END(x) \ + printf("initcall 0x%pF returned\n", x) +#else +#define DO_INITCALL(x, ...) \ + (x)(__VA_ARGS__) +#define DO_INITCALL_RET(x, ret, ...) \ + ret = (x)(__VA_ARGS__) +#define DO_INITCALL_END(x) +#endif + /* * General Purpose Utilities */ -- 1.7.4.1