summaryrefslogtreecommitdiffstats
path: root/src/usr/trace/bufferpage.C
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2017-10-03 11:02:13 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-10-19 22:17:55 -0400
commitad1909dedffab93922fe80f06bf89d5b76d9e9a0 (patch)
treea244fa143b4463dc2f51b742d606a64cefd1548a /src/usr/trace/bufferpage.C
parent20250c0b1f6de53b2bfddd1c714fb8c97e655ce2 (diff)
downloadtalos-hostboot-ad1909dedffab93922fe80f06bf89d5b76d9e9a0.tar.gz
talos-hostboot-ad1909dedffab93922fe80f06bf89d5b76d9e9a0.zip
Log traces to error logs in HBRT
This enables buffer tracing at hostboot runtime. Will add these traces to runtime errors for better debug Change-Id: I795bb7deafdd02adea4588ebf8dfb11cbce116a0 RTC:172770 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48084 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/trace/bufferpage.C')
-rw-r--r--src/usr/trace/bufferpage.C20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/usr/trace/bufferpage.C b/src/usr/trace/bufferpage.C
index 00b9ff447..c6cfb57e0 100644
--- a/src/usr/trace/bufferpage.C
+++ b/src/usr/trace/bufferpage.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -25,7 +27,11 @@
#include <limits.h>
#include <stdlib.h>
+#include <string.h>
+
+#ifndef __HOSTBOOT_RUNTIME
#include <kernel/pagemgr.H>
+#endif
namespace TRACE
{
@@ -60,7 +66,11 @@ namespace TRACE
{
BufferPage* page = NULL;
+#ifndef __HOSTBOOT_RUNTIME
page = reinterpret_cast<BufferPage*>(PageManager::allocatePage());
+#else
+ page = reinterpret_cast<BufferPage*>(malloc(PAGESIZE));
+#endif
memset(page, '\0', PAGESIZE);
if (i_common)
@@ -73,7 +83,15 @@ namespace TRACE
void BufferPage::deallocate(BufferPage* i_page)
{
+#ifndef __HOSTBOOT_RUNTIME
PageManager::freePage(i_page);
+#else
+ if (i_page != nullptr)
+ {
+ free(i_page);
+ i_page = nullptr;
+ }
+#endif
}
}
OpenPOWER on IntegriCloud