Skip to content

Commit

Permalink
PRD: Add code location data to errorlog for asserts
Browse files Browse the repository at this point in the history
Change-Id: I07c23f7ef0e3d5d783d1576f708cde6c91de06f8
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40936
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41488
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
  • Loading branch information
bweisenb authored and zane131 committed Jun 8, 2017
1 parent 4fe8759 commit a1e1b50
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/usr/diag/prdf/common/util/prdfAssert.C
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ void prdfAssert( const char * i_exp, const char * i_file, int i_line )
PRDF_SET_RC(errl, PRD_ASSERT);
PRDF_COLLECT_TRACE(errl, 256);
PRDF_SET_TERM_STATE( errl );

const size_t sz_msg = 256;
char msg[sz_msg];
size_t msize = snprintf( msg, sz_msg, "prdfAssert(%s) in %s line %d",
i_exp, i_file, i_line );

PRDF_ADD_FFDC( errl, msg, msize, ErrlVer1, ErrlString);
PRDF_COMMIT_ERRL(errl, ERRL_ACTION_SA);

#ifdef __HOSTBOOT_MODULE
Expand All @@ -97,11 +104,6 @@ void prdfAssert( const char * i_exp, const char * i_file, int i_line )

#else

const size_t sz_msg = 160;
char msg[sz_msg];
errlslen_t msize = snprintf( msg, sz_msg, "prdfAssert(%s) in %s line %d",
i_exp, i_file, i_line );

percAbend(PRDF_COMP_ID, msg, msize+1, 0, 0);
abort();

Expand Down

0 comments on commit a1e1b50

Please sign in to comment.