From 7cc8294252577238eb99bad42c3bc7dd92f4794d Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Sat, 23 Sep 2017 22:24:28 -0500 Subject: Debug improvements for exceptions and OOM hangs There are two main changes in this commit: 1) Forcing an assert if we cannot allocate pages after 10,000 attempts to yield. 2) Adding a backtrace for a lot of exception paths. Change-Id: I755ada753b78abed56e553f7c669f0f98ae68700 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58224 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Prachi Gupta Reviewed-by: Thi N. Tran Reviewed-by: William G. Hoffa --- src/include/kernel/misc.H | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/include/kernel/misc.H') diff --git a/src/include/kernel/misc.H b/src/include/kernel/misc.H index 4c570423a..26fde6528 100644 --- a/src/include/kernel/misc.H +++ b/src/include/kernel/misc.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -178,7 +178,7 @@ namespace KernelMisc */ void populate_cache_lines(uint64_t* i_start, uint64_t* i_end); - /** @fn set + /** @fn set scratch reg * * @brief Update value of scratch register to specified data. * @@ -195,5 +195,17 @@ namespace KernelMisc */ void updateScratchReg(MMIO_Scratch_Register scratch_addr, uint64_t data); + /** @fn Log backtrace to printk + * + * @brief Collect the backtrace for the given task and print an + * abbreviated version to the printk buffer. + * + * This can be used in task-crash paths for FFDC + * + * @param[in] task_t i_task - Task to operate against, + * if i_task==nullptr then call will use user-space interfaces + */ + void printkBacktrace(task_t* i_task); + }; #endif -- cgit v1.2.3