Update FreeRTOS+Trace recorder code.

This commit is contained in:
Richard Barry 2013-07-16 11:55:14 +00:00
parent 7d1292ced2
commit 0fd81d6d8e
14 changed files with 181 additions and 160 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Tracealyzer v2.4.1 Recorder Library
* Tracealyzer v2.5.0 Recorder Library
* Percepio AB, www.percepio.com
*
* trcBase.h
@ -183,11 +183,18 @@ typedef struct
uint16_t dts; /* differential timestamp - time since last event */
} TSEvent, TREvent;
typedef struct
{
uint8_t type;
uint8_t dummy;
uint16_t dts; /* differential timestamp - time since last event */
} LPEvent;
typedef struct
{
uint8_t type;
uint8_t objHandle;
uint16_t dts;
uint16_t dts; /* differential timestamp - time since last event */
} KernelCall;
typedef struct
@ -195,13 +202,13 @@ typedef struct
uint8_t type;
objectHandleType objHandle;
uint8_t param;
uint8_t dts;
uint8_t dts; /* differential timestamp - time since last event */
} KernelCallWithParamAndHandle;
typedef struct
{
uint8_t type;
uint8_t dts;
uint8_t dts; /* differential timestamp - time since last event */
uint16_t param;
} KernelCallWithParam16;
@ -449,14 +456,6 @@ uint16_t uiIndexOfObject(objectHandleType objecthandle,
******************************************************************************/
void vTraceError(const char* msg);
/*******************************************************************************
* xTraceGetLastError
*
* Gives the last error message, if any. NULL if no error message is stored.
* The message is cleared on read.
******************************************************************************/
char* xTraceGetLastError(void);
/*******************************************************************************
* prvTraceInitTraceData
*

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Tracealyzer v2.4.1 Recorder Library
* Tracealyzer v2.5.0 Recorder Library
* Percepio AB, www.percepio.com
*
* trcKernel.h
@ -48,6 +48,8 @@
void vTraceStoreTaskReady(objectHandleType handle);
#endif
void vTraceStoreLowPower(uint32_t flag);
void vTraceStoreTaskswitch(objectHandleType task_handle);
void vTraceStoreKernelCall(uint32_t eventcode, traceObjectClass objectClass, uint32_t byteParam);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Tracealyzer v2.4.1 Recorder Library
* Tracealyzer v2.5.0 Recorder Library
* Percepio AB, www.percepio.com
*
* trcKernelHooks.h

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Tracealyzer v2.4.1 Recorder Library
* Tracealyzer v2.5.0 Recorder Library
* Percepio AB, www.percepio.com
*
* trcKernelPort.h
@ -47,10 +47,7 @@
/* Defines that must be set for the recorder to work properly */
#define TRACE_KERNEL_VERSION 0x1AA1
#define TRACE_CPU_CLOCK_HZ configCPU_CLOCK_HZ /* Defined in "FreeRTOS.h" */
#define TRACE_PERIPHERAL_CLOCK_HZ configPERIPHERAL_CLOCK_HZ /* Defined in "FreeRTOS.h" */
#define TRACE_TICK_RATE_HZ configTICK_RATE_HZ /* Defined in "FreeRTOS.h" */
#define TRACE_CPU_CLOCKS_PER_TICK configCPU_CLOCKS_PER_TICK /* Defined in "FreeRTOS.h" */
/************************************************************************/
/* KERNEL SPECIFIC OBJECT CONFIGURATION */
@ -99,12 +96,16 @@
/* Includes */
#include "trcTypes.h"
#include "trcConfig.h"
#include "trcHooks.h"
#include "trcKernelHooks.h"
#include "trcHardwarePort.h"
#include "trcBase.h"
#include "trcKernel.h"
#include "trcUser.h"
#if (INCLUDE_NEW_TIME_EVENTS == 1 && configUSE_TICKLESS_IDLE != 0)
#error "NewTime events can not be used in combination with tickless idle!"
#endif
/* Initialization of the object property table */
void vTraceInitObjectPropertyTable(void);
@ -296,6 +297,9 @@ const char* pszTraceGetErrorNotEnoughHandles(traceObjectClass objectclass);
#define RESERVED_DUMMY_CODE (EVENTGROUP_SYS + 3) /*0xAB*/
#define LOW_POWER_BEGIN (EVENTGROUP_SYS + 4) /*0xAC*/
#define LOW_POWER_END (EVENTGROUP_SYS + 5) /*0xAD*/
/************************************************************************/
@ -360,12 +364,34 @@ void* prvTraceGetCurrentTaskHandle(void);
#define TRACE_GET_OBJECT_EVENT_CODE(SERVICE, RESULT, CLASS, pxObject) (uint8_t)(EVENTGROUP_##SERVICE##_##RESULT + TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject))
#define TRACE_GET_TASK_EVENT_CODE(SERVICE, RESULT, CLASS, pxTCB) (EVENTGROUP_##SERVICE##_##RESULT + TRACE_CLASS_TASK)
/************************************************************************/
/* KERNEL SPECIFIC WRAPPERS THAT SHOULD BE CALLED BY THE KERNEL */
/************************************************************************/
#if (configUSE_TICKLESS_IDLE != 0)
#undef traceLOW_POWER_IDLE_BEGIN
#define traceLOW_POWER_IDLE_BEGIN() \
{ \
extern uint32_t trace_disable_timestamp; \
vTraceStoreLowPower(0); \
trace_disable_timestamp = 1; \
}
#undef traceLOW_POWER_IDLE_END
#define traceLOW_POWER_IDLE_END() \
{ \
extern uint32_t trace_disable_timestamp; \
trace_disable_timestamp = 0; \
vTraceStoreLowPower(1); \
}
/* A macro that will update the tick count when returning from tickless idle */
#undef traceINCREASE_TICK_COUNT( xCount )
#define traceINCREASE_TICK_COUNT( xCount ) { extern uint32_t uiTraceTickCount; uiTraceTickCount += xTickCount; }
#endif
/* Called for each task that becomes ready */
#undef traceMOVED_TASK_TO_READY_STATE
#define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Tracealyzer v2.4.1 Recorder Library
* Tracealyzer v2.5.0 Recorder Library
* Percepio AB, www.percepio.com
*
* trcTypes.h

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Tracealyzer v2.4.1 Recorder Library
* Tracealyzer v2.5.0 Recorder Library
* Percepio AB, www.percepio.com
*
* trcUser.h
@ -109,18 +109,6 @@ uint32_t uiTraceStart(void);
******************************************************************************/
void vTraceStart(void);
/*******************************************************************************
* vTraceStartStatusMonitor
*
* This starts a task to monitor the status of the recorder module.
* This task periodically prints a line to the console window, which shows the
* recorder status, the number of events recorded and the latest timestamp.
* This task calls vTracePortEnd (trcHardwarePort.c) when it detects that the
* recorder has been stopped. This allows for adding custom actions, e.g., to
* store the trace to a file in case a file system is available on the device.
******************************************************************************/
void vTraceStartStatusMonitor(void);
/*******************************************************************************
* vTraceStop
*
@ -129,6 +117,14 @@ void vTraceStartStatusMonitor(void);
******************************************************************************/
void vTraceStop(void);
/*******************************************************************************
* xTraceGetLastError
*
* Gives the last error message, if any. NULL if no error message is stored.
* Any error message is also presented when opening a trace file.
******************************************************************************/
char* xTraceGetLastError(void);
/*******************************************************************************
* vTraceClear
*
@ -137,6 +133,16 @@ void vTraceStop(void);
******************************************************************************/
void vTraceClear(void);
/*******************************************************************************
* vTraceClearError
*
* Removes any previous error message generated by recorder calling vTraceError.
* By calling this function, it may be possible to start/restart the trace
* despite errors in the recorder, but there is no guarantee that the trace
* recorder will work correctly in that case, depending on the type of error.
******************************************************************************/
void vTraceClearError(int resetErrorMessage);
#if (INCLUDE_ISR_TRACING == 1)
/*******************************************************************************