diff options
| author | William Bryan <wilbryan@us.ibm.com> | 2016-04-18 17:07:34 -0500 |
|---|---|---|
| committer | William A. Bryan <wilbryan@us.ibm.com> | 2016-06-13 19:18:11 -0400 |
| commit | a12f5be3e904bf5bb7aabb978f5e4d0cf1e8b969 (patch) | |
| tree | 08e5fe4298b301d7441bbb4d450432651aefc5e6 /src/ssx/trace | |
| parent | dd417235fda3a7086940b974780193e51370367c (diff) | |
| download | talos-occ-a12f5be3e904bf5bb7aabb978f5e4d0cf1e8b969.tar.gz talos-occ-a12f5be3e904bf5bb7aabb978f5e4d0cf1e8b969.zip | |
Update SSX to latest in EKB
RTC: 132999
Change-Id: I29478c074e3086e0bf09b402d55782e03cb1f787
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23394
Tested-by: FSP CI Jenkins
Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
Diffstat (limited to 'src/ssx/trace')
| -rw-r--r-- | src/ssx/trace/Makefile | 2 | ||||
| -rw-r--r-- | src/ssx/trace/ssx_trace.h | 58 | ||||
| -rw-r--r-- | src/ssx/trace/ssx_trace_big.c | 5 | ||||
| -rw-r--r-- | src/ssx/trace/ssx_trace_binary.c | 2 | ||||
| -rw-r--r-- | src/ssx/trace/ssx_trace_core.c | 13 | ||||
| -rw-r--r-- | src/ssx/trace/ssxtracefiles.mk | 2 |
6 files changed, 43 insertions, 39 deletions
diff --git a/src/ssx/trace/Makefile b/src/ssx/trace/Makefile index 5506b32..a822a78 100644 --- a/src/ssx/trace/Makefile +++ b/src/ssx/trace/Makefile @@ -5,7 +5,7 @@ # # OpenPOWER OnChipController Project # -# Contributors Listed Below - COPYRIGHT 2015 +# Contributors Listed Below - COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # diff --git a/src/ssx/trace/ssx_trace.h b/src/ssx/trace/ssx_trace.h index 3f4505f..6a2c3e6 100644 --- a/src/ssx/trace/ssx_trace.h +++ b/src/ssx/trace/ssx_trace.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -32,24 +32,24 @@ /// \file ssx_trace.h /// \brief Macros and declarations for the SSX Firmware Tracing Facility. -/// +/// #include <stdint.h> #define SSX_TRACE_VERSION 2 #ifndef SSX_TRACE_SZ -#define SSX_TRACE_SZ 256 + #define SSX_TRACE_SZ 256 #endif //Fail compilation if size is not a power of 2 #if ((SSX_TRACE_SZ - 1) & SSX_TRACE_SZ) -#error "SSX_TRACE_SZ is not a power of two!!!" + #error "SSX_TRACE_SZ is not a power of two!!!" #endif //Fail compilation if size is smaller than 64 bytes #if (SSX_TRACE_SZ < 64) -#error "SSX_TRACE_SZ must be at least 64 bytes!!!" + #error "SSX_TRACE_SZ must be at least 64 bytes!!!" #endif //Mask for calculating offsets into the trace circular buffer @@ -61,9 +61,9 @@ #define PPC_IMG_STRING STRINGIFY(IMAGE_NAME) #ifdef SSX_TRACE_HASH_PREFIX -#if (SSX_TRACE_HASH_PREFIX > 0xffff) -#error SSX_TRACE_HASH_PREFIX must be defined as a 16 bit constant value -#endif + #if (SSX_TRACE_HASH_PREFIX > 0xffff) + #error SSX_TRACE_HASH_PREFIX must be defined as a 16 bit constant value + #endif #endif //SSX_TRACE_HASH_PREFIX //This provides a 128ns tick (assuming a 32ns clock period) @@ -94,7 +94,7 @@ //are out of order it will result in a very large difference. To solve this //problem, any time that the parser code sees a very large difference (larger //than SSX_TRACE_MTBT) it will treat it as a negative number. -#define SSX_TRACE_MTBT (0xfffffffful - 31250000) +#define SSX_TRACE_MTBT (0xfffffffful - 31250000) #define SSX_TRACE_MAX_PARMS 4 @@ -107,9 +107,9 @@ //(The trace version does not need to change if this changes as long // as it remains less than SSX_TRACE_MAX_BINARY) #if (SSX_TRACE_SZ <= 256) -#define SSX_TRACE_CLIPPED_BINARY_SZ SSX_TRACE_SZ / 2 + #define SSX_TRACE_CLIPPED_BINARY_SZ SSX_TRACE_SZ / 2 #else -#define SSX_TRACE_CLIPPED_BINARY_SZ SSX_TRACE_MAX_BINARY + #define SSX_TRACE_CLIPPED_BINARY_SZ SSX_TRACE_MAX_BINARY #endif //Trace formats that are supported @@ -119,7 +119,7 @@ typedef enum SSX_TRACE_FORMAT_TINY, SSX_TRACE_FORMAT_BIG, SSX_TRACE_FORMAT_BINARY, -}SsxTraceFormat; +} SsxTraceFormat; //This combines the timestamp and the format bits into a //single 32 bit word. @@ -127,11 +127,13 @@ typedef union { struct { - uint32_t timestamp : SSX_TRACE_TS_BITS; - uint32_t format : SSX_TRACE_FORMAT_BITS; + uint32_t timestamp : + SSX_TRACE_TS_BITS; + uint32_t format : + SSX_TRACE_FORMAT_BITS; }; uint32_t word32; -}SsxTraceTime; +} SsxTraceTime; //SSX trace uses a 16 bit string format hash value typedef uint16_t SsxTraceHash; @@ -146,7 +148,7 @@ typedef union uint16_t parm; }; uint32_t word32; -}SsxTraceTinyParms; +} SsxTraceTinyParms; //A tiny trace fits within a single 8 byte word. This includes //the timestamp, format bits, hash id, and a 16 bit parameter. @@ -155,10 +157,10 @@ typedef union struct { SsxTraceTinyParms parms; - SsxTraceTime time_format; + SsxTraceTime time_format; }; uint64_t word64; -}SsxTraceTiny; +} SsxTraceTiny; //Larger traces that require a 32 bit parameter or more than one //parameter use the big trace format. The number of parms and @@ -174,17 +176,17 @@ typedef union uint8_t num_parms; }; uint32_t word32; -}SsxTraceBigParms; +} SsxTraceBigParms; typedef union { struct { SsxTraceBigParms parms; - SsxTraceTime time_format; + SsxTraceTime time_format; }; uint64_t word64; -}SsxTraceBig; +} SsxTraceBig; //Binary traces are handled in a similar fashion to big traces, except //that instead of having a number of parameters, we have number of bytes. @@ -197,7 +199,7 @@ typedef union uint8_t num_bytes; }; uint32_t word32; -}SsxTraceBinaryParms; +} SsxTraceBinaryParms; typedef union { @@ -207,7 +209,7 @@ typedef union SsxTraceTime time_format; }; uint64_t word64; -}SsxTraceBinary; +} SsxTraceBinary; //This is a generic structure that can be used to retrieve data //for tiny, big, and binary formatted entries. @@ -228,7 +230,7 @@ typedef union SsxTraceTime time_format; }; uint64_t word64; -}SsxTraceGeneric; +} SsxTraceGeneric; //This is a format that might be used in the future for tracing //a 64 bit timestamp so that we don't fill up the buffer with periodic @@ -242,7 +244,7 @@ typedef union SsxTraceTime time_format; }; uint64_t word64; -}SsxTraceTime64; +} SsxTraceTime64; #endif //It would probably be more accurate to call this a footer since it @@ -255,7 +257,7 @@ typedef union SsxTraceBinary binary; SsxTraceBig big; SsxTraceTiny small; -}SsxTraceEntryFooter; +} SsxTraceEntryFooter; //This is the data that is updated (in the buffer header) every time we add @@ -268,7 +270,7 @@ typedef union uint32_t offset; }; uint64_t word64; -}SsxTraceState; +} SsxTraceState; #define SSX_TRACE_IMG_STR_SZ 16 @@ -296,7 +298,7 @@ typedef struct //circular trace buffer uint8_t cb[SSX_TRACE_SZ]; -}SsxTraceBuffer; +} SsxTraceBuffer; extern SsxTraceBuffer g_ssx_trace_buf; extern size_t g_ssx_trace_buf_size; diff --git a/src/ssx/trace/ssx_trace_big.c b/src/ssx/trace/ssx_trace_big.c index 4a9bdb5..49e03be 100644 --- a/src/ssx/trace/ssx_trace_big.c +++ b/src/ssx/trace/ssx_trace_big.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,7 +41,7 @@ #if (SSX_TRACE_SUPPORT && SSX_TIMER_SUPPORT) void ssx_trace_big(uint32_t i_hash_and_count, - uint64_t i_parm1, uint64_t i_parm2) + uint64_t i_parm1, uint64_t i_parm2) { SsxTraceBig footer; SsxTraceBig* footer_ptr; @@ -100,6 +100,7 @@ void ssx_trace_big(uint32_t i_hash_and_count, footer_ptr = (SsxTraceBig*)ptr64; ptr64 = (uint64_t*)&g_ssx_trace_buf.cb[cur_offset & SSX_TRACE_CB_MASK]; *ptr64 = i_parm1; + if(parm_size > 8) { ptr64 = (uint64_t*)&g_ssx_trace_buf.cb[(cur_offset + 8) & SSX_TRACE_CB_MASK]; diff --git a/src/ssx/trace/ssx_trace_binary.c b/src/ssx/trace/ssx_trace_binary.c index f1d1db6..fd80907 100644 --- a/src/ssx/trace/ssx_trace_binary.c +++ b/src/ssx/trace/ssx_trace_binary.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/ssx/trace/ssx_trace_core.c b/src/ssx/trace/ssx_trace_core.c index de9d309..10f323f 100644 --- a/src/ssx/trace/ssx_trace_core.c +++ b/src/ssx/trace/ssx_trace_core.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -46,7 +46,8 @@ void ssx_trace_timer_callback(void* arg); #if (SSX_TRACE_SUPPORT && SSX_TIMER_SUPPORT) //Static initialization of the trace timer -SsxTimer g_ssx_trace_timer = { +SsxTimer g_ssx_trace_timer = +{ .deque = SSX_DEQUE_ELEMENT_INIT(), .timeout = 0, .callback = ssx_trace_timer_callback, @@ -89,7 +90,7 @@ void ssx_trace_tiny(uint32_t i_parm) tb64 = ssx_ext_timebase_get(); state.tbu32 = tb64 >> 32; footer.time_format.word32 = tb64 & 0x00000000ffffffffull; - + footer.time_format.format = SSX_TRACE_FORMAT_TINY; //The following operations must be done atomically @@ -124,8 +125,8 @@ void ssx_trace_timer_callback(void* arg) // restart the timer ssx_timer_schedule(&g_ssx_trace_timer, - SSX_TRACE_TIMER_PERIOD, - 0); + SSX_TRACE_TIMER_PERIOD, + 0); } // Use this function to synchronize the timebase between multiple Processors. @@ -163,7 +164,7 @@ void ssx_trace_init(uint32_t timebase_frequency_hz, } ////Needed for easy cache flush of trace buffer -size_t g_ssx_trace_buf_size=sizeof(g_ssx_trace_buf); +size_t g_ssx_trace_buf_size = sizeof(g_ssx_trace_buf); #endif diff --git a/src/ssx/trace/ssxtracefiles.mk b/src/ssx/trace/ssxtracefiles.mk index dc3d058..46949cd 100644 --- a/src/ssx/trace/ssxtracefiles.mk +++ b/src/ssx/trace/ssxtracefiles.mk @@ -5,7 +5,7 @@ # # OpenPOWER OnChipController Project # -# Contributors Listed Below - COPYRIGHT 2015 +# Contributors Listed Below - COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # |

