Update trace recorder code to the latest.

Some minor changes to enable the configREMOVE_STATIC_QUALIFIER constant to be used by those debuggers that cannot cope with statics being used.
This commit is contained in:
Richard Barry
2018-09-06 03:23:03 +00:00
parent 21a8ff35dd
commit be9c0730c3
25 changed files with 370 additions and 270 deletions

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcHardwarePort.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcPortDefines.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcRecorder.h
@@ -49,9 +49,9 @@
extern "C" {
#endif
#include <stdarg.h>
#include <stdint.h>
#include <stddef.h>
#include "trcConfig.h"
#include "trcPortDefines.h"
@@ -70,6 +70,9 @@ typedef uint8_t traceHandle;
#include "trcHardwarePort.h"
#include "trcKernelPort.h"
// Not available in snapshot mode
#define vTraceConsoleChannelPrintF(fmt, ...)
#endif
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
@@ -85,6 +88,9 @@ typedef const void* traceHandle;
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
/* The user event channel for recorder warnings, must be defined in trcKernelPort.c */
extern traceString trcWarningChannel;
#define TRACE_GET_LOW16(value) ((uint16_t)((value) & 0x0000FFFF))
#define TRACE_GET_HIGH16(value) ((uint16_t)(((value) >> 16) & 0x0000FFFF))
#define TRACE_SET_LOW16(current, value) (((current) & 0xFFFF0000) | (value))
@@ -237,6 +243,26 @@ void vTracePrint(traceString chn, const char* str);
#define vTracePrint(chn, ...) (void)chn
#endif
/*******************************************************************************
* vTraceConsoleChannelPrintF
*
* Wrapper for vTracePrint, using the default channel. Can be used as a drop-in
* replacement for printf and similar functions, e.g. in a debug logging macro.
*
* Example:
*
* // Old: #define LogString debug_console_printf
*
* // New, log to Tracealyzer instead:
* #define LogString vTraceConsoleChannelPrintF
* ...
* LogString("My value is: %d", myValue);
******************************************************************************/
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
void vTraceConsoleChannelPrintF(const char* fmt, ...);
#endif
/*******************************************************************************
* xTraceRegisterString
*
@@ -626,19 +652,19 @@ void vTraceClear(void);
/* This macro will create a task in the object table */
#undef trcKERNEL_HOOKS_TASK_CREATE
#define trcKERNEL_HOOKS_TASK_CREATE(SERVICE, CLASS, pxTCB) \
TRACE_SET_TASK_NUMBER(pxTCB); \
TRACE_SET_TASK_FILTER(pxTCB, CurrentFilterGroup); \
TRACE_SET_OBJECT_NUMBER(TASK, pxTCB); \
TRACE_SET_OBJECT_FILTER(TASK, pxTCB, CurrentFilterGroup); \
prvTraceSetObjectName(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_NAME(pxTCB)); \
prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_PRIORITY(pxTCB)); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));
/* This macro will remove the task and store it in the event buffer */
#undef trcKERNEL_HOOKS_TASK_DELETE
#define trcKERNEL_HOOKS_TASK_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, pxTCB) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \
prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \
prvTraceStoreObjectPropertiesOnCloseEvent(SERVICE_PROP, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \
@@ -653,7 +679,7 @@ void vTraceClear(void);
TRACE_SET_OBJECT_NUMBER(CLASS, pxObject);\
TRACE_SET_OBJECT_FILTER(CLASS, pxObject, CurrentFilterGroup); \
prvMarkObjectAsUsed(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));\
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \
prvTraceSetObjectState(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), 0);
@@ -661,7 +687,7 @@ void vTraceClear(void);
/* This macro will remove the object and store it in the event buffer */
#undef trcKERNEL_HOOKS_OBJECT_DELETE
#define trcKERNEL_HOOKS_OBJECT_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, CLASS, pxObject) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \
prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)); \
@@ -671,21 +697,33 @@ void vTraceClear(void);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE
#define trcKERNEL_HOOKS_KERNEL_SERVICE(SERVICE, CLASS, pxObject) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));
/* This macro will create a call to a kernel service with a certain result, with a null object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT
#define trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT(SERVICE, TRACECLASS) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACECLASS, 0);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM
#define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(SERVICE, CLASS, pxObject, param) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCallWithParam(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), (uint32_t)param);
/* This macro will create a call to a kernel service with a certain result, with a null object and other value as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT_WITH_PARAM
#define trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT_WITH_PARAM(SERVICE, TRACECLASS, param) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreKernelCallWithParam(SERVICE, TRACECLASS, 0, param);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY
#define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(SERVICE, param) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, (uint32_t)param);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */
@@ -713,14 +751,14 @@ void vTraceClear(void);
/* This macro will flag a certain task as a finished instance */
#undef trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED
#define trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceSetTaskInstanceFinished(TRACE_GET_TASK_NUMBER(TRACE_GET_CURRENT_TASK()));
#if (TRC_CFG_INCLUDE_READY_EVENTS == 1)
/* This macro will create an event to indicate that a task became Ready */
#undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE
#define trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE(pxTCB) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreTaskReady(TRACE_GET_TASK_NUMBER(pxTCB));
#else /*(TRC_CFG_INCLUDE_READY_EVENTS == 1)*/
#undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE
@@ -749,21 +787,21 @@ void vTraceClear(void);
/* This macro will create a task switch event to the currently executing task */
#undef trcKERNEL_HOOKS_TASK_SWITCH
#define trcKERNEL_HOOKS_TASK_SWITCH( pxTCB ) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreTaskswitch(TRACE_GET_TASK_NUMBER(pxTCB));
/* This macro will create an event to indicate that the task has been suspended */
#undef trcKERNEL_HOOKS_TASK_SUSPEND
#define trcKERNEL_HOOKS_TASK_SUSPEND(SERVICE, pxTCB) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \
prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB));
/* This macro will create an event to indicate that a task has called a wait/delay function */
#undef trcKERNEL_HOOKS_TASK_DELAY
#define trcKERNEL_HOOKS_TASK_DELAY(SERVICE, pxTCB, xValue) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
{ \
prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, xValue); \
prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB)); \
@@ -772,7 +810,7 @@ void vTraceClear(void);
/* This macro will create an event to indicate that a task has gotten its priority changed */
#undef trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE
#define trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(SERVICE, pxTCB, uxNewPriority) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
{ \
prvTraceStoreKernelCallWithParam(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), prvTraceGetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)));\
prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), (uint8_t)uxNewPriority); \
@@ -781,13 +819,13 @@ void vTraceClear(void);
/* This macro will create an event to indicate that the task has been resumed */
#undef trcKERNEL_HOOKS_TASK_RESUME
#define trcKERNEL_HOOKS_TASK_RESUME(SERVICE, pxTCB) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));
#undef trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR
#define trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR(SERVICE, pxTCB) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));
#if !defined TRC_CFG_INCLUDE_READY_EVENTS || TRC_CFG_INCLUDE_READY_EVENTS == 1
@@ -1732,6 +1770,8 @@ void prvProcessCommand(TracealyzerCommandType* cmd);
#define vTraceSetRecorderDataBuffer(pRecorderData)
#endif
#define vTraceConsoleChannelPrintF(fmt, ...)
#ifndef TRC_ALLOC_CUSTOM_BUFFER
#define TRC_ALLOC_CUSTOM_BUFFER(bufname)
#endif

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com
*
* trcConfig.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com
*
* trcSnapshotConfig.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com
*
* trcStreamingConfig.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.h

View File

@@ -40,7 +40,7 @@ static void itm_write_32(uint32_t data)
{
if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && // Trace enabled
(ITM->TCR & ITM_TCR_ITMENA_Msk) && // ITM enabled
(ITM->TER & (1UL << 0))) // ITM Port #0 enabled
(ITM->TER & (1UL << TRC_CFG_ITM_PORT))) // ITM port enabled
{
while (ITM->PORT[TRC_CFG_ITM_PORT].u32 == 0); // Block until room in ITM FIFO - This stream port is always in "blocking mode", since intended for high-speed ITM!
ITM->PORT[TRC_CFG_ITM_PORT].u32 = data; // Write the data

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.c

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.h

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.c

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingPort.h

View File

@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
Tracealyzer Recorder Library v4.1.0 for FreeRTOS
Tracealyzer Recorder Library for FreeRTOS
-------------------------------------------------------------------------------
Tracealyzer is a sophisticated tool for tracing and visualization
@@ -22,6 +22,26 @@ In case you have any questions, don't hesitate to contact support@percepio.com
Tracealyzer supports FreeRTOS v7.3 and newer, including Amazon FreeRTOS.
-------------------------------------------------------------------------------
Changes, v4.1.4 -> v4.1.5
- Fixed a bug in the ITM stream port, that required Port 0 to be enabled.
- Added missing include of stdio.h (needed by vTraceConsoleChannelPrintF).
- Moved standard includes from trcRecorder.h into the .c files needing them.
-------------------------------------------------------------------------------
Changes, v4.1.2 -> v4.1.4
- Fixed a compile error when certain FreeRTOS settings were used
- Disabled filter support for FreeRTOS v7.3 since it uses "char" for object id
-------------------------------------------------------------------------------
Changes, v4.1.0 -> v4.1.2
- Added vTraceConsoleChannelPrintF(...)
-------------------------------------------------------------------------------
Changes, v4.0.3 -> v4.1.0

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcKernelPort.c

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcSnapshotRecorder.c

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1
* Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com
*
* trcStreamingRecorder.c
@@ -48,6 +48,9 @@
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
#include <stdio.h>
#include <stdarg.h>
typedef struct{
uint16_t EventID;
uint16_t EventCount;
@@ -174,9 +177,6 @@ static uint16_t FormatVersion = 0x0004;
/* The number of events stored. Used as event sequence number. */
static uint32_t eventCounter = 0;
/* The user event channel for recorder warnings, defined in trcKernelPort.c */
extern char* trcWarningChannel;
/* Remembers if an earlier ISR in a sequence of adjacent ISRs has triggered a task switch.
In that case, vTraceStoreISREnd does not store a return to the previously executing task. */
int32_t isPendingContextSwitch = 0;
@@ -399,6 +399,37 @@ void vTracePrint(traceString chn, const char* str)
prvTraceStoreSimpleStringEventHelper(chn, str);
}
/*******************************************************************************
* vTraceConsoleChannelPrintF
*
* Wrapper for vTracePrint, using the default channel. Can be used as a drop-in
* replacement for printf and similar functions, e.g. in a debug logging macro.
*
* Example:
*
* // Old: #define LogString debug_console_printf
*
* // New, log to Tracealyzer instead:
* #define LogString vTraceConsoleChannelPrintF
* ...
* LogString("My value is: %d", myValue);
******************************************************************************/
void vTraceConsoleChannelPrintF(const char* fmt, ...)
{
va_list vl;
char tempBuf[60];
static traceString consoleChannel = NULL;
if (consoleChannel == NULL)
consoleChannel = xTraceRegisterString("Debug Console");
va_start(vl, fmt);
vsnprintf(tempBuf, 60, fmt, vl);
vTracePrint(consoleChannel, tempBuf);
va_end(vl);
}
/******************************************************************************
* vTracePrintF
*

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v3.1.2
* Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com
*
* trcConfig.h
@@ -41,7 +41,7 @@
*
* Tabs are used for indent in this file (1 tab = 4 spaces)
*
* Copyright Percepio AB, 2016.
* Copyright Percepio AB, 2018.
* www.percepio.com
******************************************************************************/

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Trace Recorder Library for Tracealyzer v3.1.2
* Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com
*
* trcSnapshotConfig.h
@@ -39,7 +39,7 @@
*
* Tabs are used for indent in this file (1 tab = 4 spaces)
*
* Copyright Percepio AB, 2017.
* Copyright Percepio AB, 2018.
* www.percepio.com
******************************************************************************/
@@ -113,8 +113,8 @@
#define TRC_CFG_NMUTEX 90
#define TRC_CFG_NTIMER 250
#define TRC_CFG_NEVENTGROUP 90
#define TRC_CFG_NSTREAMBUFFER 5
#define TRC_CFG_NMESSAGEBUFFER 5
#define TRC_CFG_NSTREAMBUFFER 50
#define TRC_CFG_NMESSAGEBUFFER 50
/******************************************************************************

View File

@@ -24,8 +24,6 @@
*
* 1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
@@ -140,6 +138,9 @@ used with multiple project configurations. If it is
/* Allows tests of trying to allocate more than the heap has free. */
#define configUSE_MALLOC_FAILED_HOOK 0
/* To test builds that remove the static qualifier for debug builds. */
#define portREMOVE_STATIC_QUALIFIER
#else
/* It is a good idea to define configASSERT() while developing. configASSERT()
uses the same semantics as the standard C assert() macro. Don't define

View File

@@ -73,8 +73,8 @@ or interrupt version of the queue send function should be used. */
* reference the subject timer in calls to other software timer API functions
* (for example, xTimerStart(), xTimerReset(), etc.).
*/
struct TimerDef_t;
typedef struct TimerDef_t * TimerHandle_t;
struct tmrTimerControl;
typedef struct tmrTimerControl * TimerHandle_t;
/*
* Defines the prototype to which timer callback functions must conform.

View File

@@ -399,6 +399,13 @@ when the scheduler is unsuspended. The pending ready list itself can only be
accessed from a critical section. */
PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE;
#if ( configGENERATE_RUN_TIME_STATS == 1 )
PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
#endif
/*lint -restore */
/*-----------------------------------------------------------*/
@@ -2900,9 +2907,6 @@ void vTaskSwitchContext( void )
#if ( configGENERATE_RUN_TIME_STATS == 1 )
{
PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
#else

View File

@@ -65,7 +65,7 @@ defining trmTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
#endif
/* The definition of the timers themselves. */
typedef struct TimerDef_t
typedef struct tmrTimerControl
{
const char *pcTimerName; /*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */