diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2014-03-27 16:13:16 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-04-03 14:54:26 -0500 |
commit | cadf4e34157e599e1352de1d93ec406f3a2759a9 (patch) | |
tree | dc672595fd53376a4f9632cdb5df48dd0e11ed44 /src/usr/errl/errludprintk.C | |
parent | 42a3149689b527253a20dd9067be38bcbc4855d5 (diff) | |
download | talos-hostboot-cadf4e34157e599e1352de1d93ec406f3a2759a9.tar.gz talos-hostboot-cadf4e34157e599e1352de1d93ec406f3a2759a9.zip |
Add printk error log UD and collect on task crash.
- Create a new UserDetails section for error log.
- Modify initservice utility for launching tasks (shared by
initservice and istepdispatcher) to collect this when a
task has crashed.
Change-Id: I1273457fcc3879b9e2ca91b636281225a8f79136
CQ: SW254145
Backport: release-fips810
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9985
Tested-by: Jenkins Server
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl/errludprintk.C')
-rw-r--r-- | src/usr/errl/errludprintk.C | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/usr/errl/errludprintk.C b/src/usr/errl/errludprintk.C new file mode 100644 index 000000000..f4838c7d2 --- /dev/null +++ b/src/usr/errl/errludprintk.C @@ -0,0 +1,49 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/errl/errludprintk.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2014 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include <errl/errludprintk.H> +#include <errl/errlreasoncodes.H> +#include <kernel/console.H> +#include <algorithm> +#include <string.h> + +namespace ERRORLOG +{ + + void ErrlUserDetailsPrintk::_capturePrintk(size_t i_size) + { + // Determine existing size of printk buffer. + size_t printkSize = strnlen(kernel_printk_buffer, Console::BUFFER_SIZE); + i_size = std::min(i_size, printkSize); + + // Copy trailing i_size to UD buffer. + uint8_t* buffer = reallocUsrBuf(i_size); + memcpy(buffer, &kernel_printk_buffer[printkSize - i_size], i_size); + + // Set up ErrlUserDetails instance variables. + iv_CompId = ERRL_COMP_ID; + iv_Version = 1; + iv_SubSection = ERRL_UDT_PRINTK; + + } + +}; |