mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-02-20 09:05:30 -05:00
Update FreeRTOS+Trace recorder library to v3.0.2
Add streaming version of the FreeRTOS+Trace recorder, also V3.0.2
This commit is contained in:
parent
f218cf5680
commit
96ff3925d2
32 changed files with 6067 additions and 123 deletions
|
|
@ -1,10 +1,10 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcKernel.c
|
||||
* trcBase.h
|
||||
*
|
||||
* Functions used by trcKernelHooks.h for storing various kernel events.
|
||||
* Core functionality of the Tracealyzer recorder library.
|
||||
*
|
||||
* Terms of Use
|
||||
* This software is copyright Percepio AB. The recorder library is free for
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2014.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
@ -65,8 +65,10 @@
|
|||
/* Max number of event codes supported */
|
||||
#define NEventCodes 0x100
|
||||
|
||||
extern volatile int recorder_busy; // This is used to keep track of the recorder's critical sections, to determine if it is busy
|
||||
// Our local critical sections for the recorder - updates an internal busy flag
|
||||
/* Keeps track of the recorder's critical sections */
|
||||
extern volatile int recorder_busy;
|
||||
|
||||
/* Our local critical sections for the recorder */
|
||||
#define trcCRITICAL_SECTION_BEGIN() {TRACE_ENTER_CRITICAL_SECTION(); recorder_busy++;}
|
||||
#define trcCRITICAL_SECTION_END() {recorder_busy--; TRACE_EXIT_CRITICAL_SECTION();}
|
||||
|
||||
|
|
@ -145,7 +147,7 @@ typedef struct
|
|||
|
||||
/* This is used to calculate the index in the dynamic object table
|
||||
(handle - 1 - nofStaticObjects = index)*/
|
||||
#if (USE_16BIT_OBJECT_HANDLES == 1)
|
||||
#if (USE_16BIT_OBJECT_HANDLES == 1)
|
||||
objectHandleType NumberOfObjectsPerClass[2*((TRACE_NCLASSES+1)/2)];
|
||||
#else
|
||||
objectHandleType NumberOfObjectsPerClass[4*((TRACE_NCLASSES+3)/4)];
|
||||
|
|
@ -242,7 +244,7 @@ typedef struct
|
|||
uint8_t type;
|
||||
uint8_t unused1;
|
||||
uint8_t unused2;
|
||||
uint8_t dts;
|
||||
uint8_t dts;
|
||||
} TaskInstanceStatusEvent;
|
||||
|
||||
typedef struct
|
||||
|
|
@ -335,7 +337,7 @@ typedef struct
|
|||
/* Used to determine Kernel and Endianess */
|
||||
uint16_t version;
|
||||
|
||||
/* Currently 3, since v2.6.0 */
|
||||
/* Currently 3 */
|
||||
uint8_t minor_version;
|
||||
|
||||
/* This should be 0 if lower IRQ priority values implies higher priority
|
||||
|
|
@ -374,7 +376,7 @@ typedef struct
|
|||
|
||||
/* Not used, remains for compatibility and future use */
|
||||
uint8_t notused[28];
|
||||
|
||||
|
||||
/* The amount of heap memory remaining at the last malloc or free event */
|
||||
uint32_t heapMemUsage;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcHardwarePort.h
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2014.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcKernel.h
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
* damages, or the exclusion of implied warranties or limitations on how long an
|
||||
* implied warranty may last, so the above limitations may not apply to you.
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2013.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcKernelHooks.h
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
* damages, or the exclusion of implied warranties or limitations on how long an
|
||||
* implied warranty may last, so the above limitations may not apply to you.
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2013.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcKernelPortFreeRTOS.h
|
||||
* trcKernelPort.h
|
||||
*
|
||||
* Kernel-specific functionality for FreeRTOS, used by the recorder library.
|
||||
*
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2014.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
@ -56,16 +56,21 @@ extern int uiInEventGroupSetBitsFromISR;
|
|||
#define TRACE_CPU_CLOCK_HZ configCPU_CLOCK_HZ /* Defined in "FreeRTOSConfig.h" */
|
||||
|
||||
#if (SELECTED_PORT == PORT_ARM_CortexM)
|
||||
|
||||
/* If you get warnings regarding __get_PRIMASK and __set_PRIMASK, make sure that ARM's CMSIS API is included
|
||||
by the recorder using your chip vendor header file (e.g., "board.h", "stm32f4xx.h", "lpc17xx.h") */
|
||||
|
||||
#define TRACE_SR_ALLOC_CRITICAL_SECTION() int __irq_status;
|
||||
/* Uses CMSIS API */
|
||||
|
||||
#define TRACE_SR_ALLOC_CRITICAL_SECTION() int __irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() {__irq_status = __get_PRIMASK(); __set_PRIMASK(1);}
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() {__set_PRIMASK(__irq_status);}
|
||||
|
||||
#endif
|
||||
|
||||
#if (SELECTED_PORT == PORT_ARM_CORTEX_M0)
|
||||
#define TRACE_SR_ALLOC_CRITICAL_SECTION() int __irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() {__irq_status = portSET_INTERRUPT_MASK_FROM_ISR();}
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() {portCLEAR_INTERRUPT_MASK_FROM_ISR(__irq_status);}
|
||||
#endif
|
||||
|
||||
#if ((SELECTED_PORT == PORT_ARM_CORTEX_A9) || (SELECTED_PORT == PORT_Renesas_RX600) || (SELECTED_PORT == PORT_MICROCHIP_PIC32MX) || (SELECTED_PORT == PORT_MICROCHIP_PIC32MZ))
|
||||
#define TRACE_SR_ALLOC_CRITICAL_SECTION() int __irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() {__irq_status = portSET_INTERRUPT_MASK_FROM_ISR();}
|
||||
|
|
@ -471,7 +476,6 @@ void* prvTraceGetCurrentTaskHandle(void);
|
|||
#define TRACE_GET_CLASS_TRACE_CLASS(CLASS, kernelClass) TraceObjectClassTable[kernelClass]
|
||||
#define TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject) TRACE_GET_CLASS_TRACE_CLASS(CLASS, prvTraceGetObjectType(pxObject))
|
||||
|
||||
/* Note: Timer tracing only supported on FreeRTOS v8 or later, so "Timer_t" is safe to use! */
|
||||
#define TRACE_GET_TIMER_NUMBER(tmr) ( ( objectHandleType ) ((Timer_t*)tmr)->uxTimerNumber )
|
||||
#define TRACE_SET_TIMER_NUMBER(tmr) ((Timer_t*)tmr)->uxTimerNumber = xTraceGetObjectHandle(TRACE_CLASS_TIMER);
|
||||
#define TRACE_GET_TIMER_NAME(pxTimer) pxTimer->pcTimerName
|
||||
|
|
@ -553,6 +557,12 @@ void* prvTraceGetCurrentTaskHandle(void);
|
|||
#define traceTASK_SUSPEND( pxTaskToSuspend ) \
|
||||
trcKERNEL_HOOKS_TASK_SUSPEND(TASK_SUSPEND, pxTaskToSuspend);
|
||||
|
||||
/* Called from special case with timer only */
|
||||
#undef traceTASK_DELAY_SUSPEND
|
||||
#define traceTASK_DELAY_SUSPEND( pxTaskToSuspend ) \
|
||||
trcKERNEL_HOOKS_TASK_SUSPEND(TASK_SUSPEND, pxTaskToSuspend); \
|
||||
trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED();
|
||||
|
||||
/* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */
|
||||
#undef traceTASK_DELAY
|
||||
#define traceTASK_DELAY() \
|
||||
|
|
@ -1064,11 +1074,3 @@ vTraceSetObjectName(TRACE_CLASS_EVENTGROUP, (objectHandleType)uxEventGroupGetNum
|
|||
#endif
|
||||
|
||||
#endif /* TRCKERNELPORTFREERTOS_H_ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcTypes.h
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2014.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Tracealyzer v2.7.7 Recorder Library
|
||||
* Tracealyzer v3.0.2 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcUser.h
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2012-2015.
|
||||
* Copyright Percepio AB, 2014.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
|
|
@ -385,7 +385,7 @@ void vTraceUserEvent(traceLabel eventLabel);
|
|||
*
|
||||
* Calling xTraceOpenLabel multiple times will not create duplicate entries, but
|
||||
* it is of course faster to just do it once, and then keep the handle for later
|
||||
* use. If you don´t have any data arguments, only a text label/string, it is
|
||||
* use. If you don<EFBFBD>t have any data arguments, only a text label/string, it is
|
||||
* better to use vTraceUserEvent - it is faster.
|
||||
*
|
||||
* Format specifiers supported:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue