Percepio Trace Recorder
v4.6.6
|
Go to the documentation of this file.
15 #ifndef TRC_TIMESTAMP_H
16 #define TRC_TIMESTAMP_H
18 #if (TRC_USE_TRACEALYZER_RECORDER == 1)
20 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
50 #define TRC_TIMESTAMP_RECORD_SIZE (sizeof(TraceTimestamp_t))
55 typedef struct TraceTimestampBuffer
57 uint32_t buffer[(TRC_TIMESTAMP_RECORD_SIZE) /
sizeof(uint32_t)];
58 } TraceTimestampBuffer_t;
69 traceResult xTraceTimestampInitialize(TraceTimestampBuffer_t *pxBuffer);
71 #if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
163 #if ((TRC_HWTC_TYPE == TRC_FREE_RUNNING_32BIT_INCR) || (TRC_HWTC_TYPE == TRC_CUSTOM_TIMER_INCR))
164 #define xTraceTimestampGet(puiTimestamp) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4(*(puiTimestamp) = TRC_HWTC_COUNT, (*(puiTimestamp) < pxTraceTimestamp->latestTimestamp) ? pxTraceTimestamp->wraparounds++ : 0, pxTraceTimestamp->latestTimestamp = *(puiTimestamp), TRC_SUCCESS)
165 #elif ((TRC_HWTC_TYPE == TRC_FREE_RUNNING_32BIT_DECR) || (TRC_HWTC_TYPE == TRC_CUSTOM_TIMER_DECR))
166 #define xTraceTimestampGet(puiTimestamp) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4(*(puiTimestamp) = TRC_HWTC_COUNT, (*(puiTimestamp) > pxTraceTimestamp->latestTimestamp) ? pxTraceTimestamp->wraparounds++ : 0, pxTraceTimestamp->latestTimestamp = *(puiTimestamp), TRC_SUCCESS)
167 #elif ((TRC_HWTC_TYPE == TRC_OS_TIMER_INCR) || (TRC_HWTC_TYPE == TRC_OS_TIMER_DECR))
168 #define xTraceTimestampGet(puiTimestamp) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4(*(puiTimestamp) = ((TRC_HWTC_COUNT) & 0x00FFFFFFU) + ((pxTraceTimestamp->osTickCount & 0x000000FFU) << 24), pxTraceTimestamp->wraparounds = pxTraceTimestamp->osTickCount, pxTraceTimestamp->latestTimestamp = *(puiTimestamp), TRC_SUCCESS)
179 #define xTraceTimestampGetWraparounds(puiTimerWraparounds) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiTimerWraparounds) = pxTraceTimestamp->wraparounds, TRC_SUCCESS)
189 #define xTraceTimestampSetFrequency(uxFrequency) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTimestamp->frequency = uxFrequency, TRC_SUCCESS)
199 #define xTraceTimestampSetPeriod(uiPeriod) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTimestamp->period = uiPeriod, TRC_SUCCESS)
209 #define xTraceTimestampSetOsTickCount(uiOsTickCount) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTimestamp->osTickCount = uiOsTickCount, TRC_SUCCESS)
219 #define xTraceTimestampGetFrequency(puxFrequency) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puxFrequency) = pxTraceTimestamp->frequency, TRC_SUCCESS)
229 #define xTraceTimestampGetPeriod(puiPeriod) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiPeriod) = pxTraceTimestamp->period, TRC_SUCCESS)
239 #define xTraceTimestampGetOsTickCount(puiOsTickCount) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiOsTickCount) = pxTraceTimestamp->osTickCount, TRC_SUCCESS)
struct TraceTimestamp TraceTimestamp_t
Trace Timestamp Structure.
uint32_t period
Definition: trcTimestamp.h:41
#define xTraceTimestampGet(puiTimestamp)
Gets current trace timestamp.
Definition: trcTimestamp.h:164
#define xTraceTimestampGetPeriod(puiPeriod)
Gets trace timestamp period.
Definition: trcTimestamp.h:229
TraceUnsignedBaseType_t frequency
Definition: trcTimestamp.h:40
uint32_t wraparounds
Definition: trcTimestamp.h:42
#define xTraceTimestampGetWraparounds(puiTimerWraparounds)
Gets trace timestamp wraparounds.
Definition: trcTimestamp.h:179
uint32_t type
Definition: trcTimestamp.h:39
Trace Timestamp Structure.
Definition: trcTimestamp.h:38
uint32_t osTickHz
Definition: trcTimestamp.h:43
#define xTraceTimestampSetPeriod(uiPeriod)
Sets trace timestamp period.
Definition: trcTimestamp.h:199
#define xTraceTimestampGetFrequency(puxFrequency)
Gets trace timestamp frequency.
Definition: trcTimestamp.h:219
uint32_t osTickCount
Definition: trcTimestamp.h:45
#define xTraceTimestampGetOsTickCount(puiOsTickCount)
Gets trace timestamp OS tick count.
Definition: trcTimestamp.h:239
#define xTraceTimestampSetOsTickCount(uiOsTickCount)
Sets trace timestamp OS tick count.
Definition: trcTimestamp.h:209
#define xTraceTimestampSetFrequency(uxFrequency)
Sets trace timestamp frequency.
Definition: trcTimestamp.h:189
uint32_t latestTimestamp
Definition: trcTimestamp.h:44