From 815c6ac0bc104f5b1bc64273afaf0b9133a2aefe Mon Sep 17 00:00:00 2001 From: Doug Gilbert Date: Thu, 2 Jun 2016 15:41:34 -0500 Subject: Add PK_TRACE_CRIT and PK_TRACE_DBG_SUPPRESS trace directives Change-Id: Ie77655258f5d5b78da0e71a96a97ddf4b442af5a RTC: 154819 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25322 Tested-by: Jenkins Server Reviewed-by: YUE DU Reviewed-by: Gregory S. Still --- import/chips/p9/procedures/ppe/pk/kernel/pk_api.h | 40 +++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'import/chips/p9/procedures/ppe') diff --git a/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h b/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h index 4537f2f1..625dd65f 100644 --- a/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h +++ b/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h @@ -384,13 +384,44 @@ #define PK_TRACE_ENABLE 1 #endif +/// Enable PK crit (disabled by default) +#ifndef PK_TRACE_CRIT_ENABLE + #define PK_TRACE_CRIT_ENABLE 0 +#endif + +/// Enable Debug suppress (disabled by default) +// a.k.a. enabled means turn off PK_TRACE(), but keep crit trace +#ifndef PK_TRACE_DBG_SUPPRESS + #define PK_TRACE_DBG_SUPPRESS 0 +#endif + /// Enable PK kernel tracing (disabled by default) #ifndef PK_KERNEL_TRACE_ENABLE #define PK_KERNEL_TRACE_ENABLE 0 #endif -//Application trace macros +/// pk trace disabled implies no tracing at all +// override any other trace settings #if !PK_TRACE_ENABLE + #undef PK_TRACE_DBG_SUPPRESS + #undef PK_TRACE_CRIT_ENABLE + + #define PK_TRACE_DBG_SUPPRESS 1 + #define PK_TRACE_CRIT_ENABLE 0 +#endif + +// PK TRACE enabled & PK CRIT enabled implies all tracing on. +// PK TRACE enabled & PK DBUG disabled implies PK CRIT INFO tracing only. +// PK TRACE enable & pK CRIT INFO disabled && PK DBUG disabled implies +// PK TRACE disabled +#if PK_TRACE_ENABLE && PK_TRACE_DBG_SUPPRESS && !PK_TRACE_CRIT_ENABLE + #undef PK_TRACE_ENABLE + #define PK_TRACE_ENABLE 0 +#endif + + +//Application trace macros +#if PK_TRACE_DBG_SUPPRESS #define PK_TRACE(...) #define PK_TRACE_BIN(str, bufp, buf_size) #else @@ -398,6 +429,11 @@ #define PK_TRACE_BIN(str, bufp, buf_size) PKTRACE_BIN(str, bufp, buf_size) #endif +#if !PK_TRACE_CRIT_ENABLE + #define PK_TRACE_INF(...) +#else + #define PK_TRACE_INF(...) PKTRACE(__VA_ARGS__) +#endif //Kernel trace macros #if !PK_KERNEL_TRACE_ENABLE @@ -438,7 +474,7 @@ #define TINY_TRACE_ASM6() .error "too many parameters" #define TINY_TRACE_ASM7() .error "too many parameters" -//TODO: add support for tracing more than 1 parameter and binary data in assembly +//Possible enhancement: add support for tracing more than 1 parameter and binary data in assembly .global pk_trace_tiny -- cgit v1.2.1