diff options
Diffstat (limited to 'src/usr/trace/interface.C')
-rw-r--r-- | src/usr/trace/interface.C | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/usr/trace/interface.C b/src/usr/trace/interface.C index f7d8e68ff..af7040fdf 100644 --- a/src/usr/trace/interface.C +++ b/src/usr/trace/interface.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* Contributors Listed Below - COPYRIGHT 2012,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,10 +34,14 @@ #include <util/singleton.H> #include <stdarg.h> #include <limits.h> +#include <string.h> #include "compdesc.H" #include "service.H" +#if __HOSTBOOT_RUNTIME +#include "runtime/rt_rsvdtracebufservice.H" +#endif namespace TRACE { @@ -105,15 +109,31 @@ namespace TRACE void * o_data, size_t i_bufferSize ) { + size_t l_bufferSize(0); + ComponentDesc* l_comp = Singleton<ComponentList>::instance().getDescriptor(i_comp, 0); if (NULL == l_comp) { - return 0; +#if __HOSTBOOT_RUNTIME + // All the components will have a corresponding CompDescriptor, + // if buffer is created. RSVD_MEM_TRACE is a speacial case without + // a corresponding compDescriptor. Check for RSVD_MEM_TRACE, if + // not RSVD_MEM_TRACE then return 0. + if(strcmp( i_comp, "RSVD_MEM_TRACE") == 0) + { + l_bufferSize = Singleton<RsvdTraceBufService>:: + instance().getBuffer(o_data,i_bufferSize); + } +#endif } - return Singleton<Service>::instance().getBuffer(l_comp, + else + { + l_bufferSize = Singleton<Service>::instance().getBuffer(l_comp, o_data, i_bufferSize); + } + return l_bufferSize; } void flushBuffers() |