mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-12-15 17:34:53 +08:00
Percepio Trace Recorder v4.6.0 (#789)
* * Percepio Trace Recorder v4.6.0 * Add space between inclusion of header and comment * Fix broken posix build - part 1 * Add percepio timer implementation * Remove delted trace recorder header file * Fix Networking demo build * Fix CLI demo * Fix visual studio version number * Fix core header check * Fix more core checks * Fix last of core checks Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com> Co-authored-by: Alfred Gedeon <alfred2g@hotmail.com>
This commit is contained in:
5
.github/scripts/core_checker.py
vendored
5
.github/scripts/core_checker.py
vendored
@@ -268,9 +268,12 @@ FREERTOS_IGNORED_PATTERNS = [
|
||||
r'.*/trcConfig\.h.*',
|
||||
r'.*/trcConfig\.c.*',
|
||||
r'.*/trcSnapshotConfig\.h.*',
|
||||
r'.*/trcKernelPortConfig\.h.*',
|
||||
r'.*/MicroZed_hw_platform.*',
|
||||
r'.*/ThirdParty/.*',
|
||||
r'FreeRTOS\-Plus/Demo/Common/WinPCap/.*'
|
||||
r'FreeRTOS\-Plus/Demo/Common/WinPCap/.*',
|
||||
r'FreeRTOS\-Plus/Source/FreeRTOS-Plus-Trace/.*',
|
||||
r'FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/.*'
|
||||
]
|
||||
|
||||
FREERTOS_IGNORED_FILES = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202112.00
|
||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -20,7 +20,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://aws.amazon.com/freertos
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -335,7 +335,9 @@ BaseType_t lParameterStringLength;
|
||||
/* Start or restart the trace. */
|
||||
vTraceStop();
|
||||
vTraceClear();
|
||||
uiTraceStart();
|
||||
|
||||
vTraceEnable( TRC_START );
|
||||
traceSTART();
|
||||
|
||||
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );
|
||||
}
|
||||
|
||||
@@ -19,4 +19,7 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F78FDCED-CBDF-4B81-B6E3-78A0A2989E82}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -52,8 +52,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "trcPortDefines.h"
|
||||
|
||||
/******************************************************************************
|
||||
* Include of processor header file
|
||||
*
|
||||
@@ -99,32 +97,6 @@ extern "C" {
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_FREERTOS_VERSION
|
||||
*
|
||||
* Specify what version of FreeRTOS that is used (don't change unless using the
|
||||
* trace recorder library with an older version of FreeRTOS).
|
||||
*
|
||||
* TRC_FREERTOS_VERSION_7_3_X If using FreeRTOS v7.3.X
|
||||
* TRC_FREERTOS_VERSION_7_4_X If using FreeRTOS v7.4.X
|
||||
* TRC_FREERTOS_VERSION_7_5_X If using FreeRTOS v7.5.X
|
||||
* TRC_FREERTOS_VERSION_7_6_X If using FreeRTOS v7.6.X
|
||||
* TRC_FREERTOS_VERSION_8_X_X If using FreeRTOS v8.X.X
|
||||
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0
|
||||
* TRC_FREERTOS_VERSION_9_0_1 If using FreeRTOS v9.0.1
|
||||
* TRC_FREERTOS_VERSION_9_0_2 If using FreeRTOS v9.0.2
|
||||
* TRC_FREERTOS_VERSION_10_0_0 If using FreeRTOS v10.0.0
|
||||
* TRC_FREERTOS_VERSION_10_0_1 If using FreeRTOS v10.0.1
|
||||
* TRC_FREERTOS_VERSION_10_1_0 If using FreeRTOS v10.1.0
|
||||
* TRC_FREERTOS_VERSION_10_1_1 If using FreeRTOS v10.1.1
|
||||
* TRC_FREERTOS_VERSION_10_2_0 If using FreeRTOS v10.2.0
|
||||
* TRC_FREERTOS_VERSION_10_2_1 If using FreeRTOS v10.2.1
|
||||
* TRC_FREERTOS_VERSION_10_3_0 If using FreeRTOS v10.3.0
|
||||
* TRC_FREERTOS_VERSION_10_3_1 If using FreeRTOS v10.3.1
|
||||
* TRC_FREERTOS_VERSION_10_4_0 If using FreeRTOS v10.4.0 or later
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_4_0
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SCHEDULING_ONLY
|
||||
*
|
||||
@@ -224,17 +196,6 @@ extern "C" {
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_OSTICK_EVENTS 1
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "event group" events.
|
||||
*
|
||||
* Default value is 0 (excluded) since dependent on event_groups.c
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS 0
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_TIMER_EVENTS
|
||||
*
|
||||
@@ -258,18 +219,6 @@ extern "C" {
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS 1
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any stream buffer or message
|
||||
* buffer events.
|
||||
*
|
||||
* Default value is 0 since dependent on stream_buffer.c (new in FreeRTOS v10)
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_ENABLE_STACK_MONITOR
|
||||
*
|
||||
@@ -387,15 +336,19 @@ extern "C" {
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_MAX_ISR_NESTING 8
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND
|
||||
/**
|
||||
* @def TRC_CFG_RECORDER_DATA_ATTRIBUTE
|
||||
* @brief When setting TRC_CFG_RECORDER_DATA_INIT to 0, you might also need to make
|
||||
* sure certain recorder data is placed in a specific RAM section to avoid being
|
||||
* zeroed out after initialization. Define TRC_CFG_RECORDER_DATA_ATTRIBUTE as
|
||||
* that attribute.
|
||||
*
|
||||
* When using FreeRTOS v10.3.0 or v10.3.1, please make sure that the trace
|
||||
* point in prvNotifyQueueSetContainer() in queue.c is renamed from
|
||||
* traceQUEUE_SEND to traceQUEUE_SET_SEND in order to tell them apart from
|
||||
* other traceQUEUE_SEND trace points. Then set this to TRC_ACKNOWLEDGED.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND TRC_ACKNOWLEDGED /* 0 or TRC_ACKNOWLEDGED */
|
||||
* Example:
|
||||
* #define TRC_CFG_RECORDER_DATA_ATTRIBUTE __attribute__((section(".bss.trace_recorder_data")))
|
||||
*
|
||||
* Default value is empty.
|
||||
*/
|
||||
#define TRC_CFG_RECORDER_DATA_ATTRIBUTE
|
||||
|
||||
/* Specific configuration, depending on Streaming/Snapshot mode */
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Configuration parameters for the kernel port.
|
||||
* More settings can be found in trcKernelPortStreamingConfig.h and
|
||||
* trcKernelPortSnapshotConfig.h.
|
||||
*/
|
||||
|
||||
#ifndef TRC_KERNEL_PORT_CONFIG_H
|
||||
#define TRC_KERNEL_PORT_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_RECORDER_MODE
|
||||
* @brief Specify what recording mode to use. Snapshot means that the data is saved in
|
||||
* an internal RAM buffer, for later upload. Streaming means that the data is
|
||||
* transferred continuously to the host PC.
|
||||
*
|
||||
* For more information, see http://percepio.com/2016/10/05/rtos-tracing/
|
||||
* and the Tracealyzer User Manual.
|
||||
*
|
||||
* Values:
|
||||
* TRC_RECORDER_MODE_SNAPSHOT
|
||||
* TRC_RECORDER_MODE_STREAMING
|
||||
*/
|
||||
#define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_FREERTOS_VERSION
|
||||
* @brief Specify what version of FreeRTOS that is used (don't change unless using the
|
||||
* trace recorder library with an older version of FreeRTOS).
|
||||
*
|
||||
* TRC_FREERTOS_VERSION_7_3_X If using FreeRTOS v7.3.X
|
||||
* TRC_FREERTOS_VERSION_7_4_X If using FreeRTOS v7.4.X
|
||||
* TRC_FREERTOS_VERSION_7_5_X If using FreeRTOS v7.5.X
|
||||
* TRC_FREERTOS_VERSION_7_6_X If using FreeRTOS v7.6.X
|
||||
* TRC_FREERTOS_VERSION_8_X_X If using FreeRTOS v8.X.X
|
||||
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0
|
||||
* TRC_FREERTOS_VERSION_9_0_1 If using FreeRTOS v9.0.1
|
||||
* TRC_FREERTOS_VERSION_9_0_2 If using FreeRTOS v9.0.2
|
||||
* TRC_FREERTOS_VERSION_10_0_0 If using FreeRTOS v10.0.0
|
||||
* TRC_FREERTOS_VERSION_10_0_1 If using FreeRTOS v10.0.1
|
||||
* TRC_FREERTOS_VERSION_10_1_0 If using FreeRTOS v10.1.0
|
||||
* TRC_FREERTOS_VERSION_10_1_1 If using FreeRTOS v10.1.1
|
||||
* TRC_FREERTOS_VERSION_10_2_0 If using FreeRTOS v10.2.0
|
||||
* TRC_FREERTOS_VERSION_10_2_1 If using FreeRTOS v10.2.1
|
||||
* TRC_FREERTOS_VERSION_10_3_0 If using FreeRTOS v10.3.0
|
||||
* TRC_FREERTOS_VERSION_10_3_1 If using FreeRTOS v10.3.1
|
||||
* TRC_FREERTOS_VERSION_10_4_0 If using FreeRTOS v10.4.0
|
||||
* TRC_FREERTOS_VERSION_10_4_1 If using FreeRTOS v10.4.1 or later
|
||||
*/
|
||||
#define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_4_1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "event group" events.
|
||||
*
|
||||
* Default value is 0 (excluded) since dependent on event_groups.c
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_TIMER_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any Timer events.
|
||||
*
|
||||
* Default value is 0 since dependent on timers.c
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_TIMER_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "pending function call"
|
||||
* events, such as xTimerPendFunctionCall().
|
||||
*
|
||||
* Default value is 0 since dependent on timers.c
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any stream buffer or message
|
||||
* buffer events.
|
||||
*
|
||||
* Default value is 0 since dependent on stream_buffer.c (new in FreeRTOS v10)
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND
|
||||
* @brief When using FreeRTOS v10.3.0 or v10.3.1, please make sure that the trace
|
||||
* point in prvNotifyQueueSetContainer() in queue.c is renamed from
|
||||
* traceQUEUE_SEND to traceQUEUE_SET_SEND in order to tell them apart from
|
||||
* other traceQUEUE_SEND trace points. Then set this to TRC_ACKNOWLEDGED.
|
||||
*/
|
||||
#define TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND 0 /* TRC_ACKNOWLEDGED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_KERNEL_PORT_CONFIG_H */
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Kernel port configuration parameters for snapshot mode.
|
||||
*/
|
||||
|
||||
#ifndef TRC_KERNEL_PORT_SNAPSHOT_CONFIG_H
|
||||
#define TRC_KERNEL_PORT_SNAPSHOT_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_NTASK, TRC_CFG_NISR, TRC_CFG_NQUEUE, TRC_CFG_NSEMAPHORE...
|
||||
* @brief A group of macros which should be defined as integer values, zero or larger.
|
||||
*
|
||||
* These define the capacity of the Object Property Table, i.e., the maximum
|
||||
* number of objects active at any given point, within each object class (e.g.,
|
||||
* task, queue, semaphore, ...).
|
||||
*
|
||||
* If tasks or other objects are deleted in your system, this
|
||||
* setting does not limit the total amount of objects created, only the number
|
||||
* of objects that have been successfully created but not yet deleted.
|
||||
*
|
||||
* Using too small values will cause vTraceError to be called, which stores an
|
||||
* error message in the trace that is shown when opening the trace file. The
|
||||
* error message can also be retrieved using xTraceGetLastError.
|
||||
*
|
||||
* It can be wise to start with large values for these constants,
|
||||
* unless you are very confident on these numbers. Then do a recording and
|
||||
* check the actual usage by selecting View menu -> Trace Details ->
|
||||
* Resource Usage -> Object Table.
|
||||
*/
|
||||
#define TRC_CFG_NTASK 150
|
||||
#define TRC_CFG_NISR 90
|
||||
#define TRC_CFG_NQUEUE 90
|
||||
#define TRC_CFG_NSEMAPHORE 90
|
||||
#define TRC_CFG_NMUTEX 90
|
||||
#define TRC_CFG_NTIMER 250
|
||||
#define TRC_CFG_NEVENTGROUP 90
|
||||
#define TRC_CFG_NSTREAMBUFFER 50
|
||||
#define TRC_CFG_NMESSAGEBUFFER 50
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_NAME_LEN_TASK, TRC_CFG_NAME_LEN_QUEUE, ...
|
||||
* @brief Macros that specify the maximum lengths (number of characters) for names of
|
||||
* kernel objects, such as tasks and queues. If longer names are used, they will
|
||||
* be truncated when stored in the recorder.
|
||||
*/
|
||||
#define TRC_CFG_NAME_LEN_TASK 15
|
||||
#define TRC_CFG_NAME_LEN_ISR 15
|
||||
#define TRC_CFG_NAME_LEN_QUEUE 15
|
||||
#define TRC_CFG_NAME_LEN_SEMAPHORE 15
|
||||
#define TRC_CFG_NAME_LEN_MUTEX 15
|
||||
#define TRC_CFG_NAME_LEN_TIMER 15
|
||||
#define TRC_CFG_NAME_LEN_EVENTGROUP 15
|
||||
#define TRC_CFG_NAME_LEN_STREAMBUFFER 15
|
||||
#define TRC_CFG_NAME_LEN_MESSAGEBUFFER 15
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_KERNEL_PORT_SNAPSHOT_CONFIG_H */
|
||||
@@ -84,39 +84,6 @@
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_EVENT_BUFFER_SIZE 15000
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_NTASK, TRC_CFG_NISR, TRC_CFG_NQUEUE, TRC_CFG_NSEMAPHORE...
|
||||
*
|
||||
* A group of macros which should be defined as integer values, zero or larger.
|
||||
*
|
||||
* These define the capacity of the Object Property Table, i.e., the maximum
|
||||
* number of objects active at any given point, within each object class (e.g.,
|
||||
* task, queue, semaphore, ...).
|
||||
*
|
||||
* If tasks or other objects are deleted in your system, this
|
||||
* setting does not limit the total amount of objects created, only the number
|
||||
* of objects that have been successfully created but not yet deleted.
|
||||
*
|
||||
* Using too small values will cause vTraceError to be called, which stores an
|
||||
* error message in the trace that is shown when opening the trace file. The
|
||||
* error message can also be retrieved using xTraceGetLastError.
|
||||
*
|
||||
* It can be wise to start with large values for these constants,
|
||||
* unless you are very confident on these numbers. Then do a recording and
|
||||
* check the actual usage by selecting View menu -> Trace Details ->
|
||||
* Resource Usage -> Object Table.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_NTASK 150
|
||||
#define TRC_CFG_NISR 90
|
||||
#define TRC_CFG_NQUEUE 90
|
||||
#define TRC_CFG_NSEMAPHORE 90
|
||||
#define TRC_CFG_NMUTEX 90
|
||||
#define TRC_CFG_NTIMER 250
|
||||
#define TRC_CFG_NEVENTGROUP 90
|
||||
#define TRC_CFG_NSTREAMBUFFER 50
|
||||
#define TRC_CFG_NMESSAGEBUFFER 50
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_FLOAT_SUPPORT
|
||||
*
|
||||
|
||||
@@ -130,10 +130,12 @@
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\event_groups.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\list.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_3.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\queue.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\stream_buffer.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c" />
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\timers.c" />
|
||||
<ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c" />
|
||||
|
||||
@@ -80,6 +80,12 @@
|
||||
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcStreamingRecorder.c">
|
||||
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\event_groups.c">
|
||||
<Filter>FreeRTOS\Source</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\FreeRTOS\Source\stream_buffer.c">
|
||||
<Filter>FreeRTOS\Source</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="FreeRTOSConfig.h">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202112.00
|
||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -20,7 +20,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://aws.amazon.com/freertos
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -242,4 +242,19 @@ const unsigned long ulLongSleep = 1000UL;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static uint32_t ulEntryTime = 0;
|
||||
|
||||
void vTraceTimerReset( void )
|
||||
{
|
||||
ulEntryTime = xTaskGetTickCount();
|
||||
}
|
||||
|
||||
uint32_t uiTraceTimerGetFrequency( void )
|
||||
{
|
||||
return configTICK_RATE_HZ;
|
||||
}
|
||||
|
||||
uint32_t uiTraceTimerGetValue( void )
|
||||
{
|
||||
return ( xTaskGetTickCount() - ulEntryTime );
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ INCLUDE_DIRS += -I${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/Include
|
||||
INCLUDE_DIRS += -I${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/linux/
|
||||
INCLUDE_DIRS += -I${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-TCP/include/
|
||||
INCLUDE_DIRS += -I${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-TCP/portable/Compiler/GCC/
|
||||
INCLUDE_DIRS += -I${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/config
|
||||
|
||||
SOURCE_FILES := $(wildcard *.c)
|
||||
SOURCE_FILES += $(wildcard ${FREERTOS_DIR}/Source/*.c)
|
||||
@@ -70,11 +71,10 @@ SOURCE_FILES += ${FREERTOS_DIR}/Demo/Common/Minimal/TimerDemo.c
|
||||
# Trace library.
|
||||
SOURCE_FILES += ${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/trcKernelPort.c
|
||||
SOURCE_FILES += ${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/trcSnapshotRecorder.c
|
||||
SOURCE_FILES += ${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/trcStreamingRecorder.c
|
||||
SOURCE_FILES += ${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/streamports/File/trcStreamingPort.c
|
||||
|
||||
CFLAGS := -ggdb3 -O0
|
||||
CPPFLAGS := -DprojCOVERAGE_TEST=0 -D_DEFAULT_SOURCE -D_WINDOWS_ -DTRACE_ON_ENTER=0
|
||||
|
||||
CFLAGS := -ggdb3 -O0 -DprojCOVERAGE_TEST=0 -D_WINDOWS_
|
||||
LDFLAGS := -ggdb3 -O0 -pthread -lpcap
|
||||
|
||||
OBJ_FILES = $(SOURCE_FILES:%.c=$(BUILD_DIR)/%.o)
|
||||
@@ -85,23 +85,16 @@ ${BIN} : $(BUILD_DIR)/$(BIN)
|
||||
|
||||
${BUILD_DIR}/${BIN} : ${OBJ_FILES}
|
||||
-mkdir -p ${@D}
|
||||
$(CC) $^ $(CFLAGS) $(INCLUDE_DIRS) ${LDFLAGS} -o $@
|
||||
|
||||
$(CC) $^ ${LDFLAGS} -o $@
|
||||
|
||||
-include ${DEP_FILE}
|
||||
|
||||
${BUILD_DIR}/%.o : %.c
|
||||
${BUILD_DIR}/%.o : %.c Makefile
|
||||
-mkdir -p $(@D)
|
||||
$(CC) $(CFLAGS) ${INCLUDE_DIRS} -MMD -c $< -o $@
|
||||
$(CC) $(CFLAGS) ${CPPFLAGS} ${INCLUDE_DIRS} -MMD -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILD_DIR)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* FreeRTOS kernel includes. */
|
||||
#include "FreeRTOS.h"
|
||||
@@ -59,6 +61,8 @@
|
||||
/* Local includes. */
|
||||
#include "console.h"
|
||||
|
||||
#include <trcRecorder.h>
|
||||
|
||||
#define ECHO_CLIENT_DEMO 0
|
||||
|
||||
#define mainSELECTED_APPLICATION ECHO_CLIENT_DEMO
|
||||
@@ -103,6 +107,10 @@ StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
|
||||
/* Notes if the trace is running or not. */
|
||||
static BaseType_t xTraceRunning = pdTRUE;
|
||||
|
||||
static clockid_t cid = CLOCK_THREAD_CPUTIME_ID;
|
||||
|
||||
static uint32_t frequency;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
int main( void )
|
||||
@@ -118,7 +126,7 @@ int main( void )
|
||||
configASSERT() is called. */
|
||||
printf( "\r\nTrace started.\r\nThe trace will be dumped to disk if a call to configASSERT() fails.\r\n" );
|
||||
printf( "\r\nThe trace will be dumped to disk if Enter is hit.\r\n" );
|
||||
uiTraceStart();
|
||||
traceSTART();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -284,6 +292,7 @@ static void prvSaveTraceFile( void )
|
||||
#if ( projCOVERAGE_TEST != 1 )
|
||||
{
|
||||
FILE * pxOutputFile;
|
||||
extern RecorderDataType * RecorderDataPtr;
|
||||
|
||||
vTraceStop();
|
||||
|
||||
@@ -355,3 +364,57 @@ the stack and so not exists after this function exits. */
|
||||
configMINIMAL_STACK_SIZE is specified in words, not bytes. */
|
||||
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
|
||||
}
|
||||
|
||||
void vTraceTimerReset( void )
|
||||
{
|
||||
int xRet;
|
||||
struct timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 0;
|
||||
|
||||
xRet = clock_settime( cid, &ts );
|
||||
if( xRet != 0 )
|
||||
{
|
||||
printf( "Could not reset time: %s\n", strerror( errno ) );
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t uiTraceTimerGetFrequency( void )
|
||||
{
|
||||
struct timespec res;
|
||||
int xRet;
|
||||
|
||||
res.tv_nsec = 0;
|
||||
res.tv_sec = 0;
|
||||
|
||||
xRet = clock_getres( cid, &res );
|
||||
if( xRet == 0 )
|
||||
{
|
||||
// calculate frequency from timer definition
|
||||
frequency = (uint64_t) 1000000000 / res.tv_nsec;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "Could not get clock frequency: %s\n", strerror( errno ) );
|
||||
}
|
||||
return frequency;
|
||||
}
|
||||
|
||||
uint32_t uiTraceTimerGetValue( void )
|
||||
{
|
||||
int xRet;
|
||||
struct timespec tp;
|
||||
uint32_t result = 0;
|
||||
|
||||
xRet = clock_gettime( cid, &tp );
|
||||
if( xRet == 0 )
|
||||
{
|
||||
result = tp.tv_nsec / frequency;
|
||||
result += (tp.tv_sec * 1000000000) / frequency;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "Could not get time: %s\n", strerror( errno ) );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "trcPortDefines.h"
|
||||
|
||||
/******************************************************************************
|
||||
* Include of processor header file
|
||||
*
|
||||
@@ -98,31 +96,6 @@ extern "C" {
|
||||
* TRC_RECORDER_MODE_STREAMING
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT
|
||||
/******************************************************************************
|
||||
* TRC_CFG_FREERTOS_VERSION
|
||||
*
|
||||
* Specify what version of FreeRTOS that is used (don't change unless using the
|
||||
* trace recorder library with an older version of FreeRTOS).
|
||||
*
|
||||
* TRC_FREERTOS_VERSION_7_3_X If using FreeRTOS v7.3.X
|
||||
* TRC_FREERTOS_VERSION_7_4_X If using FreeRTOS v7.4.X
|
||||
* TRC_FREERTOS_VERSION_7_5_X If using FreeRTOS v7.5.X
|
||||
* TRC_FREERTOS_VERSION_7_6_X If using FreeRTOS v7.6.X
|
||||
* TRC_FREERTOS_VERSION_8_X_X If using FreeRTOS v8.X.X
|
||||
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0
|
||||
* TRC_FREERTOS_VERSION_9_0_1 If using FreeRTOS v9.0.1
|
||||
* TRC_FREERTOS_VERSION_9_0_2 If using FreeRTOS v9.0.2
|
||||
* TRC_FREERTOS_VERSION_10_0_0 If using FreeRTOS v10.0.0
|
||||
* TRC_FREERTOS_VERSION_10_0_1 If using FreeRTOS v10.0.1
|
||||
* TRC_FREERTOS_VERSION_10_1_0 If using FreeRTOS v10.1.0
|
||||
* TRC_FREERTOS_VERSION_10_1_1 If using FreeRTOS v10.1.1
|
||||
* TRC_FREERTOS_VERSION_10_2_0 If using FreeRTOS v10.2.0
|
||||
* TRC_FREERTOS_VERSION_10_2_1 If using FreeRTOS v10.2.1
|
||||
* TRC_FREERTOS_VERSION_10_3_0 If using FreeRTOS v10.3.0
|
||||
* TRC_FREERTOS_VERSION_10_3_1 If using FreeRTOS v10.3.1
|
||||
* TRC_FREERTOS_VERSION_10_4_0 If using FreeRTOS v10.4.0 or later
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_4_0
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SCHEDULING_ONLY
|
||||
@@ -295,6 +268,14 @@ extern "C" {
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_MAX_ISR_NESTING 8
|
||||
|
||||
#define TRC_CFG_CTRL_TASK_STACK_SIZE ( 1024 )
|
||||
|
||||
#define TRC_CFG_CTRL_TASK_PRIORITY 1
|
||||
|
||||
#define TRC_CFG_CTRL_TASK_DELAY 2
|
||||
|
||||
#define TRC_CFG_RECORDER_DATA_ATTRIBUTE
|
||||
|
||||
/* Specific configuration, depending on Streaming/Snapshot mode */
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)
|
||||
#include "trcSnapshotConfig.h"
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Configuration parameters for the kernel port.
|
||||
* More settings can be found in trcKernelPortStreamingConfig.h and
|
||||
* trcKernelPortSnapshotConfig.h.
|
||||
*/
|
||||
|
||||
#ifndef TRC_KERNEL_PORT_CONFIG_H
|
||||
#define TRC_KERNEL_PORT_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_RECORDER_MODE
|
||||
* @brief Specify what recording mode to use. Snapshot means that the data is saved in
|
||||
* an internal RAM buffer, for later upload. Streaming means that the data is
|
||||
* transferred continuously to the host PC.
|
||||
*
|
||||
* For more information, see http://percepio.com/2016/10/05/rtos-tracing/
|
||||
* and the Tracealyzer User Manual.
|
||||
*
|
||||
* Values:
|
||||
* TRC_RECORDER_MODE_SNAPSHOT
|
||||
* TRC_RECORDER_MODE_STREAMING
|
||||
*/
|
||||
#define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_FREERTOS_VERSION
|
||||
* @brief Specify what version of FreeRTOS that is used (don't change unless using the
|
||||
* trace recorder library with an older version of FreeRTOS).
|
||||
*
|
||||
* TRC_FREERTOS_VERSION_7_3_X If using FreeRTOS v7.3.X
|
||||
* TRC_FREERTOS_VERSION_7_4_X If using FreeRTOS v7.4.X
|
||||
* TRC_FREERTOS_VERSION_7_5_X If using FreeRTOS v7.5.X
|
||||
* TRC_FREERTOS_VERSION_7_6_X If using FreeRTOS v7.6.X
|
||||
* TRC_FREERTOS_VERSION_8_X_X If using FreeRTOS v8.X.X
|
||||
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0
|
||||
* TRC_FREERTOS_VERSION_9_0_1 If using FreeRTOS v9.0.1
|
||||
* TRC_FREERTOS_VERSION_9_0_2 If using FreeRTOS v9.0.2
|
||||
* TRC_FREERTOS_VERSION_10_0_0 If using FreeRTOS v10.0.0
|
||||
* TRC_FREERTOS_VERSION_10_0_1 If using FreeRTOS v10.0.1
|
||||
* TRC_FREERTOS_VERSION_10_1_0 If using FreeRTOS v10.1.0
|
||||
* TRC_FREERTOS_VERSION_10_1_1 If using FreeRTOS v10.1.1
|
||||
* TRC_FREERTOS_VERSION_10_2_0 If using FreeRTOS v10.2.0
|
||||
* TRC_FREERTOS_VERSION_10_2_1 If using FreeRTOS v10.2.1
|
||||
* TRC_FREERTOS_VERSION_10_3_0 If using FreeRTOS v10.3.0
|
||||
* TRC_FREERTOS_VERSION_10_3_1 If using FreeRTOS v10.3.1
|
||||
* TRC_FREERTOS_VERSION_10_4_0 If using FreeRTOS v10.4.0
|
||||
* TRC_FREERTOS_VERSION_10_4_1 If using FreeRTOS v10.4.1 or later
|
||||
*/
|
||||
#define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_4_1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "event group" events.
|
||||
*
|
||||
* Default value is 0 (excluded) since dependent on event_groups.c
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_TIMER_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any Timer events.
|
||||
*
|
||||
* Default value is 0 since dependent on timers.c
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_TIMER_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "pending function call"
|
||||
* events, such as xTimerPendFunctionCall().
|
||||
*
|
||||
* Default value is 0 since dependent on timers.c
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any stream buffer or message
|
||||
* buffer events.
|
||||
*
|
||||
* Default value is 0 since dependent on stream_buffer.c (new in FreeRTOS v10)
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND
|
||||
* @brief When using FreeRTOS v10.3.0 or v10.3.1, please make sure that the trace
|
||||
* point in prvNotifyQueueSetContainer() in queue.c is renamed from
|
||||
* traceQUEUE_SEND to traceQUEUE_SET_SEND in order to tell them apart from
|
||||
* other traceQUEUE_SEND trace points. Then set this to TRC_ACKNOWLEDGED.
|
||||
*/
|
||||
#define TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND 0 /* TRC_ACKNOWLEDGED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_KERNEL_PORT_CONFIG_H */
|
||||
@@ -84,39 +84,6 @@
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_EVENT_BUFFER_SIZE 32000
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_NTASK, TRC_CFG_NISR, TRC_CFG_NQUEUE, TRC_CFG_NSEMAPHORE...
|
||||
*
|
||||
* A group of macros which should be defined as integer values, zero or larger.
|
||||
*
|
||||
* These define the capacity of the Object Property Table, i.e., the maximum
|
||||
* number of objects active at any given point, within each object class (e.g.,
|
||||
* task, queue, semaphore, ...).
|
||||
*
|
||||
* If tasks or other objects are deleted in your system, this
|
||||
* setting does not limit the total amount of objects created, only the number
|
||||
* of objects that have been successfully created but not yet deleted.
|
||||
*
|
||||
* Using too small values will cause vTraceError to be called, which stores an
|
||||
* error message in the trace that is shown when opening the trace file. The
|
||||
* error message can also be retrieved using xTraceGetLastError.
|
||||
*
|
||||
* It can be wise to start with large values for these constants,
|
||||
* unless you are very confident on these numbers. Then do a recording and
|
||||
* check the actual usage by selecting View menu -> Trace Details ->
|
||||
* Resource Usage -> Object Table.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_NTASK 150
|
||||
#define TRC_CFG_NISR 90
|
||||
#define TRC_CFG_NQUEUE 90
|
||||
#define TRC_CFG_NSEMAPHORE 90
|
||||
#define TRC_CFG_NMUTEX 90
|
||||
#define TRC_CFG_NTIMER 250
|
||||
#define TRC_CFG_NEVENTGROUP 90
|
||||
#define TRC_CFG_NSTREAMBUFFER 100
|
||||
#define TRC_CFG_NMESSAGEBUFFER 100
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_FLOAT_SUPPORT
|
||||
*
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
@@ -1,8 +1,9 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.0
|
||||
* Percepio AB, www.percepio.com
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* aws_secure_socket.tzext.h
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* An example of a Tracealyzer extension for tracing API calls, in this case
|
||||
* for tracing selected functions in Amazon FreeRTOS/aws_secure_sockets.
|
||||
@@ -21,42 +22,7 @@
|
||||
* See the below comments for details about these definitions. Note that you
|
||||
* also need a matching .xml file for Tracealyzer to understand the data.
|
||||
* See trcExtensions.h for further information.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special 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.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef _AWS_SECURE_SOCKETS_TZEXT_H
|
||||
#define _AWS_SECURE_SOCKETS_TZEXT_H
|
||||
@@ -126,7 +92,7 @@
|
||||
|
||||
/***** Trace Wrappers *****/
|
||||
|
||||
#include "aws_secure_sockets.h" /* Including the original header file, so that custom data types are understood. */
|
||||
#include <aws_secure_sockets.h> /* Including the original header file, so that custom data types are understood. */
|
||||
|
||||
static inline int32_t SOCKETS_Connect__trace( Socket_t xSocket, SocketsSockaddr_t * pxAddress, Socklen_t xAddressLength )
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.0
|
||||
* Percepio AB, www.percepio.com
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* aws_secure_socket.tzext.h
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* An example of a Tracealyzer extension for tracing API calls, in this case
|
||||
* for tracing selected functions in Amazon FreeRTOS/aws_wifi.
|
||||
@@ -21,42 +22,7 @@
|
||||
* See the below comments for details about these definitions. Note that you
|
||||
* also need a matching .xml file for Tracealyzer to understand the data.
|
||||
* See trcExtensions.h for further information.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special 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.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef _AWS_WIFI_TZEXT_H
|
||||
#define _AWS_WIFI_TZEXT_H
|
||||
@@ -125,7 +91,7 @@
|
||||
|
||||
/***** Trace Wrappers *****/
|
||||
|
||||
#include "aws_wifi.h" /* Including the original header file, so that custom data types are understood. */
|
||||
#include <aws_wifi.h> /* Including the original header file, so that custom data types are understood. */
|
||||
|
||||
static inline WIFIReturnCode_t WIFI_On__trace( void )
|
||||
{
|
||||
|
||||
143
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcAssert.h
Normal file
143
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcAssert.h
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace assert APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_ASSERT_H
|
||||
#define TRC_ASSERT_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_assert_apis Trace Asserts APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef TRC_CFG_USE_TRACE_ASSERT
|
||||
#error "TRC_CFG_USE_TRACE_ASSERT is not defined. Please define it in trcConfig.h"
|
||||
#endif
|
||||
|
||||
#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
|
||||
|
||||
/* Standard assert */
|
||||
#define TRC_ASSERT(__condition) if (!(__condition)) { prvTraceAssertCreate(__FILE__, __LINE__); return TRC_FAIL; }
|
||||
|
||||
#define TRC_ASSERT_ALWAYS_EVALUATE TRC_ASSERT
|
||||
|
||||
/* Standard assert with custom on fail actions */
|
||||
#define TRC_ASSERT_CUSTOM_ON_FAIL(__condition, __custom_on_fail) if (!(__condition)) { prvTraceAssertCreate(__FILE__, __LINE__); __custom_on_fail; }
|
||||
|
||||
#define TRC_ASSERT_CUSTOM_ON_FAIL_ALWAYS_EVALUATE TRC_ASSERT_CUSTOM_ON_FAIL
|
||||
|
||||
#if (defined(TRC_CFG_TEST_MODE) && (TRC_CFG_TEST_MODE) == 1)
|
||||
|
||||
/* Asserts that two types have an equal size. Condition passed to function to avoid compilers warning about unreachable code due to constant value. */
|
||||
#define TRC_ASSERT_EQUAL_SIZE(x, y) if (!prvTraceAssertCheckCondition((TraceBaseType_t)(sizeof(x) == sizeof(y)))) { prvTraceAssertCreate(__FILE__, __LINE__); return TRC_FAIL; }
|
||||
|
||||
/**
|
||||
* @brief Inlined condition check to get around some compiler warnings for unused variables.
|
||||
*
|
||||
* @param[in] condition The condition
|
||||
*/
|
||||
inline TraceBaseType_t prvTraceAssertCheckCondition(TraceBaseType_t condition)
|
||||
{
|
||||
return condition;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define TRC_ASSERT_EQUAL_SIZE(x, y)
|
||||
|
||||
#endif
|
||||
|
||||
#define TRC_ASSERT_BUFFER_SIZE (sizeof(TraceEntryHandle_t))
|
||||
|
||||
typedef struct TraceAssertBuffer
|
||||
{
|
||||
uint8_t buffer[TRC_ASSERT_BUFFER_SIZE];
|
||||
} TraceAssertBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initializes assert system
|
||||
*
|
||||
* @param[in] pxBuffer The assert data buffer
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceAssertInitialize(TraceAssertBuffer_t *pxBuffer);
|
||||
|
||||
/**
|
||||
* @internal Creates an assert
|
||||
*
|
||||
* @param[in] szFilePath File name
|
||||
* @param[in] uxLineNumber Line number
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
void prvTraceAssertCreate(const char* szFilePath, TraceUnsignedBaseType_t uxLineNumber);
|
||||
|
||||
/**
|
||||
* @brief Retrieves the assert and line number
|
||||
*
|
||||
* @param[out] pxFileNameStringHandle File name string handle
|
||||
* @param[out] puxLineNumber Line number
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceAssertGet(TraceStringHandle_t* pxFileNameStringHandle, TraceUnsignedBaseType_t* puxLineNumber);
|
||||
|
||||
#else /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
#define TRC_ASSERT(__condition)
|
||||
|
||||
#define TRC_ASSERT_ALWAYS_EVALUATE(__condition) (void)(__condition)
|
||||
|
||||
#define TRC_ASSERT_CUSTOM_ON_FAIL(__condition, __custom_on_fail)
|
||||
|
||||
#define TRC_ASSERT_CUSTOM_ON_FAIL_ALWAYS_EVALUATE(__condition, __custom_on_fail) (__condition)
|
||||
|
||||
#define TRC_ASSERT_EQUAL_SIZE(x, y)
|
||||
|
||||
typedef struct TraceAssertBuffer
|
||||
{
|
||||
uint32_t buffer[1];
|
||||
} TraceAssertBuffer_t;
|
||||
|
||||
#define xTraceAssertInitialize(pxBuffer) ((void)pxBuffer, TRC_SUCCESS)
|
||||
|
||||
#define xTraceAssertGet(pxFileNameStringHandle, puxLineNumber) ((void)pxFileNameStringHandle, (void)puxLineNumber, TRC_FAIL)
|
||||
|
||||
#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_ASSERT_H */
|
||||
154
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcCounter.h
Normal file
154
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcCounter.h
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace counter APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_COUNTER_H
|
||||
#define TRC_COUNTER_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_counter_apis Trace Counter APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Sets trace counter callback.
|
||||
*
|
||||
* @param[in] xCallback Callback
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterSetCallback(TraceCounterCallback_t xCallback);
|
||||
|
||||
/**
|
||||
* @brief Creates trace counter.
|
||||
*
|
||||
* @param[in] szName Name.
|
||||
* @param[in] xInitialValue Initial value.
|
||||
* @param[in] xLowerLimit Lower limit.
|
||||
* @param[in] xUpperLimit Upper limit.
|
||||
* @param[out] pxCounterHandle Uninitialized trace counter handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterCreate(const char* szName, TraceBaseType_t xInitialValue, TraceBaseType_t xLowerLimit, TraceBaseType_t xUpperLimit, TraceCounterHandle_t* pxCounterHandle);
|
||||
|
||||
/**
|
||||
* @brief Adds value to trace counter.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
* @param[in] xValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterAdd(TraceCounterHandle_t xCounterHandle, TraceBaseType_t xValue);
|
||||
|
||||
/**
|
||||
* @brief Sets trace counter value.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
* @param[in] xValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterSet(TraceCounterHandle_t xCounterHandle, TraceBaseType_t xValue);
|
||||
|
||||
/**
|
||||
* @brief Gets trace counter value.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
* @param[out] pxValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterGet(TraceCounterHandle_t xCounterHandle, TraceBaseType_t* pxValue);
|
||||
|
||||
/**
|
||||
* @brief Increases trace counter value.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterIncrease(TraceCounterHandle_t xCounterHandle);
|
||||
|
||||
/**
|
||||
* @brief Decreases trace counter value.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterDecrease(TraceCounterHandle_t xCounterHandle);
|
||||
|
||||
/**
|
||||
* @brief Gets trace counter upper limit.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
* @param[out] pxValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterGetUpperLimit(TraceCounterHandle_t xCounterHandle, TraceBaseType_t* pxValue);
|
||||
|
||||
/**
|
||||
* @brief Gets trace counter lower limit.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
* @param[out] pxValue Value
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterGetLowerLimit(TraceCounterHandle_t xCounterHandle, TraceBaseType_t* pxValue);
|
||||
|
||||
/**
|
||||
* @brief Gets trace counter name.
|
||||
*
|
||||
* @param[in] xCounterHandle Initialized trace counter handle.
|
||||
* @param[out] pszName Name.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceCounterGetName(TraceCounterHandle_t xCounterHandle, const char** pszName);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_COUNTER_H */
|
||||
@@ -1,49 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.0
|
||||
* Percepio AB, www.percepio.com
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* trcPortDefines.h
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Some common defines for the trace recorder.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special 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.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef TRC_PORTDEFINES_H
|
||||
#define TRC_PORTDEFINES_H
|
||||
#ifndef TRC_DEFINES_H
|
||||
#define TRC_DEFINES_H
|
||||
|
||||
#define TRC_SUCCESS (0)
|
||||
#define TRC_FAIL (1)
|
||||
|
||||
#define TRC_FREE_RUNNING_32BIT_INCR 1
|
||||
#define TRC_FREE_RUNNING_32BIT_DECR 2
|
||||
@@ -52,11 +21,17 @@
|
||||
#define TRC_CUSTOM_TIMER_INCR 5
|
||||
#define TRC_CUSTOM_TIMER_DECR 6
|
||||
|
||||
#define TRC_STATE_IN_STARTUP 0
|
||||
#define TRC_STATE_IN_TASKSWITCH 1
|
||||
#define TRC_STATE_IN_APPLICATION 2
|
||||
|
||||
/* Start options for vTraceEnable. */
|
||||
#define TRC_INIT 0
|
||||
#define TRC_START_FROM_HOST 0
|
||||
#define TRC_START 1
|
||||
#define TRC_START_AWAIT_HOST 2
|
||||
|
||||
#define TRC_ACKNOWLEDGED (0xABC99123)
|
||||
|
||||
/* Command codes for TzCtrl task */
|
||||
#define CMD_SET_ACTIVE 1 /* Start (param1 = 1) or Stop (param1 = 0) */
|
||||
|
||||
@@ -66,10 +41,71 @@
|
||||
#define TRC_RECORDER_MODE_SNAPSHOT 0
|
||||
#define TRC_RECORDER_MODE_STREAMING 1
|
||||
|
||||
#define TRC_SNAPSHOT_MODE_RING_BUFFER (0x01)
|
||||
#define TRC_SNAPSHOT_MODE_STOP_WHEN_FULL (0x02)
|
||||
|
||||
#define TRC_RECORDER_BUFFER_ALLOCATION_STATIC (0x00)
|
||||
#define TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC (0x01)
|
||||
#define TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM (0x02)
|
||||
|
||||
#define TRC_OPTION_BIT_SHIFT_IRQ_ORDER 0
|
||||
#define TRC_OPTION_BIT_SHIFT_BASE_SIZE 8
|
||||
|
||||
/******************************************************************************/
|
||||
/*** ERROR AND WARNING CODES (check using xTraceErrorGetLast) *****************/
|
||||
/******************************************************************************/
|
||||
|
||||
#define TRC_ERROR_NONE 0x00
|
||||
|
||||
#define TRC_ERROR_ASSERT 0x01
|
||||
#define TRC_ERROR_EVENT_CODE_TOO_LARGE 0x02
|
||||
#define TRC_ERROR_ISR_NESTING_OVERFLOW 0x03
|
||||
#define TRC_ERROR_DWT_NOT_SUPPORTED 0x04
|
||||
#define TRC_ERROR_DWT_CYCCNT_NOT_SUPPORTED 0x05
|
||||
#define TRC_ERROR_TZCTRLTASK_NOT_CREATED 0x06
|
||||
#define TRC_ERROR_STREAM_PORT_WRITE 0x07
|
||||
|
||||
#define TRC_WARNING_ENTRY_TABLE_SLOTS 0x08
|
||||
#define TRC_WARNING_ENTRY_SYMBOL_MAX_LENGTH 0x09
|
||||
#define TRC_WARNING_EVENT_SIZE_TRUNCATED 0x0A
|
||||
#define TRC_WARNING_STREAM_PORT_READ 0x0B
|
||||
#define TRC_WARNING_STREAM_PORT_WRITE 0x0C
|
||||
#define TRC_WARNING_STREAM_PORT_INITIAL_BLOCKING 0x0D
|
||||
#define TRC_WARNING_STACKMON_NO_SLOTS 0x0E
|
||||
|
||||
/* Entry Option definitions */
|
||||
#define TRC_ENTRY_OPTION_EXCLUDED 0x00000001
|
||||
#define TRC_ENTRY_OPTION_HEAP 0x80000000
|
||||
#define TRC_ENTRY_OPTION_EXTENSION 0x40000000
|
||||
#define TRC_ENTRY_OPTION_STATE_MACHINE 0x20000000
|
||||
#define TRC_ENTRY_OPTION_STATE_MACHINE_STATE 0x10000000
|
||||
#define TRC_ENTRY_OPTION_INTERVAL 0x08000000
|
||||
#define TRC_ENTRY_OPTION_COUNTER 0x04000000
|
||||
|
||||
#define TRC_RECORDER_COMPONENT_CORE 0x00000001
|
||||
#define TRC_RECORDER_COMPONENT_ASSERT 0x00000002
|
||||
#define TRC_RECORDER_COMPONENT_BLOB 0x00000004
|
||||
#define TRC_RECORDER_COMPONENT_DIAGNOSTICS 0x00000008
|
||||
#define TRC_RECORDER_COMPONENT_ENTRY 0x00000010
|
||||
#define TRC_RECORDER_COMPONENT_ERROR 0x00000020
|
||||
#define TRC_RECORDER_COMPONENT_EVENT 0x00000040
|
||||
#define TRC_RECORDER_COMPONENT_EVENT_BUFFER 0x00000080
|
||||
#define TRC_RECORDER_COMPONENT_EXTENSION 0x00000100
|
||||
#define TRC_RECORDER_COMPONENT_HEAP 0x00000200
|
||||
#define TRC_RECORDER_COMPONENT_INTERNAL_EVENT_BUFFER 0x00000400
|
||||
#define TRC_RECORDER_COMPONENT_INTERVAL 0x00000800
|
||||
#define TRC_RECORDER_COMPONENT_ISR 0x00001000
|
||||
#define TRC_RECORDER_COMPONENT_MULTI_CORE_EVENT_BUFFER 0x00002000
|
||||
#define TRC_RECORDER_COMPONENT_OBJECT 0x00004000
|
||||
#define TRC_RECORDER_COMPONENT_PRINT 0x00008000
|
||||
#define TRC_RECORDER_COMPONENT_STACK_MONITOR 0x00010000
|
||||
#define TRC_RECORDER_COMPONENT_STATE_MACHINE 0x00020000
|
||||
#define TRC_RECORDER_COMPONENT_STATIC_BUFFER 0x00040000
|
||||
#define TRC_RECORDER_COMPONENT_STRING 0x00080000
|
||||
#define TRC_RECORDER_COMPONENT_TASK 0x00100000
|
||||
#define TRC_RECORDER_COMPONENT_TIMESTAMP 0x00200000
|
||||
#define TRC_RECORDER_COMPONENT_COUNTER 0x00400000
|
||||
|
||||
/* Filter Groups */
|
||||
#define FilterGroup0 (uint16_t)0x0001
|
||||
#define FilterGroup1 (uint16_t)0x0002
|
||||
@@ -135,4 +171,12 @@
|
||||
#define TRC_HARDWARE_PORT_ARM_CORTEX_A9 16 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_POWERPC_Z4 17 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_Altera_NiosII 18 /* Yes Any (Tested with FreeRTOS) */
|
||||
#endif /*TRC_PORTDEFINES_H*/
|
||||
#define TRC_HARDWARE_PORT_ZEPHYR 19 /* Yes Zephyr */
|
||||
#define TRC_HARDWARE_PORT_XTensa_LX6 20 /* Yes ESP-IDF FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_XTensa_LX7 21 /* Yes ESP-IDF FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_Win64 22 /* Yes FreeRTOS on Win64 */
|
||||
#define TRC_HARDWARE_PORT_XMOS_XCOREAI 23 /* Yes FreeRTOS SMP */
|
||||
#define TRC_HARDWARE_PORT_RISCV_RV32I 24 /* Yes FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_CYCLONE_V_HPS 25 /* Yes FreeRTOS */
|
||||
|
||||
#endif /* TRC_PORTDEFINES_H */
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace diagnostic APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_DIAGNOSTICS_H
|
||||
#define TRC_DIAGNOSTICS_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define TRC_DIAGNOSTICS_COUNT 5
|
||||
|
||||
typedef enum TraceDiagnosticsType
|
||||
{
|
||||
TRC_DIAGNOSTICS_ENTRY_SYMBOL_LONGEST_LENGTH = 0x00,
|
||||
TRC_DIAGNOSTICS_ENTRY_SLOTS_NO_ROOM = 0x01,
|
||||
TRC_DIAGNOSTICS_BLOB_MAX_BYTES_TRUNCATED = 0x02,
|
||||
TRC_DIAGNOSTICS_STACK_MONITOR_NO_SLOTS = 0x03,
|
||||
TRC_DIAGNOSTICS_ASSERTS_TRIGGERED = 0x04,
|
||||
} TraceDiagnosticsType_t;
|
||||
|
||||
typedef struct TraceDiagnosticsBuffer
|
||||
{
|
||||
uint8_t buffer[sizeof(TraceBaseType_t) * (TRC_DIAGNOSTICS_COUNT)];
|
||||
} TraceDiagnosticsBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize diagnostics
|
||||
*
|
||||
* @param[in] pxBuffer Diagnostics buffer
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsInitialize(TraceDiagnosticsBuffer_t* pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Retrieve diagnostics value
|
||||
*
|
||||
* @param[in] xType Diagnostics type
|
||||
* @param[out] pxValue Pointer to value
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsGet(TraceDiagnosticsType_t xType, TraceBaseType_t* pxValue);
|
||||
|
||||
/**
|
||||
* @brief Set diagnostics value
|
||||
*
|
||||
* @param[in] xType Diagnostics type
|
||||
* @param[in] xValue Value
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsSet(TraceDiagnosticsType_t xType, TraceBaseType_t xValue);
|
||||
|
||||
/**
|
||||
* @brief Add to diagnostics value
|
||||
*
|
||||
* @param[in] xType Diagnostics type
|
||||
* @param[in] xValue Value
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsAdd(TraceDiagnosticsType_t xType, TraceBaseType_t xValue);
|
||||
|
||||
/**
|
||||
* @brief Increase diagnostics value
|
||||
*
|
||||
* @param[in] xType Diagnostics type
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsIncrease(TraceDiagnosticsType_t xType);
|
||||
|
||||
/**
|
||||
* @brief Decrease diagnostics value
|
||||
*
|
||||
* @param[in] xType Diagnostics type
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsDecrease(TraceDiagnosticsType_t xType);
|
||||
|
||||
/**
|
||||
* @brief Set a new diagnostics value if higher than previous value
|
||||
*
|
||||
* @param[in] xType Dagnostics type
|
||||
* @param[in] xValue Value
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsSetIfHigher(TraceDiagnosticsType_t xType, TraceBaseType_t xValue);
|
||||
|
||||
/**
|
||||
* @brief Set a new diagnostics value if lower than previous value
|
||||
*
|
||||
* @param[in] xType Dagnostics type
|
||||
* @param[in] xValue Value
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsSetIfLower(TraceDiagnosticsType_t xType, TraceBaseType_t xValue);
|
||||
|
||||
/**
|
||||
* @brief Check the diagnostics status
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceDiagnosticsCheckStatus(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_DIAGNOSTICS_H */
|
||||
258
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcEntryTable.h
Normal file
258
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcEntryTable.h
Normal file
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace entry table APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_ENTRY_TABLE_H
|
||||
#define TRC_ENTRY_TABLE_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_entry_table_apis Trace Entry Table APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define TRC_ENTRY_CREATE_WITH_ADDRESS(_pvAddress, _pxEntryHandle) (xTraceEntryCreate(_pxEntryHandle) == TRC_SUCCESS ? (((TraceEntry_t*)*(_pxEntryHandle))->pvAddress = (_pvAddress), TRC_SUCCESS) : TRC_FAIL)
|
||||
#define TRC_ENTRY_SET_STATE(xEntryHandle, uiStateIndex, uxState) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(((TraceEntry_t*)(xEntryHandle))->xStates[uiStateIndex] = (uxState), TRC_SUCCESS)
|
||||
#define TRC_ENTRY_SET_OPTIONS(xEntryHandle, uiMask) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(((TraceEntry_t*)(xEntryHandle))->uiOptions |= (uiMask), TRC_SUCCESS)
|
||||
#define TRC_ENTRY_CLEAR_OPTIONS(xEntryHandle, uiMask) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(((TraceEntry_t*)(xEntryHandle))->uiOptions &= ~(uiMask), TRC_SUCCESS)
|
||||
#define TRC_ENTRY_GET_ADDRESS(xEntryHandle, ppvAddress) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(ppvAddress) = ((TraceEntry_t*)(xEntryHandle))->pvAddress, TRC_SUCCESS)
|
||||
#define TRC_ENTRY_GET_SYMBOL(xEntryHandle, pszSymbol) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(pszSymbol) = ((TraceEntry_t*)(xEntryHandle))->szSymbol, TRC_SUCCESS)
|
||||
#define TRC_ENTRY_GET_STATE(xEntryHandle, uiStateIndex, puxState) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puxState) = ((TraceEntry_t*)(xEntryHandle))->xStates[uiStateIndex], TRC_SUCCESS)
|
||||
#define TRC_ENTRY_GET_OPTIONS(xEntryHandle, puiOptions) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiOptions) = ((TraceEntry_t*)(xEntryHandle))->uiOptions, TRC_SUCCESS)
|
||||
|
||||
#define TRC_ENTRY_TABLE_SLOTS (TRC_CFG_ENTRY_SLOTS)
|
||||
#define TRC_ENTRY_TABLE_STATE_COUNT (3)
|
||||
#define TRC_ENTRY_TABLE_SYMBOL_LENGTH (TRC_CFG_ENTRY_SYMBOL_MAX_LENGTH)
|
||||
#define TRC_ENTRY_TABLE_SLOT_SYMBOL_SIZE ((((sizeof(char) * TRC_ENTRY_TABLE_SYMBOL_LENGTH) + (sizeof(uint32_t) - 1)) / sizeof(uint32_t)) * sizeof(uint32_t))
|
||||
|
||||
/** Trace Entry Structure */
|
||||
typedef struct TraceEntry
|
||||
{
|
||||
void* pvAddress; /**< */
|
||||
TraceUnsignedBaseType_t xStates[TRC_ENTRY_TABLE_STATE_COUNT]; /**< */
|
||||
uint32_t uiOptions; /**< */
|
||||
char szSymbol[TRC_ENTRY_TABLE_SLOT_SYMBOL_SIZE]; /**< */
|
||||
} TraceEntry_t;
|
||||
|
||||
#define TRC_ENTRY_TABLE_SIZE (sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t) + (sizeof(TraceEntry_t) * (TRC_ENTRY_TABLE_SLOTS)))
|
||||
|
||||
/** Trace Entry Table Buffer Structure */
|
||||
typedef struct TraceEntryTableBuffer
|
||||
{
|
||||
uint8_t buffer[(TRC_ENTRY_TABLE_SIZE)]; /**< */
|
||||
} TraceEntryTableBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize trace entry table.
|
||||
*
|
||||
* This routine initializes the trace entry table which maps objects to
|
||||
* symbolic identifiers, state information, and options.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to uninitialized trace entry table buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryTableInitialize(TraceEntryTableBuffer_t* pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Creates trace entry.
|
||||
*
|
||||
* @param[out] pxEntryHandle Pointer to uninitialized trace entry handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryCreate(TraceEntryHandle_t *pxEntryHandle);
|
||||
|
||||
/**
|
||||
* @brief Deletes trace entry.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryDelete(TraceEntryHandle_t xEntryHandle);
|
||||
|
||||
/**
|
||||
* @brief Finds trace entry mapped to object address.
|
||||
*
|
||||
* @param[in] pvAddress Address of object.
|
||||
* @param[out] pxEntryHandle Pointer to uninitialized trace entry handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryFind(void* pvAddress, TraceEntryHandle_t* pxEntryHandle);
|
||||
|
||||
/**
|
||||
* @brief Gets the number of entries in the trace entry table.
|
||||
*
|
||||
* @param[out] puiCount Count.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryGetCount(uint32_t* puiCount);
|
||||
|
||||
/**
|
||||
* @brief Gets trace table entry at index.
|
||||
*
|
||||
* @param[in] index Entry index.
|
||||
* @param[out] pxEntryHandle Pointer to uninitialized trace entry handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryGetAtIndex(uint32_t index, TraceEntryHandle_t* pxEntryHandle);
|
||||
|
||||
/**
|
||||
* @brief Sets symbol for entry.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[out] szSymbol Pointer to symbol string, set by function
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntrySetSymbol(TraceEntryHandle_t xEntryHandle, const char* szSymbol);
|
||||
|
||||
#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
|
||||
|
||||
/**
|
||||
* @brief Creates trace entry mapped to memory address.
|
||||
*
|
||||
* @param[in] pvAddress Address.
|
||||
* @param[out] pxEntryHandle Pointer to uninitialized trace entry handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryCreateWithAddress(void* pvAddress, TraceEntryHandle_t* pxEntryHandle);
|
||||
|
||||
/**
|
||||
* @brief Sets trace entry state.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[in] uiStateIndex Index of state (< TRC_ENTRY_TABLE_STATE_COUNT).
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntrySetState(TraceEntryHandle_t xEntryHandle, uint32_t uiStateIndex, TraceUnsignedBaseType_t uxState);
|
||||
|
||||
/**
|
||||
* @brief Sets trace entry option(s).
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[in] uiMask Option(s) set mask.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntrySetOptions(TraceEntryHandle_t xEntryHandle, uint32_t uiMask);
|
||||
|
||||
/**
|
||||
* @brief Clears trace entry option(s).
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[in] uiMask Options(s) clear mask.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryClearOptions(TraceEntryHandle_t xEntryHandle, uint32_t uiMask);
|
||||
|
||||
/**
|
||||
* @brief Gets linked address for trace entry.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[out] ppvAddress Address.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryGetAddress(TraceEntryHandle_t xEntryHandle, void **ppvAddress);
|
||||
|
||||
/**
|
||||
* @brief Gets symbol for trace entry.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[out] pszSymbol Symbol.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryGetSymbol(TraceEntryHandle_t xEntryHandle, const char** pszSymbol);
|
||||
|
||||
/**
|
||||
* @brief Gets state for trace entry.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[in] uiStateIndex State index (< TRC_ENTRY_TABLE_STATE_COUNT).
|
||||
* @param[out] puxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryGetState(TraceEntryHandle_t xEntryHandle, uint32_t uiStateIndex, TraceUnsignedBaseType_t *puxState);
|
||||
|
||||
/**
|
||||
* @brief Gets options for trace entry.
|
||||
*
|
||||
* @param[in] xEntryHandle Pointer to initialized trace entry handle.
|
||||
* @param[out] puiOptions Options.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEntryGetOptions(TraceEntryHandle_t xEntryHandle, uint32_t *puiOptions);
|
||||
|
||||
#else
|
||||
|
||||
#define xTraceEntryCreateWithAddress TRC_ENTRY_CREATE_WITH_ADDRESS
|
||||
|
||||
#define xTraceEntrySetState TRC_ENTRY_SET_STATE
|
||||
#define xTraceEntrySetOptions TRC_ENTRY_SET_OPTIONS
|
||||
#define xTraceEntryClearOptions TRC_ENTRY_CLEAR_OPTIONS
|
||||
|
||||
#define xTraceEntryGetAddress TRC_ENTRY_GET_ADDRESS
|
||||
#define xTraceEntryGetSymbol TRC_ENTRY_GET_SYMBOL
|
||||
#define xTraceEntryGetState TRC_ENTRY_GET_STATE
|
||||
#define xTraceEntryGetOptions TRC_ENTRY_GET_OPTIONS
|
||||
|
||||
#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_ENTRY_TABLE_H */
|
||||
99
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcError.h
Normal file
99
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcError.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace error APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_ERROR_H
|
||||
#define TRC_ERROR_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_assert_apis Trace Asserts APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define TRC_ERROR_BUFFER_SIZE (sizeof(uint32_t) + sizeof(uint32_t) + sizeof(TraceStringHandle_t))
|
||||
|
||||
typedef struct TraceErrorBuffer
|
||||
{
|
||||
uint32_t buffer[(TRC_ERROR_BUFFER_SIZE) / sizeof(uint32_t)];
|
||||
} TraceErrorBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initializes the error system
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to buffer
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceErrorInitialize(TraceErrorBuffer_t* pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Register a warning
|
||||
*
|
||||
* @param[in] uiErrorCode Label
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceWarning(uint32_t uiErrorCode);
|
||||
|
||||
/**
|
||||
* @brief Register an error
|
||||
*
|
||||
* @param[in] uiErrorCode Error code
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceError(uint32_t uiErrorCode);
|
||||
|
||||
/**
|
||||
* @brief Retrieve the string for the last error
|
||||
*
|
||||
* @param[out] pszError Error string pointer
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceErrorGetLast(const char** pszError);
|
||||
|
||||
/**
|
||||
* @brief Clears any errors
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceErrorClear(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_ERROR_H*/
|
||||
615
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcEvent.h
Normal file
615
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcEvent.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace event buffer APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_EVENT_BUFFER_H
|
||||
#define TRC_EVENT_BUFFER_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_event_buffer_apis Trace Event Buffer APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @def TRC_EVENT_BUFFER_OPTION_SKIP
|
||||
* @brief Buffer should skip new events when full
|
||||
*/
|
||||
#define TRC_EVENT_BUFFER_OPTION_SKIP (0U)
|
||||
|
||||
/**
|
||||
* @def TRC_EVENT_BUFFER_OPTION_OVERWRITE
|
||||
* @brief Buffer should overwrite old events when full
|
||||
*/
|
||||
#define TRC_EVENT_BUFFER_OPTION_OVERWRITE (1U)
|
||||
|
||||
/**
|
||||
* @brief Trace Event Buffer Structure
|
||||
*/
|
||||
typedef struct TraceEventBuffer
|
||||
{
|
||||
uint32_t uiHead; /**< Head index of buffer */
|
||||
uint32_t uiTail; /**< Tail index of buffer */
|
||||
uint32_t uiSize; /**< Buffer size */
|
||||
uint32_t uiOptions; /**< Options (skip/overwrite when full) */
|
||||
uint32_t uiDroppedEvents; /**< Nr of dropped events */
|
||||
uint32_t uiFree; /**< Nr of free bytes */
|
||||
uint32_t uiTimerWraparounds; /**< Nr of timer wraparounds */
|
||||
uint8_t* puiBuffer; /**< Trace Event Buffer: may be NULL */
|
||||
} TraceEventBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize trace event buffer.
|
||||
*
|
||||
* This routine initializes a trace event buffer and assigns it a
|
||||
* memory area based on the supplied buffer.
|
||||
*
|
||||
* Trace event buffer options specifies the buffer behavior regarding
|
||||
* old data, the alternatives are TRC_EVENT_BUFFER_OPTION_SKIP and
|
||||
* TRC_EVENT_BUFFER_OPTION_OVERWRITE (mutal exclusive).
|
||||
*
|
||||
* @param[out] pxTraceEventBuffer Pointer to uninitialized trace event buffer.
|
||||
* @param[in] uiOptions Trace event buffer options.
|
||||
* @param[in] puiBuffer Pointer to buffer that will be used by the trace event buffer.
|
||||
* @param[in] uiSize Size of buffer
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEventBufferInitialize(TraceEventBuffer_t * pxTraceEventBuffer, uint32_t uiOptions,
|
||||
uint8_t *puiBuffer, uint32_t uiSize);
|
||||
|
||||
/**
|
||||
* @brief Pushes data into trace event buffer.
|
||||
*
|
||||
* This routine attempts to push data into the trace event buffer.
|
||||
*
|
||||
* @param[in] pxTraceEventBuffer Pointer to initialized trace event buffer.
|
||||
* @param[in] pxData Pointer to data that should be pushed into trace event buffer.
|
||||
* @param[in] uiSize Size of data.
|
||||
* @param[out] piBytesWritten Bytes written.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEventBufferPush(TraceEventBuffer_t *pxTraceEventBuffer, void *pxData, uint32_t uiSize, int32_t *piBytesWritten);
|
||||
|
||||
/**
|
||||
* @brief Transfer trace event buffer data through streamport.
|
||||
*
|
||||
* This routine will attempt to transfer all existing data in the trace event
|
||||
* buffer through the streamport. New data pushed to the trace event buffer
|
||||
* during the execution of this routine will not be transfered to
|
||||
*
|
||||
* @param[in] pxTraceEventBuffer Pointer to initialized trace event buffer.
|
||||
* @param[out] piBytesWritten Bytes written.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEventBufferTransfer(TraceEventBuffer_t* pxTraceEventBuffer, int32_t* piBytesWritten);
|
||||
|
||||
/**
|
||||
* @brief Clears all data from event buffer.
|
||||
*
|
||||
* @param[in] pxTraceEventBuffer Pointer to initialized trace event buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceEventBufferClear(TraceEventBuffer_t* pxTraceEventBuffer);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_EVENT_BUFFER_H */
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace extension APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_EXTENSION_H
|
||||
#define TRC_EXTENSION_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_extension_apis Trace Extension APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Creates trace extension.
|
||||
*
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uiMajor Major version.
|
||||
* @param[in] uiMinor Minor version.
|
||||
* @param[in] uiPatch Patch version.
|
||||
* @param[in] uiEventCount Event count.
|
||||
* @param[out] pxExtensionHandle Pointer to uninitialized extension handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceExtensionCreate(const char *szName, uint8_t uiMajor, uint8_t uiMinor, uint16_t uiPatch, uint32_t uiEventCount, TraceExtensionHandle_t *pxExtensionHandle);
|
||||
|
||||
/**
|
||||
* @brief Gets extension base event id.
|
||||
*
|
||||
* @param[in] xExtensionHandle Pointer to initialized extension handle.
|
||||
* @param[out] puiBaseEventId Base event id.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceExtensionGetBaseEventId(TraceExtensionHandle_t xExtensionHandle, uint32_t *puiBaseEventId);
|
||||
|
||||
/**
|
||||
* @brief Gets extension event id.
|
||||
*
|
||||
* @param[in] xExtensionHandle Pointer to initialized extension handle.
|
||||
* @param[in] uiLocalEventId Local event id.
|
||||
* @param[out] puiGlobalEventId Global event id.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceExtensionGetEventId(TraceExtensionHandle_t xExtensionHandle, uint32_t uiLocalEventId, uint32_t *puiGlobalEventId);
|
||||
|
||||
/**
|
||||
* @brief Gets extension configuration name.
|
||||
*
|
||||
* @param[in] xExtensionHandle Pointer to initialized extension handle.
|
||||
* @param[out] pszName Name.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceExtensionGetConfigName(TraceExtensionHandle_t xExtensionHandle, const char **pszName);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_EXTENSION_H */
|
||||
@@ -1,422 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.0
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcExtensions.h
|
||||
*
|
||||
* The extension interface of the recorder library, allowing for tracing
|
||||
* function calls to any API without modifications. All that is needed is a
|
||||
* single #include line in the .c files calling the API.
|
||||
*
|
||||
* This can be used to provide more detailed traces, including calls to e.g.
|
||||
* middleware, drivers or important APIs in your application code. This can be
|
||||
* applied selectively to specified functions and may include selected
|
||||
* parameters as well as the return value.
|
||||
*
|
||||
* Unlike the "User Event" concept, an extension is intended for systematic use
|
||||
* and can benefit from all powerful features in Tracealyzer via host-side XML
|
||||
* files that configure how Tracealyzer should interpret each event.
|
||||
*
|
||||
* Extensions are self-contained and easy to integrate, which makes them
|
||||
* convenient for distribution. Software vendors can thus develop such
|
||||
* extensions and provide trace support for their users.
|
||||
*
|
||||
* An extension consists of two files:
|
||||
*
|
||||
* - An extension header file (e.g. "api.tzext.h") - this defines how to
|
||||
* trace the API function calls.
|
||||
*
|
||||
* - An XML file for the Tracealyzer application (e.g. "api-v1.0.0.xml").
|
||||
* This needs to match the tracing setup in your extension header file.
|
||||
*
|
||||
*
|
||||
* USAGE
|
||||
*
|
||||
* This description assumes you already have the extension files for the APIs you
|
||||
* like to trace. To include them, follow these steps:
|
||||
*
|
||||
* 1. Update trcExtensions.h with respect to:
|
||||
*
|
||||
* 1.1. TRC_CFG_EXTENSION_COUNT: The number of extensions to enable (max 4).
|
||||
*
|
||||
* 1.2. The name(s) of the extension header file(s) to include.
|
||||
*
|
||||
* 1.3. The Extension Prefix, i.e., the first part of the definition names
|
||||
* used in each header file.
|
||||
*
|
||||
* 2. Add #include "trcExtensions.h" in all .c files calling the API:
|
||||
*
|
||||
* #include ...
|
||||
* #include "api.h" // The API you like to trace
|
||||
* #include ...
|
||||
* #include "trcExtensions.h"
|
||||
*
|
||||
* We recommend to put this as the LAST #include statement.
|
||||
*
|
||||
* HOWEVER, don't include "trcExtensions.h" in the .c files containing the
|
||||
* functions you intend to trace. The compiler will then complain about
|
||||
* multiple definitions of the trace wrapper function.
|
||||
*
|
||||
* 3. Copy the extension XML file to the "Tracealyzer 4/cfg" folder.
|
||||
* On Windows this is typically
|
||||
*
|
||||
* C:\Program Files\Percepio\Tracealyzer 4\cfg
|
||||
*
|
||||
*
|
||||
* HOW IT WORKS
|
||||
*
|
||||
* By including "trcExtensions.h" in your .c files, the preprocessor will
|
||||
* redefine all calls of the functions specified in the extension header file.
|
||||
* Calls to those functions will now instead call the "trace wrapper functions"
|
||||
* defined in the extension header. The trace wrapper functions then call the
|
||||
* original function as well as the trace recorder library.
|
||||
*
|
||||
* call foo(a) ----> foo__trace(a) -----> foo(a)
|
||||
* -----> trace recorder library
|
||||
*
|
||||
* Note that the trace wrapper function should have the same declaration as the
|
||||
* original function (apart from the name) and also returns any return value
|
||||
* back to the original caller. So functionally this is completely transparent.
|
||||
*
|
||||
* This works also for calls via function pointers, as the assignments of the
|
||||
* function pointers will be affected, so the function pointers will point to
|
||||
* the trace wrapper function.
|
||||
*
|
||||
* It even works when calling binary libraries, since only the calling code
|
||||
* is modified, not the API itself.
|
||||
*
|
||||
* Extensions include a version code (Major.Minor.Patch), which is registered
|
||||
* in the trace and also part of the XML file name. This way, Tracealyzer
|
||||
* automatically finds the matching XML file, even if you open a old trace
|
||||
* recorded using a earlier version of the extension (e.g. if the API has
|
||||
* changed).
|
||||
*
|
||||
* LIMITATIONS
|
||||
*
|
||||
* The main limitation of this automatic approach is that it only allows for
|
||||
* tracing call between different .c files. Moreover, you can't trace multiple
|
||||
* APIs with calls between them. This since the calling file must include
|
||||
* trcExtensions.h, while the called file must NOT include this.
|
||||
*
|
||||
* It is however possible to get around this limitation. You need to add
|
||||
* #undef lines for each affected function to locally disable the redefinition,
|
||||
* and modify each function call to instead call the trace wrapper function.
|
||||
*
|
||||
* #include "trcExtensions.h"
|
||||
* #undef foo
|
||||
* ...
|
||||
* void foo(int a)
|
||||
* {
|
||||
* ...
|
||||
* }
|
||||
* ...
|
||||
* foo__trace(a); // in another function - call foo and trace it
|
||||
*
|
||||
* These changes can remain in your code if you like, as the trace wrappers
|
||||
* works even if the recorder is disabled.
|
||||
*
|
||||
* MAKING YOUR OWN EXTENSIONS
|
||||
*
|
||||
* Examples are found in the extensions directory. We recommend that you start
|
||||
* by looking at aws_secure_sockets files (.h and .xml) that provides a basic
|
||||
* example. The aws_wifi files provides a more advanced example.
|
||||
* The header files include detailed documentation about how to design them,
|
||||
*
|
||||
* The XML files should have the same name as specified in the NAME property
|
||||
* in the header file, followed by the version, i.e.
|
||||
*
|
||||
* <NAME>-v<VERSION_MAJOR>.<<VERSION_MINOR>.<VERSION_PATCH>.xml
|
||||
*
|
||||
* Documentation for the XML file format is not yet available, but is under
|
||||
* development.
|
||||
*
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special 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.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRCEXTENSIONS_H_
|
||||
#define TRCEXTENSIONS_H_
|
||||
|
||||
#include "trcRecorder.h"
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_EXTENSION_COUNT
|
||||
*
|
||||
* Defines the number of extensions included in the trace. Maximum 4 extensions
|
||||
* can be included.
|
||||
*
|
||||
* Default value is 0 (extension support disabled).
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_EXTENSION_COUNT 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_EXT_MAX_NAME_LEN
|
||||
*
|
||||
* Defines the maximum length of extension name(s), i.e. the <EXTENSION>_NAME
|
||||
* macro(s) in trcExtensions.h.
|
||||
*
|
||||
* This value should will by rounded up to the nearest multiple of 4, and must
|
||||
* not be zero. To disable extension support, see TRC_CFG_EXTENSION_COUNT.
|
||||
*
|
||||
* It is important that this setting is large enough so extension names are
|
||||
* not truncated, otherwise the host-side Tracealyzer application won't be able
|
||||
* to find the corresponding XML file.
|
||||
*
|
||||
* You may adjust this to reduce memory usage, or increase it to allow for
|
||||
* longer extension names.
|
||||
*
|
||||
* Default value is 20.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_EXT_MAX_NAME_LEN 20
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_EXTENSION_EVENTCODE_BASE
|
||||
*
|
||||
* The first event code used for the Extension system. This will be the first
|
||||
* event code of the first extension, and other event codes are relative to
|
||||
* this. This can be modified but this is normally not required.
|
||||
*****************************************************************************/
|
||||
#define TRC_EXTENSION_EVENTCODE_BASE 256
|
||||
|
||||
/*** Included Extensions ******************************************************
|
||||
*
|
||||
* Below you specify what extensions to include. For each
|
||||
* extension you must define:
|
||||
*
|
||||
* - HEADER: The header file that defines the trace extension.
|
||||
*
|
||||
* - EXTENSION_PREFIX: The first part of the HEADER definition names.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT1_HEADER "aws_secure_sockets.tzext.h"
|
||||
#define TRC_EXT1_PREFIX TRC_EXT_SOCKETS
|
||||
|
||||
#define TRC_EXT2_HEADER "aws_wifi.tzext.h"
|
||||
#define TRC_EXT2_PREFIX TRC_EXT_WIFI
|
||||
|
||||
#define TRC_EXT3_HEADER "Here you specify the header file for Extensions 3."
|
||||
#define TRC_EXT3_PREFIX NOT_DEFINED
|
||||
|
||||
#define TRC_EXT4_HEADER "Here you specify the header file for Extensions 4."
|
||||
#define TRC_EXT4_PREFIX NOT_DEFINED
|
||||
|
||||
/*** Don't modify below ******************************************************/
|
||||
|
||||
#define ROUNDUP4(n) (4*((n+3)/4))
|
||||
|
||||
typedef struct{
|
||||
uint16_t firstEventCode;
|
||||
uint16_t lastEventCode;
|
||||
uint16_t patchVersion;
|
||||
uint8_t minorVersion;
|
||||
uint8_t majorVersion;
|
||||
char name[ROUNDUP4(TRC_CFG_EXT_MAX_NAME_LEN)];
|
||||
} PSFExtensionEntryType;
|
||||
|
||||
typedef struct{
|
||||
uint16_t extensionEntryCount;
|
||||
uint16_t baseEventCode;
|
||||
#if (TRC_CFG_EXTENSION_COUNT > 0)
|
||||
uint8_t extensionEntryNameMaxLength;
|
||||
uint8_t extensionEntrySize;
|
||||
PSFExtensionEntryType extension[TRC_CFG_EXTENSION_COUNT];
|
||||
#endif
|
||||
} PSFExtensionInfoType;
|
||||
|
||||
|
||||
extern PSFExtensionInfoType PSFExtensionInfo;
|
||||
|
||||
#define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__)
|
||||
#define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
|
||||
|
||||
#define TRC_EXT_BASECODE (PSFExtensionInfo.extension[TRC_EXT_NUMBER-1].firstEventCode)
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT >= 1)
|
||||
#ifdef TRC_EXT1_HEADER
|
||||
#define TRC_EXT_NUMBER 1
|
||||
#include TRC_EXT1_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT >= 2)
|
||||
#ifdef TRC_EXT2_HEADER
|
||||
#define TRC_EXT_NUMBER 2
|
||||
#include TRC_EXT2_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT >= 3)
|
||||
#ifdef TRC_EXT3_HEADER
|
||||
#define TRC_EXT_NUMBER 3
|
||||
#include TRC_EXT3_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 4)
|
||||
#ifdef TRC_EXT3_HEADER
|
||||
#define TRC_EXT_NUMBER 4
|
||||
#include TRC_EXT4_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TRC_EXT1_COUNT CAT(TRC_EXT1_PREFIX, _COUNT)
|
||||
#define TRC_EXT2_COUNT CAT(TRC_EXT2_PREFIX, _COUNT)
|
||||
#define TRC_EXT3_COUNT CAT(TRC_EXT3_PREFIX, _COUNT)
|
||||
#define TRC_EXT4_COUNT CAT(TRC_EXT4_PREFIX, _COUNT)
|
||||
|
||||
#define TRC_EXT1_NAME CAT(TRC_EXT1_PREFIX, _NAME)
|
||||
#define TRC_EXT2_NAME CAT(TRC_EXT2_PREFIX, _NAME)
|
||||
#define TRC_EXT3_NAME CAT(TRC_EXT3_PREFIX, _NAME)
|
||||
#define TRC_EXT4_NAME CAT(TRC_EXT4_PREFIX, _NAME)
|
||||
|
||||
#define TRC_EXT1_VERSION_MAJOR CAT(TRC_EXT1_PREFIX, _VERSION_MAJOR)
|
||||
#define TRC_EXT2_VERSION_MAJOR CAT(TRC_EXT2_PREFIX, _VERSION_MAJOR)
|
||||
#define TRC_EXT3_VERSION_MAJOR CAT(TRC_EXT3_PREFIX, _VERSION_MAJOR)
|
||||
#define TRC_EXT4_VERSION_MAJOR CAT(TRC_EXT4_PREFIX, _VERSION_MAJOR)
|
||||
|
||||
#define TRC_EXT1_VERSION_MINOR CAT(TRC_EXT1_PREFIX, _VERSION_MINOR)
|
||||
#define TRC_EXT2_VERSION_MINOR CAT(TRC_EXT2_PREFIX, _VERSION_MINOR)
|
||||
#define TRC_EXT3_VERSION_MINOR CAT(TRC_EXT3_PREFIX, _VERSION_MINOR)
|
||||
#define TRC_EXT4_VERSION_MINOR CAT(TRC_EXT4_PREFIX, _VERSION_MINOR)
|
||||
|
||||
#define TRC_EXT1_VERSION_PATCH CAT(TRC_EXT1_PREFIX, _VERSION_PATCH)
|
||||
#define TRC_EXT2_VERSION_PATCH CAT(TRC_EXT2_PREFIX, _VERSION_PATCH)
|
||||
#define TRC_EXT3_VERSION_PATCH CAT(TRC_EXT3_PREFIX, _VERSION_PATCH)
|
||||
#define TRC_EXT4_VERSION_PATCH CAT(TRC_EXT4_PREFIX, _VERSION_PATCH)
|
||||
|
||||
#if ((TRC_CFG_EXTENSION_COUNT > 4) || (TRC_CFG_EXTENSION_COUNT < 0))
|
||||
#error "TRC_CFG_EXTENSION_COUNT must be in range [0..4]"
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 0)
|
||||
#define TRC_EXTENSIONS_DATA
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 1)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 2)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT-1, \
|
||||
TRC_EXT2_VERSION_PATCH, \
|
||||
TRC_EXT2_VERSION_MINOR, \
|
||||
TRC_EXT2_VERSION_MAJOR, \
|
||||
TRC_EXT2_NAME } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 3)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT-1, \
|
||||
TRC_EXT2_VERSION_PATCH, \
|
||||
TRC_EXT2_VERSION_MINOR, \
|
||||
TRC_EXT2_VERSION_MAJOR, \
|
||||
TRC_EXT2_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT - 1, \
|
||||
TRC_EXT3_VERSION_PATCH, \
|
||||
TRC_EXT3_VERSION_MINOR, \
|
||||
TRC_EXT3_VERSION_MAJOR, \
|
||||
TRC_EXT3_NAME } \
|
||||
}
|
||||
#endif
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 4)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT-1, \
|
||||
TRC_EXT2_VERSION_PATCH, \
|
||||
TRC_EXT2_VERSION_MINOR, \
|
||||
TRC_EXT2_VERSION_MAJOR, \
|
||||
TRC_EXT2_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT - 1, \
|
||||
TRC_EXT3_VERSION_PATCH, \
|
||||
TRC_EXT3_VERSION_MINOR, \
|
||||
TRC_EXT3_VERSION_MAJOR, \
|
||||
TRC_EXT3_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT + TRC_EXT4_COUNT- 1, \
|
||||
TRC_EXT4_VERSION_PATCH, \
|
||||
TRC_EXT4_VERSION_MINOR, \
|
||||
TRC_EXT4_VERSION_MAJOR, \
|
||||
TRC_EXT4_NAME } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT > 0)
|
||||
#define TRC_EXTENSION_INFO {TRC_CFG_EXTENSION_COUNT, TRC_EXTENSION_EVENTCODE_BASE, ROUNDUP4(TRC_CFG_EXT_MAX_NAME_LEN), sizeof(PSFExtensionEntryType), TRC_EXTENSIONS_DATA}
|
||||
#else
|
||||
#define TRC_EXTENSION_INFO {TRC_CFG_EXTENSION_COUNT, TRC_EXTENSION_EVENTCODE_BASE}
|
||||
#endif
|
||||
|
||||
#endif /* TRCEXTENSIONS_H_ */
|
||||
@@ -1,51 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.0
|
||||
* Percepio AB, www.percepio.com
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* trcHardwarePort.h
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* The hardware abstraction layer for the trace recorder.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special 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.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef TRC_HARDWARE_PORT_H
|
||||
#define TRC_HARDWARE_PORT_H
|
||||
|
||||
#include "trcPortDefines.h"
|
||||
#include <trcDefines.h>
|
||||
|
||||
|
||||
#if (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_NOT_SET)
|
||||
@@ -104,7 +70,7 @@
|
||||
* around. If using TRC_FREE_RUNNING_32BIT_INCR/DECR, this should be 0.
|
||||
*
|
||||
* TRC_HWTC_FREQ_HZ: The clock rate of the TRC_HWTC_COUNT counter in Hz. If using
|
||||
* TRC_OS_TIMER_INCR/DECR, this is should be TRC_HWTC_PERIOD * TRACE_TICK_RATE_HZ.
|
||||
* TRC_OS_TIMER_INCR/DECR, this is should be TRC_HWTC_PERIOD * TRC_TICK_RATE_HZ.
|
||||
* If using a free-running timer, this is often TRACE_CPU_CLOCK_HZ (if running at
|
||||
* the core clock rate). If using TRC_CUSTOM_TIMER_INCR/DECR, this should match
|
||||
* the clock rate of your custom timer (i.e., TRC_HWTC_COUNT). If the default value
|
||||
@@ -126,16 +92,40 @@
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Win32)
|
||||
/* This can be used as a template for any free-running 32-bit counter */
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT (ulGetRunTimeCounterValue())
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ 100000
|
||||
/* This can be used as a template for any free-running 32-bit counter */
|
||||
void vTraceTimerReset(void);
|
||||
uint32_t uiTraceTimerGetFrequency(void);
|
||||
uint32_t uiTraceTimerGetValue(void);
|
||||
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT ((TraceUnsignedBaseType_t)uiTraceTimerGetValue())
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ ((TraceUnsignedBaseType_t)uiTraceTimerGetFrequency())
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT()
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT() vTraceTimerReset()
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Win64)
|
||||
/* This can be used as a template for any free-running 32-bit counter */
|
||||
void vTraceTimerReset(void);
|
||||
uint32_t uiTraceTimerGetFrequency(void);
|
||||
uint32_t uiTraceTimerGetValue(void);
|
||||
|
||||
#define TRC_BASE_TYPE int64_t
|
||||
|
||||
#define TRC_UNSIGNED_BASE_TYPE uint64_t
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT ((TraceUnsignedBaseType_t)uiTraceTimerGetValue())
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ ((TraceUnsignedBaseType_t)uiTraceTimerGetFrequency())
|
||||
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT() vTraceTimerReset()
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_HWIndependent)
|
||||
/* Timestamping by OS tick only (typically 1 ms resolution) */
|
||||
@@ -143,7 +133,7 @@
|
||||
#define TRC_HWTC_COUNT 0
|
||||
#define TRC_HWTC_PERIOD 1
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ TRACE_TICK_RATE_HZ
|
||||
#define TRC_HWTC_FREQ_HZ TRC_TICK_RATE_HZ
|
||||
|
||||
/* Set the meaning of IRQ priorities in ISR tracing - see above */
|
||||
#define TRC_IRQ_PRIORITY_ORDER NOT_SET
|
||||
@@ -154,6 +144,10 @@
|
||||
#error "Can't find the CMSIS API. Please include your processor's header file in trcConfig.h"
|
||||
#endif
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() uint32_t __irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() {__irq_status = __get_PRIMASK(); __set_PRIMASK(1);} /* PRIMASK disables ALL interrupts - allows for tracing in any ISR */
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() {__set_PRIMASK(__irq_status);}
|
||||
|
||||
/**************************************************************************
|
||||
* For Cortex-M3, M4 and M7, the DWT cycle counter is used for timestamping.
|
||||
* For Cortex-M0 and M0+, the SysTick timer is used since DWT is not
|
||||
@@ -166,7 +160,7 @@
|
||||
|
||||
#if ((__CORTEX_M >= 0x03) && (! defined TRC_CFG_ARM_CM_USE_SYSTICK))
|
||||
|
||||
void prvTraceInitCortexM(void);
|
||||
void xTraceHardwarePortInitCortexM(void);
|
||||
|
||||
#define TRC_REG_DEMCR (*(volatile uint32_t*)0xE000EDFC)
|
||||
#define TRC_REG_DWT_CTRL (*(volatile uint32_t*)0xE0001000)
|
||||
@@ -191,7 +185,7 @@
|
||||
/* Bit mask for EXCEVTENA_ bit in DWT_CTRL. Set to 1 to enable DWT_CYCCNT */
|
||||
#define TRC_DWT_CTRL_CYCCNTENA (1)
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT() prvTraceInitCortexM()
|
||||
#define TRC_PORT_SPECIFIC_INIT() xTraceHardwarePortInitCortexM()
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT TRC_REG_DWT_CYCCNT
|
||||
@@ -212,8 +206,11 @@
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Renesas_RX600)
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() TraceBaseType_t __x_irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { __x_irq_status = TRC_KERNEL_PORT_SET_INTERRUPT_MASK(); }
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { TRC_KERNEL_PORT_CLEAR_INTERRUPT_MASK(__x_irq_status); }
|
||||
|
||||
#include "iodefine.h"
|
||||
#include <iodefine.h>
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
@@ -230,16 +227,20 @@
|
||||
|
||||
#define TRC_HWTC_PERIOD (CMT0.CMCOR + 1)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_MICROCHIP_PIC24_PIC32)
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() TraceBaseType_t __x_irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { __x_irq_status = TRC_KERNEL_PORT_SET_INTERRUPT_MASK(); }
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { TRC_KERNEL_PORT_CLEAR_INTERRUPT_MASK(__x_irq_status); }
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (TMR1)
|
||||
#define TRC_HWTC_PERIOD (PR1 + 1)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48)
|
||||
@@ -252,7 +253,7 @@
|
||||
#define TRC_HWTC_COUNT (TRC_RTIFRC0 - (TRC_RTICOMP0 - TRC_RTIUDCP0))
|
||||
#define TRC_HWTC_PERIOD (TRC_RTIUDCP0)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Atmel_AT91SAM7)
|
||||
@@ -263,7 +264,7 @@
|
||||
#define TRC_HWTC_COUNT ((uint32_t)(AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF))
|
||||
#define TRC_HWTC_PERIOD ((uint32_t)(AT91C_BASE_PITC->PITC_PIMR + 1))
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Atmel_UC3A0)
|
||||
@@ -276,7 +277,7 @@
|
||||
#define TRC_HWTC_COUNT ((uint32_t)sysreg_read(AVR32_COUNT))
|
||||
#define TRC_HWTC_PERIOD ((uint32_t)(sysreg_read(AVR32_COMPARE) + 1))
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_NXP_LPC210X)
|
||||
@@ -289,7 +290,7 @@
|
||||
#define TRC_HWTC_COUNT *((uint32_t *)0xE0004008 )
|
||||
#define TRC_HWTC_PERIOD *((uint32_t *)0xE0004018 )
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_MSP430)
|
||||
@@ -300,7 +301,7 @@
|
||||
#define TRC_HWTC_COUNT (TA0R)
|
||||
#define TRC_HWTC_PERIOD (((uint16_t)TACCR0)+1)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_PPC405)
|
||||
@@ -309,9 +310,9 @@
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT mfspr(0x3db)
|
||||
#define TRC_HWTC_PERIOD (TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_PERIOD (TRACE_CPU_CLOCK_HZ / TRC_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_PPC440)
|
||||
@@ -322,9 +323,9 @@
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT mfspr(0x016)
|
||||
#define TRC_HWTC_PERIOD (TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_PERIOD (TRACE_CPU_CLOCK_HZ / TRC_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_MICROBLAZE)
|
||||
@@ -335,24 +336,33 @@
|
||||
* It uses the AXI Timer 0 - the tick interrupt source.
|
||||
* If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.
|
||||
*/
|
||||
#include "xtmrctr_l.h"
|
||||
#include <xtmrctr_l.h>
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )
|
||||
#define TRC_HWTC_PERIOD (XTmrCtr_mGetLoadReg( XPAR_TMRCTR_0_BASEADDR, 0) + 1)
|
||||
#define TRC_HWTC_PERIOD (XTmrCtr_GetLoadReg( XPAR_TMRCTR_0_BASEADDR, 0) + 1)
|
||||
#define TRC_HWTC_DIVISOR 16
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_ZyncUltraScaleR5)
|
||||
|
||||
#include "xttcps_hw.h"
|
||||
extern int cortex_a9_r5_enter_critical(void);
|
||||
extern void cortex_a9_r5_exit_critical(int irq_already_masked_at_enter);
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() uint32_t __irq_mask_status;
|
||||
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { __irq_mask_status = cortex_a9_r5_enter_critical(); }
|
||||
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { cortex_a9_r5_exit_critical(__irq_mask_status); }
|
||||
|
||||
#include <xttcps_hw.h>
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (*(volatile uint32_t *)(configTIMER_BASEADDR + XTTCPS_COUNT_VALUE_OFFSET))
|
||||
#define TRC_HWTC_PERIOD (*(volatile uint32_t *)(configTIMER_BASEADDR + XTTCPS_INTERVAL_VAL_OFFSET))
|
||||
#define TRC_HWTC_DIVISOR 16
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_HWTC_PERIOD * TRACE_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_HWTC_PERIOD * TRC_TICK_RATE_HZ)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -374,6 +384,11 @@
|
||||
|
||||
#include <system.h>
|
||||
#include <altera_avalon_timer_regs.h>
|
||||
#include <sys/alt_irq.h>
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() alt_irq_context __irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION(){__irq_status = alt_irq_disable_all();}
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() {alt_irq_enable_all(__irq_status);}
|
||||
|
||||
#define NOT_SET 1
|
||||
|
||||
@@ -400,7 +415,7 @@
|
||||
#define TRC_HWTC_COUNT altera_nios2_GetTimerSnapReg()
|
||||
#define TRC_HWTC_PERIOD (configCPU_CLOCK_HZ / configTICK_RATE_HZ )
|
||||
#define TRC_HWTC_DIVISOR 16
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_ARM_CORTEX_A9)
|
||||
@@ -422,6 +437,15 @@
|
||||
* TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS is set accordingly.
|
||||
**************************************************************************/
|
||||
|
||||
extern int cortex_a9_r5_enter_critical(void);
|
||||
extern void cortex_a9_r5_exit_critical(int irq_already_masked_at_enter);
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() uint32_t __irq_mask_status;
|
||||
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { __irq_mask_status = cortex_a9_r5_enter_critical(); }
|
||||
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { cortex_a9_r5_exit_critical(__irq_mask_status); }
|
||||
|
||||
/* INPUT YOUR PERIPHERAL BASE ADDRESS HERE (0xF8F00000 for Xilinx Zynq 7000)*/
|
||||
#define TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS 0
|
||||
|
||||
@@ -450,7 +474,7 @@
|
||||
*****************************************************************************************/
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -466,11 +490,133 @@
|
||||
#error "Only GCC Supported!"
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_CYCLONE_V_HPS)
|
||||
#include "alt_clock_manager.h"
|
||||
|
||||
extern int cortex_a9_r5_enter_critical(void);
|
||||
extern void cortex_a9_r5_exit_critical(int irq_already_masked_at_enter);
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() uint32_t __irq_mask_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { __irq_mask_status = cortex_a9_r5_enter_critical(); }
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { cortex_a9_r5_exit_critical(__irq_mask_status); }
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT *((uint32_t *)0xFFFEC200)
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (({ \
|
||||
uint32_t __freq; \
|
||||
alt_clk_freq_get( ALT_CLK_MPU_PERIPH, &__freq ); \
|
||||
__freq; \
|
||||
}))
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* For Arm Cortex-A and Cortex-R in general. */
|
||||
static inline uint32_t prvGetCPSR(void)
|
||||
{
|
||||
unsigned long ret;
|
||||
/* GCC-style assembly for getting the CPSR/APSR register, where the system execution mode is found. */
|
||||
__asm__ __volatile__(" mrs %0, cpsr" : "=r" (ret) : /* no inputs */ );
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#error "Only GCC Supported!"
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_ZEPHYR)
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() int key;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { key = irq_lock(); }
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { irq_unlock(key); }
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT k_cycle_get_32()
|
||||
#define TRC_HWTC_PERIOD (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / CONFIG_SYS_CLOCK_TICKS_PER_SEC)
|
||||
#define TRC_HWTC_DIVISOR 4
|
||||
#define TRC_HWTC_FREQ_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0 // Lower IRQ priority values are more significant
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT()
|
||||
|
||||
#elif ((TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XTensa_LX6) || (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XTensa_LX7))
|
||||
/**
|
||||
* @note When running with SMP FreeRTOS we cannot use the CCOUNT register for timestamping,
|
||||
* instead we use the external 40MHz timer for synchronized timestamping between the cores.
|
||||
*/
|
||||
#if CONFIG_FREERTOS_UNICORE == 1
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT ({ unsigned int __ccount; \
|
||||
__asm__ __volatile__("rsr.ccount %0" : "=a"(__ccount)); \
|
||||
__ccount; })
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define TRC_HWTC_FREQ_HZ (CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000)
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#define TRC_HWTC_FREQ_HZ (CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000)
|
||||
#else
|
||||
#error "Invalid IDF target, check your sdkconfig."
|
||||
#endif
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 4
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
#else
|
||||
/**
|
||||
* @brief Fetch core agnostic timestamp using the external 40MHz timer. This is used by tracerecorder
|
||||
* when running with both cores.
|
||||
*
|
||||
* @return Ticks since the timer started
|
||||
*/
|
||||
uint32_t prvGetSMPTimestamp();
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT prvGetSMPTimestamp()
|
||||
#define TRC_HWTC_FREQ_HZ 40000000
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 4
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
#endif
|
||||
|
||||
#if !defined(TRC_HWTC_FREQ_HZ)
|
||||
#error "The XTensa LX6/LX7 trace hardware clock frequency is not defined."
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_RISCV_RV32I)
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() unsigned int __irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() __asm__ __volatile__("csrr %0, mstatus \n\t" \
|
||||
"csrci mstatus, 8 \n\t" \
|
||||
"andi %0, %0, 8 \n\t" \
|
||||
: "=r"(__irq_status))
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() __asm__ __volatile__("csrr a1, mstatus \n\t" \
|
||||
"or %0, %0, a1 \n\t" \
|
||||
"csrs mstatus, %0 \n\t" \
|
||||
: \
|
||||
: "r" (__irq_status) \
|
||||
: "a1")
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT ({ unsigned int __count; \
|
||||
__asm__ __volatile__("rdcycle %0" : "=r"(__count)); \
|
||||
__count; })
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ 16000000
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XMOS_XCOREAI)
|
||||
#define TRC_PORT_SPECIFIC_INIT()
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT xscope_gettime()
|
||||
#define TRC_HWTC_PERIOD (configCPU_CLOCK_HZ / configTICK_RATE_HZ )
|
||||
#define TRC_HWTC_DIVISOR 4
|
||||
#define TRC_HWTC_FREQ_HZ 100000000
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_POWERPC_Z4)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */
|
||||
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() TraceBaseType_t __x_irq_status;
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() { __x_irq_status = TRC_KERNEL_PORT_SET_INTERRUPT_MASK(); }
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() { TRC_KERNEL_PORT_CLEAR_INTERRUPT_MASK(__x_irq_status); }
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
//#define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING
|
||||
#define TRC_HWTC_COUNT PIT.TIMER[configTICK_PIT_CHANNEL].CVAL.R // must be the PIT channel used for the systick
|
||||
@@ -555,4 +701,14 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef TRACE_ALLOC_CRITICAL_SECTION
|
||||
#define TRACE_ALLOC_CRITICAL_SECTION() TRC_KERNEL_PORT_ALLOC_CRITICAL_SECTION()
|
||||
#endif
|
||||
#ifndef TRACE_ENTER_CRITICAL_SECTION
|
||||
#define TRACE_ENTER_CRITICAL_SECTION() TRC_KERNEL_PORT_ENTER_CRITICAL_SECTION()
|
||||
#endif
|
||||
#ifndef TRACE_EXIT_CRITICAL_SECTION
|
||||
#define TRACE_EXIT_CRITICAL_SECTION() TRC_KERNEL_PORT_EXIT_CRITICAL_SECTION()
|
||||
#endif
|
||||
|
||||
#endif /*TRC_SNAPSHOT_HARDWARE_PORT_H*/
|
||||
|
||||
135
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcHeap.h
Normal file
135
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcHeap.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace heap APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_HEAP_H
|
||||
#define TRC_HEAP_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#ifndef TRC_USE_HEAPS
|
||||
#define TRC_USE_HEAPS 1
|
||||
#endif
|
||||
|
||||
#if (TRC_USE_HEAPS == 1)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_heap_apis Trace Heap APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Creates trace heap.
|
||||
*
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uxCurrent Current level.
|
||||
* @param[in] uxHighWaterMark High water mark
|
||||
* @param[in] uxMax Maximum level.
|
||||
* @param[out] pxHeapHandle Pointer to uninitialized trace heap handle.
|
||||
* @return traceResult
|
||||
*/
|
||||
traceResult xTraceHeapCreate(const char *szName, TraceUnsignedBaseType_t uxCurrent, TraceUnsignedBaseType_t uxHighWaterMark, TraceUnsignedBaseType_t uxMax, TraceHeapHandle_t *pxHeapHandle);
|
||||
|
||||
/**
|
||||
* @brief Signals trace heap alloc.
|
||||
*
|
||||
* @param[in] xHeapHandle Pointer to initialized trace heap handle.
|
||||
* @param[in] pvAddress Address.
|
||||
* @param[in] uxSize Size.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceHeapAlloc(TraceHeapHandle_t xHeapHandle, void *pvAddress, TraceUnsignedBaseType_t uxSize);
|
||||
|
||||
/**
|
||||
* @brief Signals trace heap free.
|
||||
*
|
||||
* @param[in] xHeapHandle Pointer to initialized trace heap handle.
|
||||
* @param[in] pvAddress Address.
|
||||
* @param[in] uxSize Size.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceHeapFree(TraceHeapHandle_t xHeapHandle, void* pvAddress, TraceUnsignedBaseType_t uxSize);
|
||||
|
||||
/**
|
||||
* @brief Gets trace heap current allocation size.
|
||||
*
|
||||
* @param[in] xHeapHandle Pointer to initialized trace heap handle.
|
||||
* @param[out] puxCurrent Current.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceHeapGetCurrent(TraceHeapHandle_t xHeapHandle, TraceUnsignedBaseType_t *puxCurrent);
|
||||
|
||||
/**
|
||||
* @brief Gets trace heap high water mark.
|
||||
*
|
||||
* @param[in] xHeapHandle Pointer to initialized trace heap handle.
|
||||
* @param[out] puxHighWaterMark High water mark.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceHeapGetHighWaterMark(TraceHeapHandle_t xHeapHandle, TraceUnsignedBaseType_t *puxHighWaterMark);
|
||||
|
||||
/**
|
||||
* @brief Gets trace heap max size.
|
||||
*
|
||||
* @param[in] xHeapHandle Pointer to initialized trace heap handle.
|
||||
* @param[out] puxMax Max.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceHeapGetMax(TraceHeapHandle_t xHeapHandle, TraceUnsignedBaseType_t *puxMax);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define xTraceHeapCreate(szName, uxCurrent, uxHighWaterMark, uxMax, pxHeapHandle) ((void)szName, (void)uxCurrent, (void)uxHighWaterMark, (void)uxMax, pxHeapHandle != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
|
||||
#define xTraceHeapAlloc(xHeapHandle, pvAddress, uxSize) ((void)xHeapHandle, (void)pvAddress, (void)uxSize, TRC_SUCCESS)
|
||||
|
||||
#define xTraceHeapFree(xHeapHandle, pvAddress, uxSize) ((void)xHeapHandle, (void)pvAddress, (void)uxSize, TRC_SUCCESS)
|
||||
|
||||
#define xTraceHeapGetCurrent(xHeapHandle, puxCurrent) ((void)xHeapHandle, puxCurrent != 0 ? *puxCurrent = 0 : 0, puxCurrent != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
|
||||
#define xTraceHeapGetHighWaterMark(xHeapHandle, puxHighWaterMark) ((void)xHeapHandle, puxHighWaterMark != 0 ? *puxHighWaterMark = 0 : 0, puxHighWaterMark != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
|
||||
#define xTraceHeapGetMax(xHeapHandle, puxMax) ((void)xHeapHandle, puxMax != 0 ? *puxMax = 0 : 0, puxMax != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
|
||||
#endif /* (TRC_USE_HEAPS == 1) */
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_HEAP_H */
|
||||
226
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcISR.h
Normal file
226
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcISR.h
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace ISR APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_ISR_H
|
||||
#define TRC_ISR_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_isr_apis Trace ISR APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @internal Trace ISR Core Info Structure
|
||||
*/
|
||||
typedef struct TraceISRCoreInfo
|
||||
{
|
||||
TraceISRHandle_t handleStack[TRC_CFG_MAX_ISR_NESTING]; /**< */
|
||||
int32_t stackIndex; /**< */
|
||||
int32_t isPendingContextSwitch; /**< */
|
||||
} TraceISRCoreInfo_t;
|
||||
|
||||
/**
|
||||
* @internal Trace ISR Info Structure
|
||||
*/
|
||||
typedef struct TraceISRInfo
|
||||
{
|
||||
TraceISRCoreInfo_t coreInfos[TRC_CFG_CORE_COUNT]; /* ISR handles */
|
||||
} TraceISRInfo_t;
|
||||
|
||||
/* We expose this to enable faster access */
|
||||
extern TraceISRInfo_t* pxTraceISRInfo;
|
||||
|
||||
#define TRACE_ISR_INFO_BUFFER_SIZE (sizeof(TraceISRInfo_t))
|
||||
|
||||
/**
|
||||
* @internal Trace ISR Info Buffer
|
||||
*/
|
||||
typedef struct TraceISRInfoBuffer
|
||||
{
|
||||
uint8_t buffer[(TRACE_ISR_INFO_BUFFER_SIZE)]; /**< */
|
||||
} TraceISRInfoBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize ISR trace system.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to memory that will be used by the ISR
|
||||
* trace system.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceISRInitialize(TraceISRInfoBuffer_t *pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Registers trace ISR.
|
||||
*
|
||||
* This routine stores a name and priority level for an Interrupt Service Routine,
|
||||
* to allow for better visualization. Returns a TraceISRHandle_t used by
|
||||
* xTraceISRBegin/xTraceISREnd.
|
||||
*
|
||||
* Example:
|
||||
* #define PRIO_OF_ISR_TIMER1 3 // the hardware priority of the interrupt
|
||||
* TraceISRHandle_t xISRTimer1Handle = 0; // The ID set by the recorder
|
||||
* ...
|
||||
* xTraceISRRegister("ISRTimer1", PRIO_OF_ISR_TIMER1, &xISRTimer1Handle);
|
||||
* ...
|
||||
* void ISR_handler()
|
||||
* {
|
||||
* xTraceISRBegin(xISRTimer1Handle);
|
||||
* ...
|
||||
* xTraceISREnd(0);
|
||||
* }
|
||||
*
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uiPriority Priority.
|
||||
* @param[out] pxISRHandle Pointer to uninitialized ISR trace handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceISRRegister(const char* szName, uint32_t uiPriority, TraceISRHandle_t* pxISRHandle);
|
||||
|
||||
/**
|
||||
* @brief Registers the beginning of an Interrupt Service Routine.
|
||||
*
|
||||
* This routine register the beginning of an ISR using a TraceISRHandle_t.
|
||||
* See xTraceISRRegister for and example of using ISR tracing.
|
||||
*
|
||||
* @param[in] xISRHandle Pointer to initialized ISR trace handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceISRBegin(TraceISRHandle_t xISRHandle);
|
||||
|
||||
/**
|
||||
* @brief Registers the end of an Interrupt Service Routine.
|
||||
*
|
||||
* This routine register the end of an ISR using a TraceISRHandle_t.
|
||||
* See xTraceISRRegister for and example of using ISR tracing.
|
||||
*
|
||||
* The parameter uxIsTaskSwitchRequired indicates if the interrupt has requested
|
||||
* a task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the
|
||||
* interrupt is assumed to return to the previous context.
|
||||
*
|
||||
* @param[in] xIsTaskSwitchRequired Task switch required.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceISREnd(TraceBaseType_t xIsTaskSwitchRequired);
|
||||
|
||||
#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
|
||||
|
||||
/**
|
||||
* @brief Gets current trace ISR nesting level.
|
||||
*
|
||||
* This routine gets the current trace ISR nesting level for the
|
||||
* CPU on which it is called.
|
||||
*
|
||||
* @param[out] puiValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceISRGetCurrentNesting(int32_t* puiValue);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return int32_t
|
||||
*/
|
||||
int32_t xTraceISRGetCurrentNestingReturned(void);
|
||||
|
||||
/**
|
||||
* @brief Gets current ISR trace handle.
|
||||
*
|
||||
* @param[out] pxISRHandle ISR Handle.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceISRGetCurrent(TraceISRHandle_t* pxISRHandle);
|
||||
|
||||
#else /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/**
|
||||
* @brief Gets current trace ISR nesting level.
|
||||
*
|
||||
* This routine gets the current trace ISR nesting level for the
|
||||
* CPU on which it is called.
|
||||
*
|
||||
* @param[out] puiValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceISRGetCurrentNesting(puiValue) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiValue) = pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].stackIndex, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return int32_t
|
||||
*/
|
||||
#define xTraceISRGetCurrentNestingReturned() (pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].stackIndex)
|
||||
|
||||
/**
|
||||
* @brief Gets current trace ISR nesting level.
|
||||
*
|
||||
* This routine gets the current trace ISR nesting level for the
|
||||
* CPU on which it is called.
|
||||
*
|
||||
* @param[out] puiValue Value.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceISRGetCurrent(pxISRHandle) (xTraceISRGetCurrentNestingReturned() >= 0 ? (*(pxISRHandle) = pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].handleStack[xTraceISRGetCurrentNestingReturned()], TRC_SUCCESS) : TRC_FAIL)
|
||||
|
||||
#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/** @internal Deprecated - Provides backwards-compability with older recorders for now, will be removed in the future */
|
||||
TraceISRHandle_t xTraceSetISRProperties(const char* szName, uint32_t uiPriority);
|
||||
|
||||
/** @internal Deprecated - Provides backwards-compability with older recorders for now, will be removed in the future */
|
||||
#define xTraceGetCurrentISRNesting(puiValue) xTraceISRGetCurrentNesting(puiValue)
|
||||
|
||||
/** @internal Deprecated - Provides backwards-compability with older recorders for now, will be removed in the future */
|
||||
#define vTraceStoreISRBegin(xISRHandle) xTraceISRBegin(xISRHandle)
|
||||
|
||||
/** @internal Deprecated - Provides backwards-compability with older recorders for now, will be removed in the future */
|
||||
#define vTraceStoreISREnd(xIsTaskSwitchRequired) xTraceISREnd(xIsTaskSwitchRequired)
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_ISR_H */
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public internal event buffer APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_INTERNAL_BUFFER_H
|
||||
#define TRC_INTERNAL_BUFFER_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#ifndef TRC_USE_INTERNAL_BUFFER
|
||||
#define TRC_USE_INTERNAL_BUFFER 1
|
||||
#endif
|
||||
|
||||
#if (TRC_USE_INTERNAL_BUFFER == 1)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_internal_event_buffer_apis Trace Internal Event Buffer APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @internal Initializes the internal trace event buffer used by certain stream ports.
|
||||
*
|
||||
* @param[in] puiBuffer Pointer to previously allocated memory buffer
|
||||
* @param[in] uiSize Size of buffer
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceInternalEventBufferInitialize(uint8_t* puiBuffer, uint32_t uiSize);
|
||||
|
||||
/**
|
||||
* @brief Pushes data to the internal trace event buffer.
|
||||
*
|
||||
* @param[in] pvData Pointer to data
|
||||
* @param[in] uiSize Size of data
|
||||
* @param[out] piBytesWritten Bytes written.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceInternalEventBufferPush(void *pvData, uint32_t uiSize, int32_t *piBytesWritten);
|
||||
|
||||
/**
|
||||
* @brief Transfers all internal trace event buffer data using the function
|
||||
* xTraceStreamPortWriteData(...) as defined in trcStreamPort.h.
|
||||
*
|
||||
* This function is intended to be called by the periodic TzCtrl task with a
|
||||
* suitable delay (e.g. 10-100 ms).
|
||||
*
|
||||
* In case of errors from the streaming interface, it registers a warning
|
||||
* (TRC_WARNING_STREAM_PORT_WRITE) provided by xTraceErrorGetLast().
|
||||
*
|
||||
* @param[out] piBytesWritten Bytes written.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceInternalEventBufferTransfer(int32_t *piBytesWritten);
|
||||
|
||||
/**
|
||||
* @brief Clears all trace events in the internal trace event buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceInternalEventBufferClear(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* (TRC_USE_INTERNAL_BUFFER == 1)*/
|
||||
|
||||
#define xTraceInternalEventBufferInitialize(puiBuffer, uiSize) ((void)uiSize, puiBuffer != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
#define xTraceInternalEventBufferPush(pvData, uiSize, piBytesWritten) ((void)uiSize, (void)piBytesWritten, pvData != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
#define xTraceInternalEventBufferTransfer(piBytesWritten) ((void)piBytesWritten, TRC_SUCCESS)
|
||||
#define xTraceInternalEventBufferClear() (void)(TRC_SUCCESS)
|
||||
|
||||
#endif /* (TRC_USE_INTERNAL_BUFFER == 1)*/
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_INTERNAL_BUFFER_H */
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace interval APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_INTERVAL_H
|
||||
#define TRC_INTERVAL_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_interval_apis Trace Interval APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Creates trace interval.
|
||||
*
|
||||
* @param[in] szName Name.
|
||||
* @param[out] pxIntervalHandle Pointer to uninitialized trace interval.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceIntervalCreate(const char *szName, TraceIntervalHandle_t *pxIntervalHandle);
|
||||
|
||||
/**
|
||||
* @brief Starts trace interval.
|
||||
*
|
||||
* @param[in] xIntervalHandle Pointer to initialized trace interval.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceIntervalStart(TraceIntervalHandle_t xIntervalHandle);
|
||||
|
||||
/**
|
||||
* @brief Stops trace interval.
|
||||
*
|
||||
* @param[in] xIntervalHandle Pointer to initialized trace interval.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceIntervalStop(TraceIntervalHandle_t xIntervalHandle);
|
||||
|
||||
/**
|
||||
* @brief Gets trace interval state.
|
||||
*
|
||||
* @param[in] xIntervalHandle Pointer to initialized trace interval.
|
||||
* @param[out] puxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceIntervalGetState(TraceIntervalHandle_t xIntervalHandle, uint32_t *puxState);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_INTERVAL_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @internal Public trace multicore event buffer APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_MULTI_CORE_EVENT_BUFFER_H
|
||||
#define TRC_MULTI_CORE_EVENT_BUFFER_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_multi_core_event_buffer_apis Trace Multi-Core Event Buffer APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Trace Multi-Core Event Buffer Structure
|
||||
*/
|
||||
typedef struct TraceMultiCoreEventBuffer
|
||||
{
|
||||
TraceEventBuffer_t *xEventBuffer[TRC_CFG_CORE_COUNT]; /**< */
|
||||
} TraceMultiCoreEventBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize multi-core event buffer.
|
||||
*
|
||||
* This routine initializes a multi-core trace event buffer and assignts it
|
||||
* a memory area based on the supplied buffer.
|
||||
*
|
||||
* Trace event buffer options specifies the buffer behavior regarding
|
||||
* old data, the alternatives are TRC_EVENT_BUFFER_OPTION_SKIP and
|
||||
* TRC_EVENT_BUFFER_OPTION_OVERWRITE (mutal exclusive).
|
||||
*
|
||||
* @param[out] pxTraceMultiCoreEventBuffer Pointer to unitialized multi-core trace event buffer.
|
||||
* @param[in] uiOptions Trace event buffer options.
|
||||
* @param[in] puiBuffer Pointer to buffer that will be used by the multi-core trace event buffer.
|
||||
* @param[in] uiSize Size of buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceMultiCoreEventBufferInitialize(TraceMultiCoreEventBuffer_t* pxTraceMultiCoreEventBuffer, uint32_t uiOptions,
|
||||
uint8_t* puiBuffer, uint32_t uiSize);
|
||||
|
||||
|
||||
|
||||
#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
|
||||
|
||||
/**
|
||||
* @brief Pushes data into multi-core trace event buffer.
|
||||
*
|
||||
* This routine attempts to push data into the multi-core trace event buffer. Selection
|
||||
* of which core the data is pushed for is managed automatically through the
|
||||
* TRC_CFG_GET_CURRENT_CORE macro which is defined on an RTOS basis.
|
||||
*
|
||||
* @param[in] pxTraceMultiCoreEventBuffer Pointer to initialized multi-core event buffer.
|
||||
* @param[in] pvData Pointer to data should be pushed into multi-core event buffer.
|
||||
* @param[in] uiSize Size of data that should be pushed into multi-core trace event buffer.
|
||||
* @param[out] piBytesWritten Pointer to variable which the routine will write the number
|
||||
* of bytes that was pushed into the multi-core trace event buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceMultiCoreEventBufferPush(TraceMultiCoreEventBuffer_t* pxTraceMultiCoreEventBuffer, void* pvData, uint32_t uiSize, int32_t* piBytesWritten);
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
* @brief Pushes data into multi-core trace event buffer.
|
||||
*
|
||||
* This routine attempts to push data into the multi-core trace event buffer. Selection
|
||||
* of which core the data is pushed for is managed automatically through the
|
||||
* TRC_CFG_GET_CURRENT_CORE macro which is defined on an RTOS basis.
|
||||
*
|
||||
* @param[in] pxTraceMultiCoreEventBuffer Pointer to initialized multi-core event buffer.
|
||||
* @param[in] pvData Pointer to data should be pushed into multi-core event buffer.
|
||||
* @param[in] uiSize Size of data that should be pushed into multi-core trace event buffer.
|
||||
* @param[out] piBytesWritten Pointer to variable which the routine will write the number
|
||||
* of bytes that was pushed into the multi-core trace event buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceMultiCoreEventBufferPush(pxTraceMultiCoreEventBuffer, pvData, uiSize, piBytesWritten) xTraceEventBufferPush((pxTraceMultiCoreEventBuffer)->xEventBuffer[TRC_CFG_GET_CURRENT_CORE()], pvData, uiSize, piBytesWritten)
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Transfer multi-core trace event buffer data through streamport.
|
||||
*
|
||||
* This routine will attempt to transfer all existing data in the multi-core trace event
|
||||
* buffer through the streamport. New data pushed to the trace event buffer
|
||||
* during the execution of this routine will not be transfered to
|
||||
*
|
||||
* @param[in] pxTraceMultiCoreEventBuffer Pointer to initialized multi-core event buffer.
|
||||
* @param[out] piBytesWritten Pointer to variable which the routine will write the number
|
||||
* of bytes that was pushed into the multi-core trace event buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceMultiCoreEventBufferTransfer(TraceMultiCoreEventBuffer_t* pxTraceMultiCoreEventBuffer, int32_t* piBytesWritten);
|
||||
|
||||
/**
|
||||
* @brief Clears all data from event buffer.
|
||||
*
|
||||
* @param[in] pxTraceMultiCoreEventBuffer Pointer to initialized multi-core trace event buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceMultiCoreEventBufferClear(TraceMultiCoreEventBuffer_t* pxTraceMultiCoreEventBuffer);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_MULTI_CORE_EVENT_BUFFER_H */
|
||||
202
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcObject.h
Normal file
202
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcObject.h
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace object APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_OBJECT_H
|
||||
#define TRC_OBJECT_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_object_apis Trace Object APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Registers trace object.
|
||||
*
|
||||
* @param[in] uiEventCode Event code.
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uxStateCount State count.
|
||||
* @param[in] uxStates States.
|
||||
* @param[in] uxOptions Options.
|
||||
* @param[out] pxObjectHandle Pointer to uninitialized trace object.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectRegisterInternal(uint32_t uiEventCode, void* pvObject, const char* szName, TraceUnsignedBaseType_t uxStateCount, TraceUnsignedBaseType_t uxStates[], TraceUnsignedBaseType_t uxOptions, TraceObjectHandle_t* pxObjectHandle);
|
||||
|
||||
/**
|
||||
* @brief Registers trace object.
|
||||
*
|
||||
* @param[in] uiEventCode Event code.
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uxState State.
|
||||
* @param[out] pxObjectHandle Pointer to uninitialized trace object.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectRegister(uint32_t uiEventCode, void *pvObject, const char* szName, TraceUnsignedBaseType_t uxState, TraceObjectHandle_t *pxObjectHandle);
|
||||
|
||||
/**
|
||||
* @brief Unregisters trace object.
|
||||
*
|
||||
* @param[in] xObjectHandle Pointer to initialized trace object.
|
||||
* @param[in] uiEventCode Event code.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectUnregister(TraceObjectHandle_t xObjectHandle, uint32_t uiEventCode, TraceUnsignedBaseType_t uxState);
|
||||
|
||||
/**
|
||||
* @brief Sets trace object name.
|
||||
*
|
||||
* @param[in] xObjectHandle Pointer to initialized trace object.
|
||||
* @param[in] szName Name.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectSetName(TraceObjectHandle_t xObjectHandle, const char *szName);
|
||||
|
||||
/**
|
||||
* @brief Sets trace object state.
|
||||
*
|
||||
* @param[in] xObjectHandle Pointer to initialized trace object.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceObjectSetState(xObjectHandle, uxState) xTraceObjectSetSpecificState(xObjectHandle, 0, uxState)
|
||||
|
||||
/**
|
||||
* @brief Sets trace object specific state state.
|
||||
*
|
||||
* @param[in] xObjectHandle Pointer to initialized trace object.
|
||||
* @param[in] uiIndex State Index.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceObjectSetSpecificState(xObjectHandle, uiIndex, uxState) xTraceEntrySetState((TraceEntryHandle_t)(xObjectHandle), uiIndex, uxState)
|
||||
|
||||
/**
|
||||
* @brief Sets trace object options.
|
||||
*
|
||||
* @param[in] xObjectHandle Pointer to initialized trace object.
|
||||
* @param[in] uiOptions Options.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceObjectSetOptions(xObjectHandle, uiOptions) xTraceEntrySetOptions((TraceEntryHandle_t)(xObjectHandle), uiOptions)
|
||||
|
||||
/**
|
||||
* @brief Registers trace object without trace object handle.
|
||||
*
|
||||
* @param[in] uiEventCode Event code.
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectRegisterWithoutHandle(uint32_t uiEventCode, void* pvObject, const char* szName, TraceUnsignedBaseType_t uxState);
|
||||
|
||||
/**
|
||||
* @brief Unregisters trace object without trace object handle.
|
||||
*
|
||||
* @param[in] uiEventCode Event code.
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectUnregisterWithoutHandle(uint32_t uiEventCode, void* pvObject, TraceUnsignedBaseType_t uxState);
|
||||
|
||||
/**
|
||||
* @brief Set trace object name without trace object handle.
|
||||
*
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] szName Name.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectSetNameWithoutHandle(void* pvObject, const char* szName);
|
||||
|
||||
/**
|
||||
* @brief Set trace object state without trace object handle.
|
||||
*
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceObjectSetStateWithoutHandle(pvObject, uxState) xTraceObjectSetSpecificStateWithoutHandle(pvObject, 0, uxState)
|
||||
|
||||
/**
|
||||
* @brief Sets trace object specific state without trace object
|
||||
* handle.
|
||||
*
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] uiIndex State index.
|
||||
* @param[in] uxState State.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectSetSpecificStateWithoutHandle(void* pvObject, uint32_t uiIndex, TraceUnsignedBaseType_t uxState);
|
||||
|
||||
/**
|
||||
* @brief Sets trace object options without trace object handle.
|
||||
*
|
||||
* @param[in] pvObject Object.
|
||||
* @param[in] uiOptions Options.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceObjectSetOptionsWithoutHandle(void* pvObject, uint32_t uiOptions);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_OBJECT_H */
|
||||
207
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcPrint.h
Normal file
207
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcPrint.h
Normal file
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace print APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_PRINT_H
|
||||
#define TRC_PRINT_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_print_apis Trace Print APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if (TRC_CFG_SCHEDULING_ONLY == 0) && (TRC_CFG_INCLUDE_USER_EVENTS == 1)
|
||||
|
||||
/** @internal */
|
||||
#define TRC_PRINT_BUFFER_SIZE (sizeof(TraceStringHandle_t) + sizeof(TraceStringHandle_t))
|
||||
|
||||
/**
|
||||
* @internal Trace Print Buffer Structure
|
||||
*/
|
||||
typedef struct TracePrintBuffer
|
||||
{
|
||||
uint32_t buffer[(TRC_PRINT_BUFFER_SIZE) / sizeof(uint32_t)];
|
||||
} TracePrintBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize print trace system.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to memory that will be used by the print
|
||||
* trace system.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTracePrintInitialize(TracePrintBuffer_t* pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Generate "User Events" with unformatted text.
|
||||
*
|
||||
* User Events can be used for very efficient application logging, and are shown
|
||||
* as yellow labels in the main trace view.
|
||||
*
|
||||
* You may group User Events into User Event Channels. The yellow User Event
|
||||
* labels shows the logged string, preceded by the channel name within
|
||||
* brackets. For example:
|
||||
*
|
||||
* "[MyChannel] Hello World!"
|
||||
*
|
||||
* The User Event Channels are shown in the View Filter, which makes it easy to
|
||||
* select what User Events you wish to display. User Event Channels are created
|
||||
* using xTraceStringRegister().
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* TraceStringHandle_t xChannel = xTraceStringRegister("MyChannel");
|
||||
* ...
|
||||
* xTracePrint(xChannel, "Hello World!");
|
||||
*
|
||||
* @param[in] xChannel Channel.
|
||||
* @param[in] szString String.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTracePrint(TraceStringHandle_t xChannel, const char* szString);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for vTracePrintF for printing to default channel.
|
||||
*
|
||||
* Wrapper for vTracePrintF, 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 xTraceConsoleChannelPrintF
|
||||
* ...
|
||||
* LogString("My value is: %d", myValue);
|
||||
*
|
||||
* @param[in] szFormat Format
|
||||
* @param[in] ...
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceConsoleChannelPrintF(const char* szFormat, ...);
|
||||
|
||||
/**
|
||||
* @brief Generates "User Events" with formatted text and data.
|
||||
*
|
||||
* Generates "User Events", with formatted text and data, similar to a "printf".
|
||||
* It is very fast since the actual formatting is done on the host side when the
|
||||
* trace is displayed.
|
||||
*
|
||||
* User Events can be used for very efficient application logging, and are shown
|
||||
* as yellow labels in the main trace view.
|
||||
* An advantage of User Events is that data can be plotted in the "User Event
|
||||
* Signal Plot" view, visualizing any data you log as User Events, discrete
|
||||
* states or control system signals (e.g. system inputs or outputs).
|
||||
*
|
||||
* You may group User Events into User Event Channels. The yellow User Event
|
||||
* labels show the logged string, preceded by the channel name within brackets.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* "[MyChannel] Hello World!"
|
||||
*
|
||||
* The User Event Channels are shown in the View Filter, which makes it easy to
|
||||
* select what User Events you wish to display. User Event Channels are created
|
||||
* using xTraceStringRegister().
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* TraceStringHandle_t adc_uechannel = xTraceStringRegister("ADC User Events");
|
||||
* ...
|
||||
* xTracePrintF(adc_uechannel,
|
||||
* "ADC channel %d: %d volts",
|
||||
* ch, adc_reading);
|
||||
*
|
||||
* All data arguments are assumed to be 32 bit wide. The following formats are
|
||||
* supported:
|
||||
* %d - signed integer. The following width and padding format is supported: "%05d" -> "-0042" and "%5d" -> " -42"
|
||||
* %u - unsigned integer. The following width and padding format is supported: "%05u" -> "00042" and "%5u" -> " 42"
|
||||
* %X - hexadecimal (uppercase). The following width and padding format is supported: "%04X" -> "002A" and "%4X" -> " 2A"
|
||||
* %x - hexadecimal (lowercase). The following width and padding format is supported: "%04x" -> "002a" and "%4x" -> " 2a"
|
||||
* %s - string (currently, this must be an earlier stored symbol name)
|
||||
*
|
||||
* Up to 15 data arguments are allowed, with a total size of maximum 60 byte
|
||||
* including 8 byte for the base event fields and the format string. So with
|
||||
* one data argument, the maximum string length is 48 chars. If this is exceeded
|
||||
* the string is truncated (4 bytes at a time).
|
||||
*
|
||||
* @param[in] xChannel Channel.
|
||||
* @param[in] szFormat Format.
|
||||
* @param[in] ...
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTracePrintF(TraceStringHandle_t xChannel, const char* szFormat, ...);
|
||||
|
||||
/**
|
||||
* @brief Generates "User Events" with formatted text and data.
|
||||
*
|
||||
* @param[in] xChannel Channel.
|
||||
* @param[in] szFormat Format.
|
||||
* @param[in] xVL Variable list arguments.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceVPrintF(TraceStringHandle_t xChannel, const char* szFormat, va_list xVL);
|
||||
|
||||
#else /* (TRC_CFG_SCHEDULING_ONLY == 0) && (TRC_CFG_INCLUDE_USER_EVENTS == 1) */
|
||||
|
||||
typedef struct TracePrintBuffer
|
||||
{
|
||||
uint32_t buffer[1];
|
||||
} TracePrintBuffer_t;
|
||||
|
||||
#define xTracePrintInitialize(p) ((void)p, p != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
|
||||
#define xTracePrint(c, s) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3((void)c, (void)s, TRC_SUCCESS)
|
||||
|
||||
#define xTracePrintF(c, s, ...) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3((void)c, (void)s, TRC_SUCCESS)
|
||||
|
||||
#define xTraceConsoleChannelPrintF(s, ...) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)s, TRC_SUCCESS)
|
||||
|
||||
#define xTraceVPrintF(c, s, v) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4((void)c, (void)s, (void)v, TRC_SUCCESS)
|
||||
|
||||
#endif /* (TRC_CFG_SCHEDULING_ONLY == 0) && (TRC_CFG_INCLUDE_USER_EVENTS == 1) */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
|
||||
#endif /* TRC_PRINT_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Percepio Trace Recorder SDK for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace stack monitor APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_STACK_MONITOR_H
|
||||
#define TRC_STACK_MONITOR_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <stdint.h>
|
||||
#include <trcRecorder.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_stack_monitor_apis Trace Stack Monitor APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if (((TRC_CFG_ENABLE_STACK_MONITOR) == 1) && ((TRC_CFG_SCHEDULING_ONLY) == 0))
|
||||
|
||||
#define TRACE_STACK_MONITOR_BUFFER_SIZE ((sizeof(void*) + sizeof(TraceUnsignedBaseType_t)) * (TRC_CFG_STACK_MONITOR_MAX_TASKS) + sizeof(uint32_t))
|
||||
|
||||
/**
|
||||
* @internal Trace Stack Monitor Buffer Structure
|
||||
*/
|
||||
typedef struct TraceStackMonitorBuffer
|
||||
{
|
||||
uint32_t buffer[(TRACE_STACK_MONITOR_BUFFER_SIZE) / sizeof(uint32_t)];
|
||||
} TraceStackMonitorBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize trace stack monitor system.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to memory that will be used by the trace
|
||||
* stack monitor system.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStackMonitorInitialize(TraceStackMonitorBuffer_t* pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Adds task/thread to trace stack monitor.
|
||||
*
|
||||
* @param[in] pvTask Task/Thread.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStackMonitorAdd(void* pvTask);
|
||||
|
||||
/**
|
||||
* @brief Removes task/thread from trace stack monitor.
|
||||
*
|
||||
* @param[in] pvTask Task/Thread.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStackMonitorRemove(void* pvTask);
|
||||
|
||||
/**
|
||||
* @brief Gets trace stack monitor tread/task at index.
|
||||
*
|
||||
* @param[in] uiIndex Index.
|
||||
* @param[in] ppvTask Task/Thread.
|
||||
* @param[out] puxLowWaterMark Low water mark.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStackMonitorGetAtIndex(uint32_t uiIndex, void** ppvTask, TraceUnsignedBaseType_t* puxLowWaterMark);
|
||||
|
||||
/**
|
||||
* @brief Performs trace stack monitor reporting.
|
||||
*
|
||||
* This routine performs a trace stack monitor check and report
|
||||
* for TRC_CFG_STACK_MONITOR_MAX_REPORTS number of registered
|
||||
* tasks/threads.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStackMonitorReport(void);
|
||||
|
||||
#else /* (((TRC_CFG_ENABLE_STACK_MONITOR) == 1) && ((TRC_CFG_SCHEDULING_ONLY) == 0)) */
|
||||
|
||||
typedef struct TraceStackMonitorBuffer
|
||||
{
|
||||
uint32_t buffer[1];
|
||||
} TraceStackMonitorBuffer_t;
|
||||
|
||||
#define xTraceStackMonitorInitialize(pxBuffer) ((void)pxBuffer, TRC_SUCCESS)
|
||||
|
||||
#define xTraceStackMonitorDiagnosticsGet(xType, puiValue) ((void)xType, puiValue != 0 ? *puiValue = 0 : 0, puiValue != 0 ? TRC_SUCCESS : TRC_FAIL)
|
||||
|
||||
#define xTraceStackMonitorDiagnosticsSet(xType, uiValue) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3((void)xType, (void)uiValue, TRC_SUCCESS)
|
||||
|
||||
#define xTraceStackMonitorAdd(pvTask) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)pvTask, TRC_SUCCESS)
|
||||
|
||||
#define xTraceStackMonitorRemove(pvTask) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)pvTask, TRC_SUCCESS)
|
||||
|
||||
#define xTraceStackMonitorGetAtIndex(uiIndex, ppvTask, puxLowWaterMark) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4((void)uiIndex, (void)ppvTask, (void)puxLowWaterMark, TRC_SUCCESS)
|
||||
|
||||
#define xTraceStackMonitorReport() TRC_COMMA_EXPR_TO_STATEMENT_EXPR_1(TRC_SUCCESS)
|
||||
|
||||
#endif /* (((TRC_CFG_ENABLE_STACK_MONITOR) == 1) && ((TRC_CFG_SCHEDULING_ONLY) == 0)) */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_STACK_MONITOR_H */
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace state machine APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_STATE_MACHINE_H
|
||||
#define TRC_STATE_MACHINE_H
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_state_machine_apis Trace State Machine APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Creates trace state machine.
|
||||
*
|
||||
* @param[in] szName Name.
|
||||
* @param[out] pxStateMachineHandle Pointer to uninitialized trace state machine.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStateMachineCreate(const char *szName, TraceStateMachineHandle_t *pxStateMachineHandle);
|
||||
|
||||
/**
|
||||
* @brief Creates trace state machine state.
|
||||
*
|
||||
* @param[in] xStateMachineHandle Pointer to initialized trace state machine.
|
||||
* @param[in] szName Name.
|
||||
* @param[out] pxStateHandle Pointer to uninitialized trace state machine state.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStateMachineStateCreate(TraceStateMachineHandle_t xStateMachineHandle, const char *szName, TraceStateMachineStateHandle_t *pxStateHandle);
|
||||
|
||||
/**
|
||||
* @brief Sets trace state machine state.
|
||||
*
|
||||
* @param[in] xStateMachineHandle Pointer to initialized trace state machine.
|
||||
* @param[in] xStateHandle Pointer to initialized trace state machine state.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStateMachineSetState(TraceStateMachineHandle_t xStateMachineHandle, TraceStateMachineStateHandle_t xStateHandle);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_STATE_MACHINE_H */
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace static buffer APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_STATIC_BUFFER_H
|
||||
#define TRC_STATIC_BUFFER_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_static_buffer_apis Trace Static Buffer APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* A buffer type that is maximum size */
|
||||
typedef uint8_t TraceStaticBuffer_t[TRC_MAX_BLOB_SIZE];
|
||||
|
||||
/**
|
||||
* @internal Trace Core Static Buffer Core Structure
|
||||
*/
|
||||
typedef struct TraceCoreStaticBufferCore
|
||||
{
|
||||
TraceStaticBuffer_t dummyEvents[(TRC_CFG_MAX_ISR_NESTING)+1]; /**< */
|
||||
} TraceCoreStaticBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Trace Static Buffer Table Structure
|
||||
*/
|
||||
typedef struct TraceStaticBufferTable
|
||||
{
|
||||
TraceCoreStaticBuffer_t coreDummyEvents[TRC_CFG_CORE_COUNT]; /**< Temporary buffers used for event or blob creation. */
|
||||
} TraceStaticBufferTable_t;
|
||||
|
||||
#define TRC_STATIC_BUFFER_BUFFER_SIZE (sizeof(TraceStaticBufferTable_t))
|
||||
|
||||
/**
|
||||
* @internal Trace Static Buffer Buffer Structure
|
||||
*/
|
||||
typedef struct TraceStaticBufferBuffer
|
||||
{
|
||||
uint8_t buffer[TRC_STATIC_BUFFER_BUFFER_SIZE]; /**< */
|
||||
} TraceStaticBufferBuffer_t;
|
||||
|
||||
extern TraceStaticBufferTable_t* pxTraceStaticBufferTable;
|
||||
|
||||
/**
|
||||
* @internal Initialize trace static buffer.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to memory that will be used by the
|
||||
* trace static buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStaticBufferInitialize(TraceStaticBufferBuffer_t* pxBuffer);
|
||||
|
||||
#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
|
||||
|
||||
/**
|
||||
* @brief Gets trace static buffer.
|
||||
*
|
||||
* @param[out] ppvBuffer Buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStaticBufferGet(void **ppvBuffer);
|
||||
|
||||
#else /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/**
|
||||
* @brief Gets trace static buffer.
|
||||
*
|
||||
* @param[out] ppvBuffer Buffer.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceStaticBufferGet(ppvBuffer) (*ppvBuffer = (void*)&pxTraceStaticBufferTable->coreDummyEvents[TRC_CFG_GET_CURRENT_CORE()].dummyEvents[xTraceISRGetCurrentNestingReturned() + 1], TRC_SUCCESS)
|
||||
|
||||
#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_STATIC_BUFFER_H */
|
||||
76
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcString.h
Normal file
76
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcString.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace string APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_STRING_H
|
||||
#define TRC_STRING_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_string_apis Trace String APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Registers a trace string.
|
||||
*
|
||||
* This routine registers a strings in the recorder, e.g. for names of user
|
||||
* event channels.
|
||||
*
|
||||
* Example:
|
||||
* TraceStringHandle_t myEventHandle;
|
||||
* xTraceStringRegister("MyUserEvent", &myEventHandle);
|
||||
* ...
|
||||
* xTracePrintF(myEventHandle, "My value is: %d", myValue);
|
||||
*
|
||||
* @param[in] szString String.
|
||||
* @param[out] pString Pointer to uninitialized trace string.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceStringRegister(const char *szString, TraceStringHandle_t* pString);
|
||||
|
||||
/**
|
||||
* @brief Registers a trace string.
|
||||
*
|
||||
* @deprecated Remains for backward compability with pre v4.6 versions
|
||||
* of the recorder.
|
||||
*
|
||||
* @param[in] name Name.
|
||||
*
|
||||
* @return TraceStringHandle_t
|
||||
*/
|
||||
TraceStringHandle_t xTraceRegisterString(const char *name);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_STRING_H */
|
||||
243
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTask.h
Normal file
243
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTask.h
Normal file
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace task APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_TASK_H
|
||||
#define TRC_TASK_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_task_apis Trace Task APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef TRC_CFG_ENABLE_STACK_MONITOR
|
||||
#define TRC_CFG_ENABLE_STACK_MONITOR 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @internal Trace Task Info Structure
|
||||
*/
|
||||
typedef struct TraceTaskInfo
|
||||
{
|
||||
void* coreTasks[TRC_CFG_CORE_COUNT];
|
||||
} TraceTaskInfo_t;
|
||||
|
||||
extern TraceTaskInfo_t* pxTraceTaskInfo;
|
||||
|
||||
#define TRACE_TASK_INFO_BUFFER_SIZE (sizeof(TraceTaskInfo_t))
|
||||
|
||||
/**
|
||||
* @internal Trace Task Info Buffer Structure
|
||||
*/
|
||||
typedef struct TraceTaskInfoBuffer
|
||||
{
|
||||
uint8_t buffer[TRACE_TASK_INFO_BUFFER_SIZE];
|
||||
} TraceTaskInfoBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize trace task system.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to memory that will be used by the
|
||||
* trace task system.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskInitialize(TraceTaskInfoBuffer_t* pxBuffer);
|
||||
|
||||
/**
|
||||
* @brief Register trace task in the trace.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uxPriority Priority.
|
||||
* @param[out] pxTaskHandle Pointer to uninitialized trace task.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskRegister(pvTask, szName, uxPriority, pxTaskHandle) ((((pvTask) != 0) && (xTraceObjectRegister(PSF_EVENT_TASK_CREATE, pvTask, szName, uxPriority, (TraceObjectHandle_t*)(pxTaskHandle)) == TRC_SUCCESS)) ? (xTraceStackMonitorAdd(pvTask), TRC_SUCCESS) : TRC_FAIL)
|
||||
|
||||
/**
|
||||
* @brief Unregister trace task from trace.
|
||||
*
|
||||
* @param[in] xTaskHandle Pointer to initialized trace task.
|
||||
* @param[in] uxPriority Priority.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskUnregister(TraceTaskHandle_t xTaskHandle, TraceUnsignedBaseType_t uxPriority);
|
||||
|
||||
/**
|
||||
* @brief Sets trace task name.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] szName Name.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskSetName xTraceObjectSetName
|
||||
|
||||
/**
|
||||
* @brief Sets trace task priority.
|
||||
*
|
||||
* @param[in] xTaskHandle Pointer to initialized trace task.
|
||||
* @param[in] uxPriority Priority.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskSetPriority(TraceTaskHandle_t xTaskHandle, TraceUnsignedBaseType_t uxPriority);
|
||||
|
||||
/**
|
||||
* @brief Registers trace task without trace task handle.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] szName Name.
|
||||
* @param[in] uxPriority Priority.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskRegisterWithoutHandle(pvTask, szName, uxPriority) ((((pvTask) != 0) && (xTraceObjectRegisterWithoutHandle(PSF_EVENT_TASK_CREATE, pvTask, szName, uxPriority) == TRC_SUCCESS)) ? (xTraceStackMonitorAdd(pvTask), TRC_SUCCESS) : TRC_FAIL)
|
||||
|
||||
/**
|
||||
* @brief Unregisters trace task without trace task handle.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] uxPriority Priority.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskUnregisterWithoutHandle(pvTask, uxPriority) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(xTraceStackMonitorRemove(pvTask), xTraceObjectUnregisterWithoutHandle(PSF_EVENT_TASK_DELETE, pvTask, uxPriority))
|
||||
|
||||
/**
|
||||
* @brief Sets trace task name without trace task handle.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] szName Name.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskSetNameWithoutHandle xTraceObjectSetNameWithoutHandle
|
||||
|
||||
/**
|
||||
* @brief Sets trace task priority without trace task handle.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] uxPriority Priority.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskSetPriorityWithoutHandle(void* pvTask, TraceUnsignedBaseType_t uxPriority);
|
||||
|
||||
/**
|
||||
* @brief Registers trace task switch event.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
* @param[in] uxPriority Priority.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskSwitch(void* pvTask, TraceUnsignedBaseType_t uxPriority);
|
||||
|
||||
#if (TRC_CFG_INCLUDE_READY_EVENTS == 1)
|
||||
/**
|
||||
* @brief Registers trace task ready event.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskReady(void* pvTask);
|
||||
#else
|
||||
#define xTraceTaskReady(p) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)p, TRC_SUCCESS)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Sets current trace task.
|
||||
*
|
||||
* @param[in] pvTask Task.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskSetCurrent(pvTask) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTaskInfo->coreTasks[TRC_CFG_GET_CURRENT_CORE()] = (pvTask), TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Gets current trace task.
|
||||
*
|
||||
* @param[out] ppvTask Task.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTaskGetCurrent(ppvTask) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(ppvTask) = pxTraceTaskInfo->coreTasks[TRC_CFG_GET_CURRENT_CORE()], TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Registers trace task instance finished event.
|
||||
*
|
||||
* This routine creates a trace event that ends the current task instance at
|
||||
* this very instant. This makes the viewer split the current fragment at
|
||||
* this point and begin a new actor instance, even if no task-switch has
|
||||
* occurred
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskInstanceFinishedNow(void);
|
||||
|
||||
/**
|
||||
* @brief Marks the current trace task instance as finished on the next
|
||||
* kernel call.
|
||||
*
|
||||
* If that kernel call is blocking, the instance ends after the blocking event
|
||||
* and the corresponding return event is then the start of the next instance.
|
||||
* If the kernel call is not blocking, the viewer instead splits the current
|
||||
* fragment right before the kernel call, which makes this call the first event
|
||||
* of the next instance.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTaskInstanceFinishedNext(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_TASK_H */
|
||||
253
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTimestamp.h
Normal file
253
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTimestamp.h
Normal file
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Public trace timestamp APIs.
|
||||
*/
|
||||
|
||||
#ifndef TRC_TIMESTAMP_H
|
||||
#define TRC_TIMESTAMP_H
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#include <trcTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup trace_timestamp_apis Trace Timestamp APIs
|
||||
* @ingroup trace_recorder_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Trace Timestamp Structure
|
||||
*/
|
||||
typedef struct TraceTimestamp
|
||||
{
|
||||
uint32_t type; /**< Timer type (direction) */
|
||||
TraceUnsignedBaseType_t frequency; /**< Timer Frequency */
|
||||
uint32_t period; /**< Timer Period */
|
||||
uint32_t wraparounds; /**< Nr of timer wraparounds */
|
||||
uint32_t osTickHz; /**< RTOS tick frequency */
|
||||
uint32_t latestTimestamp; /**< Latest timestamp */
|
||||
uint32_t osTickCount; /**< RTOS tick count */
|
||||
} TraceTimestamp_t;
|
||||
|
||||
extern TraceTimestamp_t* pxTraceTimestamp;
|
||||
|
||||
#define TRC_TIMESTAMP_RECORD_SIZE (sizeof(TraceTimestamp_t))
|
||||
|
||||
/**
|
||||
* @internal Trace Timestamp Buffer Structure
|
||||
*/
|
||||
typedef struct TraceTimestampBuffer
|
||||
{
|
||||
uint32_t buffer[(TRC_TIMESTAMP_RECORD_SIZE) / sizeof(uint32_t)];
|
||||
} TraceTimestampBuffer_t;
|
||||
|
||||
/**
|
||||
* @internal Initialize trace timestamp system.
|
||||
*
|
||||
* @param[in] pxBuffer Pointer to memory that will be used by the
|
||||
* trace timestamp system.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampInitialize(TraceTimestampBuffer_t *pxBuffer);
|
||||
|
||||
#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
|
||||
|
||||
/**
|
||||
* @brief Gets current trace timestamp.
|
||||
*
|
||||
* @param[out] puiTimestamp Timestamp.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampGet(uint32_t* puiTimestamp);
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp wraparounds.
|
||||
*
|
||||
* @param[out] puiTimerWraparounds Timer wraparounds.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampGetWraparounds(uint32_t* puiTimerWraparounds);
|
||||
|
||||
/**
|
||||
* @brief Sets trace timestamp frequency.
|
||||
*
|
||||
* @param[in] uxFrequency Frequency.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampSetFrequency(TraceUnsignedBaseType_t uxFrequency);
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp frequency.
|
||||
*
|
||||
* @param[out] puxFrequency Frequency.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampGetFrequency(TraceUnsignedBaseType_t* puxFrequency);
|
||||
|
||||
/**
|
||||
* @brief Sets trace timestamp period.
|
||||
*
|
||||
* @param[in] uiPeriod Period.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampSetPeriod(uint32_t uiPeriod);
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp period.
|
||||
*
|
||||
* @param[out] puiPeriod Period.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampGetPeriod(uint32_t* puiPeriod);
|
||||
|
||||
/**
|
||||
* @brief Sets trace timestamp OS tick count.
|
||||
*
|
||||
* @param[in] uiOsTickCount OS tick count.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampSetOsTickCount(uint32_t uiOsTickCount);
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp OS tick count.
|
||||
*
|
||||
* @param[in] puiOsTickCount
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
traceResult xTraceTimestampGetOsTickCount(uint32_t *puiOsTickCount);
|
||||
|
||||
#else /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/**
|
||||
* @brief Gets current trace timestamp.
|
||||
*
|
||||
* @param[out] puiTimestamp Timestamp.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#if ((TRC_HWTC_TYPE == TRC_FREE_RUNNING_32BIT_INCR) || (TRC_HWTC_TYPE == TRC_CUSTOM_TIMER_INCR))
|
||||
#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)
|
||||
#elif ((TRC_HWTC_TYPE == TRC_FREE_RUNNING_32BIT_DECR) || (TRC_HWTC_TYPE == TRC_CUSTOM_TIMER_DECR))
|
||||
#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)
|
||||
#elif ((TRC_HWTC_TYPE == TRC_OS_TIMER_INCR) || (TRC_HWTC_TYPE == TRC_OS_TIMER_DECR))
|
||||
#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)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp wraparounds.
|
||||
*
|
||||
* @param[out] puiTimerWraparounds Timer wraparounds.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampGetWraparounds(puiTimerWraparounds) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiTimerWraparounds) = pxTraceTimestamp->wraparounds, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Sets trace timestamp frequency.
|
||||
*
|
||||
* @param[in] uxFrequency Frequency.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampSetFrequency(uxFrequency) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTimestamp->frequency = uxFrequency, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Sets trace timestamp period.
|
||||
*
|
||||
* @param[in] uiPeriod Period.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampSetPeriod(uiPeriod) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTimestamp->period = uiPeriod, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Sets trace timestamp OS tick count.
|
||||
*
|
||||
* @param[in] uiOsTickCount OS tick count.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampSetOsTickCount(uiOsTickCount) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(pxTraceTimestamp->osTickCount = uiOsTickCount, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp frequency.
|
||||
*
|
||||
* @param[out] puxFrequency Frequency.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampGetFrequency(puxFrequency) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puxFrequency) = pxTraceTimestamp->frequency, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp period.
|
||||
*
|
||||
* @param[out] puiPeriod Period.
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampGetPeriod(puiPeriod) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiPeriod) = pxTraceTimestamp->period, TRC_SUCCESS)
|
||||
|
||||
/**
|
||||
* @brief Gets trace timestamp OS tick count.
|
||||
*
|
||||
* @param[in] puiOsTickCount
|
||||
*
|
||||
* @retval TRC_FAIL Failure
|
||||
* @retval TRC_SUCCESS Success
|
||||
*/
|
||||
#define xTraceTimestampGetOsTickCount(puiOsTickCount) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiOsTickCount) = pxTraceTimestamp->osTickCount, TRC_SUCCESS)
|
||||
|
||||
#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
|
||||
|
||||
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
|
||||
|
||||
#endif /* TRC_TIMESTAMP_H */
|
||||
69
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTypes.h
Normal file
69
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTypes.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* The common types.
|
||||
*/
|
||||
|
||||
#ifndef TRC_TYPES_H
|
||||
#define TRC_TYPES_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <trcConfig.h>
|
||||
#include <trcHardwarePort.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TRC_BASE_TYPE
|
||||
#define TRC_BASE_TYPE int32_t
|
||||
#endif
|
||||
|
||||
#ifndef TRC_UNSIGNED_BASE_TYPE
|
||||
#define TRC_UNSIGNED_BASE_TYPE uint32_t
|
||||
#endif
|
||||
|
||||
typedef TRC_UNSIGNED_BASE_TYPE TraceUnsignedBaseType_t;
|
||||
|
||||
typedef TRC_BASE_TYPE TraceBaseType_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t traceResult;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceEventHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceISRHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceEntryHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceTaskHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceObjectHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceExtensionHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceHeapHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceIntervalHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceStateMachineHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceStateMachineStateHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceStringHandle_t;
|
||||
|
||||
typedef TraceUnsignedBaseType_t TraceCounterHandle_t;
|
||||
|
||||
typedef void (*TraceCounterCallback_t)(TraceCounterHandle_t xCounterHandle);
|
||||
|
||||
/* DEPRECATED. Backwards compatibility */
|
||||
typedef TraceStringHandle_t traceString;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_TYPES_H */
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Percepio Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* The interface for trace utility functions.
|
||||
*/
|
||||
|
||||
#ifndef TRC_UTILITY_H
|
||||
#define TRC_UTILITY_H
|
||||
|
||||
#ifndef TRC_MEMCPY
|
||||
#define TRC_MEMCPY(dst, src, size) \
|
||||
{ \
|
||||
uint32_t __i; \
|
||||
for (__i = 0; __i < size; __i++) { \
|
||||
((uint8_t*)(dst))[__i] = ((uint8_t*)(src))[__i]; \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define TRC_STRCAT(dst, dst_size, pDstLength, src) \
|
||||
{ \
|
||||
TraceUnsignedBaseType_t uxTRC_STRCAT_INDEX = 0; \
|
||||
while (*(pDstLength) < (dst_size)) \
|
||||
{ \
|
||||
dst[*(pDstLength)] = src[uxTRC_STRCAT_INDEX]; \
|
||||
if (dst[*(pDstLength)] == 0) \
|
||||
break; \
|
||||
(*(pDstLength))++; \
|
||||
uxTRC_STRCAT_INDEX++; \
|
||||
} \
|
||||
}
|
||||
|
||||
#if (defined(TRC_CFG_USE_GCC_STATEMENT_EXPR) && TRC_CFG_USE_GCC_STATEMENT_EXPR == 1) || __GNUC__
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_1(e1) ({e1;})
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(e1, e2) ({e1; e2;})
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3(e1, e2, e3) ({e1; e2; e3;})
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4(e1, e2, e3, e4) ({e1; e2; e3; e4;})
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_5(e1, e2, e3, e4, e5) ({e1; e2; e3; e4; e5;})
|
||||
#else
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_1(e1) (e1)
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(e1, e2) (e1, e2)
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3(e1, e2, e3) (e1, e2, e3)
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4(e1, e2, e3, e4) (e1, e2, e3, e4)
|
||||
#define TRC_COMMA_EXPR_TO_STATEMENT_EXPR_5(e1, e2, e3, e4, e5) (e1, e2, e3, e4, e5)
|
||||
#endif
|
||||
|
||||
#endif /* TRC_UTILITY_H */
|
||||
201
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/LICENSE.md
Normal file
201
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/LICENSE.md
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
10
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/LICENSE.spdx
Normal file
10
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/LICENSE.spdx
Normal file
@@ -0,0 +1,10 @@
|
||||
SPDXVersion: SPDX-2.2
|
||||
DataLicense: CC0-1.0
|
||||
Creator: Organization: Percepio AB ()
|
||||
PackageName: TraceRecorderSource
|
||||
PackageOriginator: Percepio AB
|
||||
PackageDownloadLocation: git+https://github.com/percepio/TraceRecorderSource.git
|
||||
PackageLicenseDeclared: Apache-2.0
|
||||
PackageCopyrightText: <text>Copyright 2021 Percepio AB</text>
|
||||
PackageSummary: <text>Trace Recorder</text>
|
||||
PackageDescription: <text>A generic software Trace Recorder that can generate trace events and transmit or store them.</text>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user