mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-12-13 15:46:26 +08:00
Updates FreeRTOS-Plus-Trace to a submodule pointer (#1082)
This PR updates FreeRTOS-Plus-Trace to a submodule pointer and updates the relevant project files. Percepio recommends to use streaming to ring buffer on a 64-bit system instead of snapshot and therefore, POSIX demo is updated to use streaming to ring buffer.
This commit is contained in:
1
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace
Submodule
1
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace
Submodule
Submodule FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace added at 3aa03556bd
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* 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.
|
||||
* See trcExtensions.h for information on how to use this.
|
||||
*
|
||||
* To create your own extension, first make sure to read the documentation
|
||||
* in trcExtensions.h. Then, to create an extension header file like this
|
||||
* one, you need to provide:
|
||||
*
|
||||
* - Extension Definitions - name and event codes of the extensions.
|
||||
*
|
||||
* - Trace Wrappers - calls the original function and traces the event.
|
||||
*
|
||||
* - Function Redefinitions - changes the function calls to the trace wrappers.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _AWS_SECURE_SOCKETS_TZEXT_H
|
||||
#define _AWS_SECURE_SOCKETS_TZEXT_H
|
||||
|
||||
/***** Extension Definitions *****/
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_NAME
|
||||
* The name of the extension as a string constant. This name is used by the
|
||||
* Tracealyzer host application to find the right XML file for interpreting
|
||||
* the events. Assuming the extension name is "aws_secure_sockets", Tracealyzer
|
||||
* will look for an XML file named "aws_secure_sockets-<VERSION>.xml", first in
|
||||
* the folder of the current trace file, next in the Tracealyzer 4/cfg folder.
|
||||
* For the VERSION part, see the TRC_EXT_<ExtName>_VERSION macros below.
|
||||
*
|
||||
* Note: The extension name displayed in Tracealyzer is defined in the XML file
|
||||
* in the EventGroup element (e.g. <EventGroup name="SOCKETS">)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT_SOCKETS_NAME "aws_secure_sockets"
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_VERSION_MAJOR
|
||||
* <EXTENSIONPREFIX>_VERSION_MINOR
|
||||
* <EXTENSIONPREFIX>_VERSION_PATCH
|
||||
*
|
||||
* The version code of the extension (MAJOR.MINOR.PATCH)
|
||||
*
|
||||
* If you increment the version code when modifying an extension, you can still
|
||||
* show old traces recorded using an earlier version of the extension.
|
||||
*
|
||||
* Assuming the extension name is "aws_secure_sockets", and the below version
|
||||
* codes are 1 (MAJOR), 2 (MINOR), 3 (PATCH), Tracealyzer will assume the
|
||||
* corresponding XML file is named "aws_secure_sockets-v1.2.3.xml". So if then
|
||||
* view a trace recorded with extension version 1.2.2, those traces will look
|
||||
* for "aws_secure_sockets-v1.2.2.xml" instead.
|
||||
*
|
||||
* Note that major and minor are stored as 8 bit values, while patch is stored
|
||||
* using 16 bits. They are treated as unsigned integers, so the maximum values
|
||||
* are 256, 256 and 65535.
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT_SOCKETS_VERSION_MAJOR 1
|
||||
|
||||
#define TRC_EXT_SOCKETS_VERSION_MINOR 0
|
||||
|
||||
#define TRC_EXT_SOCKETS_VERSION_PATCH 0
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_<EVENTCODE>
|
||||
* The event codes used in the trace wrapper functions. Important that these
|
||||
* are relative to <PREFIX>_FIRST.
|
||||
*****************************************************************************/
|
||||
#define EVENTCODE_SOCKETS_Connect ( TRC_EXT_BASECODE + 0 )
|
||||
|
||||
#define EVENTCODE_SOCKETS_Send ( TRC_EXT_BASECODE + 1 )
|
||||
|
||||
#define EVENTCODE_SOCKETS_Recv ( TRC_EXT_BASECODE + 2 )
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_COUNT
|
||||
* The number of event codes used by this extension. Should be at least 1.
|
||||
* Tracealyzer allows for events codes up to 4095.
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT_SOCKETS_COUNT 2
|
||||
|
||||
|
||||
/***** Trace Wrappers *****/
|
||||
|
||||
#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 )
|
||||
{
|
||||
int32_t ret = SOCKETS_Connect( xSocket, pxAddress, xAddressLength );
|
||||
|
||||
/* Note: The host-side xml file assumes that ret == 0 means OK, otherwise timeout/error. */
|
||||
prvTraceStoreEvent3( EVENTCODE_SOCKETS_Connect, ( uint32_t ) xSocket, ( uint32_t ) pxAddress->ulAddress, ( uint32_t ) ret );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int32_t SOCKETS_Send__trace( Socket_t xSocket,
|
||||
const void * pvBuffer,
|
||||
size_t xDataLength,
|
||||
uint32_t ulFlags )
|
||||
{
|
||||
int32_t ret = SOCKETS_Send( xSocket, pvBuffer, xDataLength, ulFlags );
|
||||
|
||||
/* Note: The host-side xml file assumes that ret == 0 means OK, otherwise timeout/error. */
|
||||
prvTraceStoreEvent2( EVENTCODE_SOCKETS_Send, ( uint32_t ) xSocket, ( uint32_t ) ret );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static inline int32_t SOCKETS_Recv__trace( Socket_t xSocket,
|
||||
void * pvBuffer,
|
||||
size_t xBufferLength,
|
||||
uint32_t ulFlags )
|
||||
{
|
||||
int32_t ret = SOCKETS_Recv( xSocket, pvBuffer, xBufferLength, ulFlags );
|
||||
|
||||
/* Note: The host-side xml file assumes that ret == 0 means OK, otherwise timeout/error. */
|
||||
prvTraceStoreEvent2( EVENTCODE_SOCKETS_Recv, ( uint32_t ) xSocket, ( uint32_t ) ret );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***** Function Redefinitions *****/
|
||||
|
||||
#define SOCKETS_Connect SOCKETS_Connect__trace
|
||||
|
||||
#define SOCKETS_Send SOCKETS_Send__trace
|
||||
|
||||
#define SOCKETS_Recv SOCKETS_Recv__trace
|
||||
|
||||
#endif /* _AWS_SECURE_SOCKETS_TZEXT_H */
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* 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.
|
||||
* See trcExtensions.h for information on how to use this.
|
||||
*
|
||||
* To create your own extension, first make sure to read the documentation
|
||||
* in trcExtensions.h. Then, to create an extension header file like this
|
||||
* one, you need to provide:
|
||||
*
|
||||
* - Extension Definitions - name and event codes of the extensions.
|
||||
*
|
||||
* - Trace Wrappers - calls the original function and traces the event.
|
||||
*
|
||||
* - Function Redefinitions - changes the function calls to the trace wrappers.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _AWS_WIFI_TZEXT_H
|
||||
#define _AWS_WIFI_TZEXT_H
|
||||
|
||||
/***** Extension Definitions (must use the same prefix!) *****/
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_NAME
|
||||
* The name of the extension as a string constant. This name is used by the
|
||||
* Tracealyzer host application to find the right XML file for interpreting
|
||||
* the events. Assuming the extension name is "aws_secure_sockets", Tracealyzer
|
||||
* will look for an XML file named "aws_secure_sockets-<VERSION>.xml", first in
|
||||
* the folder of the current trace file, next in the Tracealyzer 4/cfg folder.
|
||||
* For the VERSION part, see the TRC_EXT_<ExtName>_VERSION macros below.
|
||||
*
|
||||
* Note: The extension name displayed in Tracealyzer is defined in the XML file
|
||||
* in the EventGroup element (e.g. <EventGroup name="SOCKETS">)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT_WIFI_NAME "aws_wifi"
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_VERSION_MAJOR
|
||||
* <EXTENSIONPREFIX>_VERSION_MINOR
|
||||
* <EXTENSIONPREFIX>_VERSION_PATCH
|
||||
*
|
||||
* The version code of the extension (MAJOR.MINOR.PATCH)
|
||||
*
|
||||
* If you increment the version code when modifying an extension, you can still
|
||||
* show old traces recorded using an earlier version of the extension.
|
||||
*
|
||||
* Assuming the extension name is "aws_secure_sockets", and the below version
|
||||
* codes are 1 (MAJOR), 2 (MINOR), 3 (PATCH), Tracealyzer will assume the
|
||||
* corresponding XML file is named "aws_secure_sockets-v1.2.3.xml". So if then
|
||||
* view a trace recorded with extension version 1.2.2, those traces will look
|
||||
* for "aws_secure_sockets-v1.2.2.xml" instead.
|
||||
*
|
||||
* Note that major and minor are stored as 8 bit values, while patch is stored
|
||||
* using 16 bits. They are treated as unsigned integers, so the maximum values
|
||||
* are 256, 256 and 65535.
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT_WIFI_VERSION_MAJOR 1
|
||||
|
||||
#define TRC_EXT_WIFI_VERSION_MINOR 0
|
||||
|
||||
#define TRC_EXT_WIFI_VERSION_PATCH 0
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_<EVENTCODE>
|
||||
* The event codes used in the trace wrapper functions. Important that these
|
||||
* are relative to <PREFIX>_FIRST.
|
||||
*****************************************************************************/
|
||||
#define EVENTCODE_WIFI_On ( TRC_EXT_BASECODE + 0 )
|
||||
|
||||
#define EVENTCODE_WIFI_Off ( TRC_EXT_BASECODE + 1 )
|
||||
|
||||
#define EVENTCODE_WIFI_ConnectAP ( TRC_EXT_BASECODE + 2 )
|
||||
|
||||
/******************************************************************************
|
||||
* <EXTENSIONPREFIX>_COUNT
|
||||
* The number of event codes used by this extension. Should be at least 1.
|
||||
* Tracealyzer allows for events codes up to 4095.
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT_WIFI_COUNT 3
|
||||
|
||||
|
||||
/***** Trace Wrappers *****/
|
||||
|
||||
#include <aws_wifi.h> /* Including the original header file, so that custom data types are understood. */
|
||||
|
||||
static inline WIFIReturnCode_t WIFI_On__trace( void )
|
||||
{
|
||||
WIFIReturnCode_t ret = WIFI_On();
|
||||
|
||||
/* Note: The host-side xml file assumes that ret == 0 means OK, otherwise timeout/error. */
|
||||
prvTraceStoreEvent1( EVENTCODE_WIFI_On, ( uint32_t ) ret );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline WIFIReturnCode_t WIFI_Off__trace( void )
|
||||
{
|
||||
WIFIReturnCode_t ret = WIFI_Off();
|
||||
|
||||
/* Note: The host-side xml file assumes that ret == 0 means OK, otherwise timeout/error. */
|
||||
prvTraceStoreEvent1( EVENTCODE_WIFI_Off, ( uint32_t ) ret );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline WIFIReturnCode_t WIFI_ConnectAP__trace( const WIFINetworkParams_t * const pxNetworkParams )
|
||||
{
|
||||
WIFIReturnCode_t ret = WIFI_ConnectAP( pxNetworkParams );
|
||||
|
||||
/* Note: The host-side xml file assumes that ret == 0 means OK, otherwise timeout/error. */
|
||||
|
||||
prvTraceStoreStringEvent( 2, EVENTCODE_WIFI_ConnectAP, pxNetworkParams->pcSSID, pxNetworkParams->xSecurity, ret );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***** Function Redefinitions *****/
|
||||
|
||||
#define WIFI_On WIFI_On__trace
|
||||
|
||||
#define WIFI_Off WIFI_Off__trace
|
||||
|
||||
#define WIFI_ConnectAP WIFI_ConnectAP__trace
|
||||
|
||||
#endif /* _AWS_SECURE_SOCKETS2_TZEXT_H */
|
||||
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
* 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 /* if ( defined( TRC_CFG_TEST_MODE ) && ( TRC_CFG_TEST_MODE ) == 1 ) */
|
||||
|
||||
#define TRC_ASSERT_EQUAL_SIZE( x, y )
|
||||
|
||||
#endif /* if ( defined( TRC_CFG_TEST_MODE ) && ( TRC_CFG_TEST_MODE ) == 1 ) */
|
||||
|
||||
#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 */
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* 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,182 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Some common defines for the trace recorder.
|
||||
*/
|
||||
|
||||
#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
|
||||
#define TRC_OS_TIMER_INCR 3
|
||||
#define TRC_OS_TIMER_DECR 4
|
||||
#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_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) */
|
||||
|
||||
/* The final command code, used to validate commands. */
|
||||
#define CMD_LAST_COMMAND 1
|
||||
|
||||
#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
|
||||
#define FilterGroup2 ( uint16_t ) 0x0004
|
||||
#define FilterGroup3 ( uint16_t ) 0x0008
|
||||
#define FilterGroup4 ( uint16_t ) 0x0010
|
||||
#define FilterGroup5 ( uint16_t ) 0x0020
|
||||
#define FilterGroup6 ( uint16_t ) 0x0040
|
||||
#define FilterGroup7 ( uint16_t ) 0x0080
|
||||
#define FilterGroup8 ( uint16_t ) 0x0100
|
||||
#define FilterGroup9 ( uint16_t ) 0x0200
|
||||
#define FilterGroup10 ( uint16_t ) 0x0400
|
||||
#define FilterGroup11 ( uint16_t ) 0x0800
|
||||
#define FilterGroup12 ( uint16_t ) 0x1000
|
||||
#define FilterGroup13 ( uint16_t ) 0x2000
|
||||
#define FilterGroup14 ( uint16_t ) 0x4000
|
||||
#define FilterGroup15 ( uint16_t ) 0x8000
|
||||
|
||||
/******************************************************************************
|
||||
* Supported ports
|
||||
*
|
||||
* TRC_HARDWARE_PORT_HWIndependent
|
||||
* A hardware independent fallback option for event timestamping. Provides low
|
||||
* resolution timestamps based on the OS tick.
|
||||
* This may be used on the Win32 port, but may also be used on embedded hardware
|
||||
* platforms. All time durations will be truncated to the OS tick frequency,
|
||||
* typically 1 KHz. This means that a task or ISR that executes in less than
|
||||
* 1 ms get an execution time of zero.
|
||||
*
|
||||
* TRC_HARDWARE_PORT_APPLICATION_DEFINED
|
||||
* Allows for defining the port macros in other source code files.
|
||||
*
|
||||
* TRC_HARDWARE_PORT_Win32
|
||||
* "Accurate" timestamping based on the Windows performance counter for Win32
|
||||
* builds. Note that this gives the host machine time, not the kernel time.
|
||||
*
|
||||
* Hardware specific ports
|
||||
* To get accurate timestamping, a hardware timer is necessary. Below are the
|
||||
* available ports. Some of these are "unofficial", meaning that
|
||||
* they have not yet been verified by Percepio but have been contributed by
|
||||
* external developers. They should work, otherwise let us know by emailing
|
||||
* support@percepio.com. Some work on any OS platform, while other are specific
|
||||
* to a certain operating system.
|
||||
*****************************************************************************/
|
||||
|
||||
/****** Port Name ************************************* Code ** Official ** OS Platform *********/
|
||||
#define TRC_HARDWARE_PORT_APPLICATION_DEFINED 98 /* - - */
|
||||
#define TRC_HARDWARE_PORT_NOT_SET 99 /* - - */
|
||||
#define TRC_HARDWARE_PORT_HWIndependent 0 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_Win32 1 /* Yes FreeRTOS on Win32 */
|
||||
#define TRC_HARDWARE_PORT_Atmel_AT91SAM7 2 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_Atmel_UC3A0 3 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_ARM_Cortex_M 4 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_Renesas_RX600 6 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_MICROCHIP_PIC24_PIC32 7 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48 8 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_MSP430 9 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_XILINX_PPC405 11 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_XILINX_PPC440 12 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_XILINX_MICROBLAZE 13 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_XILINX_ZyncUltraScaleR5 14 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_NXP_LPC210X 15 /* No Any */
|
||||
#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) */
|
||||
#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 */
|
||||
@@ -1,150 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,271 +0,0 @@
|
||||
/*
|
||||
* 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 /* if ( ( TRC_CFG_USE_TRACE_ASSERT ) == 1 ) */
|
||||
|
||||
#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 */
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* 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*/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* 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 (mutual 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 transferred 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 */
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* 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 /* if ( TRC_USE_HEAPS == 1 ) */
|
||||
|
||||
#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 */
|
||||
@@ -1,229 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* 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
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* 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 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 (mutual exclusive).
|
||||
*
|
||||
* @param[out] pxTraceMultiCoreEventBuffer Pointer to uninitialized 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 /* if ( ( TRC_CFG_USE_TRACE_ASSERT ) == 1 ) */
|
||||
|
||||
/**
|
||||
* @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 transferred 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 */
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,213 +0,0 @@
|
||||
/*
|
||||
* 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
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,248 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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 /* if ( defined( TRC_CFG_USE_GCC_STATEMENT_EXPR ) && TRC_CFG_USE_GCC_STATEMENT_EXPR == 1 ) || __GNUC__ */
|
||||
|
||||
#endif /* TRC_UTILITY_H */
|
||||
@@ -1,201 +0,0 @@
|
||||
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.
|
||||
@@ -1,10 +0,0 @@
|
||||
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>
|
||||
@@ -1,5 +0,0 @@
|
||||
Trace Recorder source code for use with Percepio's Tracealyzer.
|
||||
|
||||
Read more at https://percepio.com/tracealyzer/ and https://percepio.com/gettingstarted.
|
||||
|
||||
Repository at https://github.com/percepio/TraceRecorderSource
|
||||
@@ -1,5 +0,0 @@
|
||||
[InternetShortcut]
|
||||
URL=http://www.freertos.org/trace
|
||||
IDList=
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
@@ -1,320 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Main configuration parameters for the trace recorder library.
|
||||
* More settings can be found in trcStreamingConfig.h and trcSnapshotConfig.h.
|
||||
*/
|
||||
|
||||
#ifndef TRC_CONFIG_H
|
||||
#define TRC_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* Include of processor header file
|
||||
*
|
||||
* Here you may need to include the header file for your processor. This is
|
||||
* required at least for the ARM Cortex-M port, that uses the ARM CMSIS API.
|
||||
* Try that in case of build problems. Otherwise, remove the #error line below.
|
||||
*****************************************************************************/
|
||||
#error "Trace Recorder: Please include your processor's header file here and remove this line."
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_HARDWARE_PORT
|
||||
* @brief Specify what hardware port to use (i.e., the "timestamping driver").
|
||||
*
|
||||
* All ARM Cortex-M MCUs are supported by "TRC_HARDWARE_PORT_ARM_Cortex_M".
|
||||
* This port uses the DWT cycle counter for Cortex-M3/M4/M7 devices, which is
|
||||
* available on most such devices. In case your device don't have DWT support,
|
||||
* you will get an error message opening the trace. In that case, you may
|
||||
* force the recorder to use SysTick timestamping instead, using this define:
|
||||
*
|
||||
* #define TRC_CFG_ARM_CM_USE_SYSTICK
|
||||
*
|
||||
* For ARM Cortex-M0/M0+ devices, SysTick mode is used automatically.
|
||||
*
|
||||
* See trcHardwarePort.h for available ports and information on how to
|
||||
* define your own port, if not already present.
|
||||
*/
|
||||
#define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_NOT_SET
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_SCHEDULING_ONLY
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* If this setting is enabled (= 1), only scheduling events are recorded.
|
||||
* If disabled (= 0), all events are recorded (unless filtered in other ways).
|
||||
*
|
||||
* Default value is 0 (= include additional events).
|
||||
*/
|
||||
#define TRC_CFG_SCHEDULING_ONLY 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_MEMMANG_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* This controls if malloc and free calls should be traced. Set this to zero (0)
|
||||
* to exclude malloc/free calls, or one (1) to include such events in the trace.
|
||||
*
|
||||
* Default value is 1.
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_MEMMANG_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_USER_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), all code related to User Events is excluded in order
|
||||
* to reduce code size. Any attempts of storing User Events are then silently
|
||||
* ignored.
|
||||
*
|
||||
* User Events are application-generated events, like "printf" but for the
|
||||
* trace log, generated using vTracePrint and vTracePrintF.
|
||||
* The formatting is done on host-side, by Tracealyzer. User Events are
|
||||
* therefore much faster than a console printf and can often be used
|
||||
* in timing critical code without problems.
|
||||
*
|
||||
* Note: In streaming mode, User Events are used to provide error messages
|
||||
* and warnings from the recorder (in case of incorrect configuration) for
|
||||
* display in Tracealyzer. Disabling user events will also disable these
|
||||
* warnings. You can however still catch them by calling xTraceErrorGetLast
|
||||
* or by putting breakpoints in xTraceError and xTraceWarning.
|
||||
*
|
||||
* Default value is 1.
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_USER_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_ISR_TRACING
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the code for recording Interrupt Service Routines is
|
||||
* excluded, in order to reduce code size. This means that any calls to
|
||||
* vTraceStoreISRBegin/vTraceStoreISREnd will be ignored.
|
||||
* This does not completely disable ISR tracing, in cases where an ISR is
|
||||
* calling a traced kernel service. These events will still be recorded and
|
||||
* show up in anonymous ISR instances in Tracealyzer, with names such as
|
||||
* "ISR sending to <queue name>".
|
||||
* To disable such tracing, please refer to vTraceSetFilterGroup and
|
||||
* vTraceSetFilterMask.
|
||||
*
|
||||
* Default value is 1.
|
||||
*
|
||||
* Note: tracing ISRs requires that you insert calls to vTraceStoreISRBegin
|
||||
* and vTraceStoreISREnd in your interrupt handlers.
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_ISR_TRACING 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_READY_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If one (1), events are recorded when tasks enter scheduling state "ready".
|
||||
* This allows Tracealyzer to show the initial pending time before tasks enter
|
||||
* the execution state, and present accurate response times.
|
||||
* If zero (0), "ready events" are not created, which allows for recording
|
||||
* longer traces in the same amount of RAM.
|
||||
*
|
||||
* Default value is 1.
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_READY_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_OSTICK_EVENTS
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is one (1), events will be generated whenever the OS clock is
|
||||
* increased. If zero (0), OS tick events are not generated, which allows for
|
||||
* recording longer traces in the same amount of RAM.
|
||||
*
|
||||
* Default value is 1.
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_OSTICK_EVENTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_ENABLE_STACK_MONITOR
|
||||
* @brief If enabled (1), the recorder periodically reports the unused stack space of
|
||||
* all active tasks.
|
||||
* The stack monitoring runs in the Tracealyzer Control task, TzCtrl. This task
|
||||
* is always created by the recorder when in streaming mode.
|
||||
* In snapshot mode, the TzCtrl task is only used for stack monitoring and is
|
||||
* not created unless this is enabled.
|
||||
*/
|
||||
#define TRC_CFG_ENABLE_STACK_MONITOR 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_STACK_MONITOR_MAX_TASKS
|
||||
* @brief Macro which should be defined as a non-zero integer value.
|
||||
*
|
||||
* This controls how many tasks that can be monitored by the stack monitor.
|
||||
* If this is too small, some tasks will be excluded and a warning is shown.
|
||||
*
|
||||
* Default value is 10.
|
||||
*/
|
||||
#define TRC_CFG_STACK_MONITOR_MAX_TASKS 10
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_STACK_MONITOR_MAX_REPORTS
|
||||
* @brief Macro which should be defined as a non-zero integer value.
|
||||
*
|
||||
* This defines how many tasks that will be subject to stack usage analysis for
|
||||
* each execution of the Tracealyzer Control task (TzCtrl). Note that the stack
|
||||
* monitoring cycles between the tasks, so this does not affect WHICH tasks that
|
||||
* are monitored, but HOW OFTEN each task stack is analyzed.
|
||||
*
|
||||
* This setting can be combined with TRC_CFG_CTRL_TASK_DELAY to tune the
|
||||
* frequency of the stack monitoring. This is motivated since the stack analysis
|
||||
* can take some time to execute.
|
||||
* However, note that the stack analysis runs in a separate task (TzCtrl) that
|
||||
* can be executed on low priority. This way, you can avoid that the stack
|
||||
* analysis disturbs any time-sensitive tasks.
|
||||
*
|
||||
* Default value is 1.
|
||||
*/
|
||||
#define TRC_CFG_STACK_MONITOR_MAX_REPORTS 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_CTRL_TASK_PRIORITY
|
||||
* @brief The scheduling priority of the Tracealyzer Control (TzCtrl) task.
|
||||
*
|
||||
* In streaming mode, TzCtrl is used to receive start/stop commands from
|
||||
* Tracealyzer and in some cases also to transmit the trace data (for stream
|
||||
* ports that uses the internal buffer, like TCP/IP). For such stream ports,
|
||||
* make sure the TzCtrl priority is high enough to ensure reliable periodic
|
||||
* execution and transfer of the data, but low enough to avoid disturbing any
|
||||
* time-sensitive functions.
|
||||
*
|
||||
* In Snapshot mode, TzCtrl is only used for the stack usage monitoring and is
|
||||
* not created if stack monitoring is disabled. TRC_CFG_CTRL_TASK_PRIORITY should
|
||||
* be low, to avoid disturbing any time-sensitive tasks.
|
||||
*/
|
||||
#define TRC_CFG_CTRL_TASK_PRIORITY 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_CTRL_TASK_DELAY
|
||||
* @brief The delay between loops of the TzCtrl task (see TRC_CFG_CTRL_TASK_PRIORITY),
|
||||
* which affects the frequency of the stack monitoring.
|
||||
*
|
||||
* In streaming mode, this also affects the trace data transfer if you are using
|
||||
* a stream port leveraging the internal buffer (like TCP/IP). A shorter delay
|
||||
* increases the CPU load of TzCtrl somewhat, but may improve the performance of
|
||||
* of the trace streaming, especially if the trace buffer is small.
|
||||
*/
|
||||
#define TRC_CFG_CTRL_TASK_DELAY 2
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_CTRL_TASK_STACK_SIZE
|
||||
* @brief The stack size of the Tracealyzer Control (TzCtrl) task.
|
||||
* See TRC_CFG_CTRL_TASK_PRIORITY for further information about TzCtrl.
|
||||
*/
|
||||
#define TRC_CFG_CTRL_TASK_STACK_SIZE 1024
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_RECORDER_BUFFER_ALLOCATION
|
||||
* @brief Specifies how the recorder buffer is allocated (also in case of streaming, in
|
||||
* port using the recorder's internal temporary buffer)
|
||||
*
|
||||
* Values:
|
||||
* TRC_RECORDER_BUFFER_ALLOCATION_STATIC - Static allocation (internal)
|
||||
* TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC - Malloc in vTraceEnable
|
||||
* TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM - Use vTraceSetRecorderDataBuffer
|
||||
*
|
||||
* Static and dynamic mode does the allocation for you, either in compile time
|
||||
* (static) or in runtime (malloc).
|
||||
* The custom mode allows you to control how and where the allocation is made,
|
||||
* for details see TRC_ALLOC_CUSTOM_BUFFER and vTraceSetRecorderDataBuffer().
|
||||
*/
|
||||
#define TRC_CFG_RECORDER_BUFFER_ALLOCATION TRC_RECORDER_BUFFER_ALLOCATION_STATIC
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_MAX_ISR_NESTING
|
||||
* @brief Defines how many levels of interrupt nesting the recorder can handle, in
|
||||
* case multiple ISRs are traced and ISR nesting is possible. If this
|
||||
* is exceeded, the particular ISR will not be traced and the recorder then
|
||||
* logs an error message. This setting is used to allocate an internal stack
|
||||
* for keeping track of the previous execution context (4 byte per entry).
|
||||
*
|
||||
* This value must be a non-zero positive constant, at least 1.
|
||||
*
|
||||
* Default value: 8
|
||||
*/
|
||||
#define TRC_CFG_MAX_ISR_NESTING 8
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_ISR_TAILCHAINING_THRESHOLD
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* If tracing multiple ISRs, this setting allows for accurate display of the
|
||||
* context-switching also in cases when the ISRs execute in direct sequence.
|
||||
*
|
||||
* vTraceStoreISREnd normally assumes that the ISR returns to the previous
|
||||
* context, i.e., a task or a preempted ISR. But if another traced ISR
|
||||
* executes in direct sequence, Tracealyzer may incorrectly display a minimal
|
||||
* fragment of the previous context in between the ISRs.
|
||||
*
|
||||
* By using TRC_CFG_ISR_TAILCHAINING_THRESHOLD you can avoid this. This is
|
||||
* however a threshold value that must be measured for your specific setup.
|
||||
* See http://percepio.com/2014/03/21/isr_tailchaining_threshold/
|
||||
*
|
||||
* The default setting is 0, meaning "disabled" and that you may get an
|
||||
* extra fragments of the previous context in between tail-chained ISRs.
|
||||
*
|
||||
* Note: This setting has separate definitions in trcSnapshotConfig.h and
|
||||
* trcStreamingConfig.h, since it is affected by the recorder mode.
|
||||
*/
|
||||
#define TRC_CFG_ISR_TAILCHAINING_THRESHOLD 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_RECORDER_DATA_INIT
|
||||
* @brief Macro which states wether the recorder data should have an initial value.
|
||||
*
|
||||
* In very specific cases where traced objects are created before main(),
|
||||
* the recorder will need to be started even before that. In these cases,
|
||||
* the recorder data would be initialized by vTraceEnable(TRC_INIT) but could
|
||||
* then later be overwritten by the initialization value.
|
||||
* If this is an issue for you, set TRC_CFG_RECORDER_DATA_INIT to 0.
|
||||
* The following code can then be used before any traced objects are created:
|
||||
*
|
||||
* extern uint32_t RecorderEnabled;
|
||||
* RecorderEnabled = 0;
|
||||
* xTraceInitialize();
|
||||
*
|
||||
* After the clocks are properly initialized, use vTraceEnable(...) to start
|
||||
* the tracing.
|
||||
*
|
||||
* Default value is 1.
|
||||
*/
|
||||
#define TRC_CFG_RECORDER_DATA_INIT 1
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*
|
||||
* Example:
|
||||
* #define TRC_CFG_RECORDER_DATA_ATTRIBUTE __attribute__((section(".bss.trace_recorder_data")))
|
||||
*
|
||||
* Default value is empty.
|
||||
*/
|
||||
#define TRC_CFG_RECORDER_DATA_ATTRIBUTE
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_USE_TRACE_ASSERT
|
||||
* @brief Enable or disable debug asserts. Information regarding any assert that is
|
||||
* triggered will be in trcAssert.c.
|
||||
*/
|
||||
#define TRC_CFG_USE_TRACE_ASSERT 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TRC_CONFIG_H */
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* 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_STREAMING
|
||||
|
||||
/**
|
||||
* @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 */
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* 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 15
|
||||
#define TRC_CFG_NISR 5
|
||||
#define TRC_CFG_NQUEUE 10
|
||||
#define TRC_CFG_NSEMAPHORE 10
|
||||
#define TRC_CFG_NMUTEX 10
|
||||
#define TRC_CFG_NTIMER 5
|
||||
#define TRC_CFG_NEVENTGROUP 5
|
||||
#define TRC_CFG_NSTREAMBUFFER 5
|
||||
#define TRC_CFG_NMESSAGEBUFFER 5
|
||||
|
||||
/**
|
||||
* @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 */
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* 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 streaming mode.
|
||||
*/
|
||||
|
||||
#ifndef TRC_KERNEL_PORT_STREAMING_CONFIG_H
|
||||
#define TRC_KERNEL_PORT_STREAMING_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Nothing yet */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_KERNEL_PORT_STREAMING_CONFIG_H */
|
||||
@@ -1,245 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Configuration parameters for trace recorder library in snapshot mode.
|
||||
* Read more at http://percepio.com/2016/10/05/rtos-tracing/
|
||||
*/
|
||||
|
||||
#ifndef TRC_SNAPSHOT_CONFIG_H
|
||||
#define TRC_SNAPSHOT_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_SNAPSHOT_MODE
|
||||
* @brief Macro which should be defined as one of:
|
||||
* - TRC_SNAPSHOT_MODE_RING_BUFFER
|
||||
* - TRC_SNAPSHOT_MODE_STOP_WHEN_FULL
|
||||
* Default is TRC_SNAPSHOT_MODE_RING_BUFFER.
|
||||
*
|
||||
* With TRC_CFG_SNAPSHOT_MODE set to TRC_SNAPSHOT_MODE_RING_BUFFER, the
|
||||
* events are stored in a ring buffer, i.e., where the oldest events are
|
||||
* overwritten when the buffer becomes full. This allows you to get the last
|
||||
* events leading up to an interesting state, e.g., an error, without having
|
||||
* to store the whole run since startup.
|
||||
*
|
||||
* When TRC_CFG_SNAPSHOT_MODE is TRC_SNAPSHOT_MODE_STOP_WHEN_FULL, the
|
||||
* recording is stopped when the buffer becomes full. This is useful for
|
||||
* recording events following a specific state, e.g., the startup sequence.
|
||||
*/
|
||||
#define TRC_CFG_SNAPSHOT_MODE TRC_SNAPSHOT_MODE_RING_BUFFER
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_EVENT_BUFFER_SIZE
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the capacity of the event buffer, i.e., the number of records
|
||||
* it may store. Most events use one record (4 byte), although some events
|
||||
* require multiple 4-byte records. You should adjust this to the amount of RAM
|
||||
* available in the target system.
|
||||
*
|
||||
* Default value is 1000, which means that 4000 bytes is allocated for the
|
||||
* event buffer.
|
||||
*/
|
||||
#define TRC_CFG_EVENT_BUFFER_SIZE 1000
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_INCLUDE_FLOAT_SUPPORT
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the support for logging floating point values in
|
||||
* vTracePrintF is stripped out, in case floating point values are not used or
|
||||
* supported by the platform used.
|
||||
*
|
||||
* Floating point values are only used in vTracePrintF and its subroutines, to
|
||||
* allow for storing float (%f) or double (%lf) arguments.
|
||||
*
|
||||
* vTracePrintF can be used with integer and string arguments in either case.
|
||||
*
|
||||
* Default value is 0.
|
||||
*/
|
||||
#define TRC_CFG_INCLUDE_FLOAT_SUPPORT 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_SYMBOL_TABLE_SIZE
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the capacity of the symbol table, in bytes. This symbol table
|
||||
* stores User Events labels and names of deleted tasks, queues, or other kernel
|
||||
* objects. If you don't use User Events or delete any kernel
|
||||
* objects you set this to a very low value. The minimum recommended value is 4.
|
||||
* A size of zero (0) is not allowed since a zero-sized array may result in a
|
||||
* 32-bit pointer, i.e., using 4 bytes rather than 0.
|
||||
*
|
||||
* Default value is 800.
|
||||
*/
|
||||
#define TRC_CFG_SYMBOL_TABLE_SIZE 800
|
||||
|
||||
#if ( TRC_CFG_SYMBOL_TABLE_SIZE == 0 )
|
||||
#error "TRC_CFG_SYMBOL_TABLE_SIZE may not be zero!"
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*** ADVANCED SETTINGS ********************************************************
|
||||
******************************************************************************
|
||||
* The remaining settings are not necessary to modify but allows for optimizing
|
||||
* the recorder setup for your specific needs, e.g., to exclude events that you
|
||||
* are not interested in, in order to get longer traces.
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_HEAP_SIZE_BELOW_16M
|
||||
* @brief An integer constant that can be used to reduce the buffer usage of memory
|
||||
* allocation events (malloc/free). This value should be 1 if the heap size is
|
||||
* below 16 MB (2^24 byte), and you can live with reported addresses showing the
|
||||
* lower 24 bits only. If 0, you get the full 32-bit addresses.
|
||||
*
|
||||
* Default value is 0.
|
||||
*/
|
||||
#define TRC_CFG_HEAP_SIZE_BELOW_16M 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_USE_IMPLICIT_IFE_RULES
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
* Default is 1.
|
||||
*
|
||||
* Tracealyzer groups the events into "instances" based on Instance Finish
|
||||
* Events (IFEs), produced either by default rules or calls to the recorder
|
||||
* functions xTraceTaskInstanceFinishedNow and xTraceTaskInstanceFinishedNext.
|
||||
*
|
||||
* If TRC_CFG_USE_IMPLICIT_IFE_RULES is one (1), the default IFE rules is
|
||||
* used, resulting in a "typical" grouping of events into instances.
|
||||
* If these rules don't give appropriate instances in your case, you can
|
||||
* override the default rules using xTraceTaskInstanceFinishedNow/Next for one
|
||||
* or several tasks. The default IFE rules are then disabled for those tasks.
|
||||
*
|
||||
* If TRC_CFG_USE_IMPLICIT_IFE_RULES is zero (0), the implicit IFE rules are
|
||||
* disabled globally. You must then call xTraceTaskInstanceFinishedNow or
|
||||
* xTraceTaskInstanceFinishedNext to manually group the events into instances,
|
||||
* otherwise the tasks will appear a single long instance.
|
||||
*
|
||||
* The default IFE rules count the following events as "instance finished":
|
||||
* - Task delay, delay until
|
||||
* - Task suspend
|
||||
* - Blocking on "input" operations, i.e., when the task is waiting for the
|
||||
* next a message/signal/event. But only if this event is blocking.
|
||||
*/
|
||||
#define TRC_CFG_USE_IMPLICIT_IFE_RULES 1
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_USE_16BIT_OBJECT_HANDLES
|
||||
* @brief Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If set to 0 (zero), the recorder uses 8-bit handles to identify kernel
|
||||
* objects such as tasks and queues. This limits the supported number of
|
||||
* concurrently active objects to 255 of each type (tasks, queues, mutexes,
|
||||
* etc.) Note: 255, not 256, since handle 0 is reserved.
|
||||
*
|
||||
* If set to 1 (one), the recorder uses 16-bit handles to identify kernel
|
||||
* objects such as tasks and queues. This limits the supported number of
|
||||
* concurrent objects to 65535 of each type (object class). However, since the
|
||||
* object property table is limited to 64 KB, the practical limit is about
|
||||
* 3000 objects in total.
|
||||
*
|
||||
* Default is 0 (8-bit handles)
|
||||
*
|
||||
* NOTE: An object with handle above 255 will use an extra 4-byte record in
|
||||
* the event buffer whenever the object is referenced. Moreover, some internal
|
||||
* tables in the recorder gets slightly larger when using 16-bit handles.
|
||||
*/
|
||||
#define TRC_CFG_USE_16BIT_OBJECT_HANDLES 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* Set TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER to 1 to enable the
|
||||
* separate user event buffer (UB).
|
||||
* In this mode, user events are stored separately from other events,
|
||||
* e.g., RTOS events. Thereby you can get a much longer history of
|
||||
* user events as they don't need to share the buffer space with more
|
||||
* frequent events.
|
||||
*
|
||||
* The UB is typically used with the snapshot ring-buffer mode, so the
|
||||
* recording can continue when the main buffer gets full. And since the
|
||||
* main buffer then overwrites the earliest events, Tracealyzer displays
|
||||
* "Unknown Actor" instead of task scheduling for periods with UB data only.
|
||||
*
|
||||
* In UB mode, user events are structured as UB channels, which contains
|
||||
* a channel name and a default format string. Register a UB channel using
|
||||
* xTraceRegisterUBChannel.
|
||||
*
|
||||
* Events and data arguments are written using vTraceUBEvent and
|
||||
* vTraceUBData. They are designed to provide efficient logging of
|
||||
* repeating events, using the same format string within each channel.
|
||||
*
|
||||
* Examples:
|
||||
* TraceStringHandle_t chn1;
|
||||
* TraceStringHandle_t fmt1;
|
||||
* xTraceStringRegister("Channel 1", &chn1);
|
||||
* xTraceStringRegister("Event!", &fmt1);
|
||||
* traceUBChannel UBCh1 = xTraceRegisterUBChannel(chn1, fmt1);
|
||||
*
|
||||
* TraceStringHandle_t chn2;
|
||||
* TraceStringHandle_t fmt2;
|
||||
* xTraceStringRegister("Channel 2", &chn2);
|
||||
* xTraceStringRegister("X: %d, Y: %d", &fmt2);
|
||||
* traceUBChannel UBCh2 = xTraceRegisterUBChannel(chn2, fmt2);
|
||||
*
|
||||
* // Result in "[Channel 1] Event!"
|
||||
* vTraceUBEvent(UBCh1);
|
||||
*
|
||||
* // Result in "[Channel 2] X: 23, Y: 19"
|
||||
* vTraceUBData(UBCh2, 23, 19);
|
||||
*
|
||||
* You can also use the other user event functions, like xTracePrintF.
|
||||
* as they are then rerouted to the UB instead of the main event buffer.
|
||||
* vTracePrintF then looks up the correct UB channel based on the
|
||||
* provided channel name and format string, or creates a new UB channel
|
||||
* if no match is found. The format string should therefore not contain
|
||||
* "random" messages but mainly format specifiers. Random strings should
|
||||
* be stored using %s and with the string as an argument.
|
||||
*
|
||||
* // Creates a new UB channel ("Channel 2", "%Z: %d")
|
||||
* xTracePrintF(chn2, "%Z: %d", value1);
|
||||
*
|
||||
* // Finds the existing UB channel
|
||||
* xTracePrintF(chn2, "%Z: %d", value2);
|
||||
*/
|
||||
#define TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER 0
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the capacity of the user event buffer (UB), in number of slots.
|
||||
* A single user event can use multiple slots, depending on the arguments.
|
||||
*
|
||||
* Only applicable if TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER is 1.
|
||||
*/
|
||||
#define TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE 200
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_UB_CHANNELS
|
||||
* @brief Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the number of User Event Buffer Channels (UB channels).
|
||||
* These are used to structure the events when using the separate user
|
||||
* event buffer, and contains both a User Event Channel (the name) and
|
||||
* a default format string for the channel.
|
||||
*
|
||||
* Only applicable if TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER is 1.
|
||||
*/
|
||||
#define TRC_CFG_UB_CHANNELS 32
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*TRC_SNAPSHOT_CONFIG_H*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Configuration parameters for the trace recorder library in streaming mode.
|
||||
* Read more at http://percepio.com/2016/10/05/rtos-tracing/
|
||||
*/
|
||||
|
||||
#ifndef TRC_STREAMING_CONFIG_H
|
||||
#define TRC_STREAMING_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_ENTRY_SLOTS
|
||||
* @brief The maximum number of objects and symbols that can be stored. This includes:
|
||||
* - Task names
|
||||
* - Named ISRs (vTraceSetISRProperties)
|
||||
* - Named kernel objects (vTraceStoreKernelObjectName)
|
||||
* - User event channels (xTraceStringRegister)
|
||||
*
|
||||
* If this value is too small, not all symbol names will be stored and the
|
||||
* trace display will be affected. In that case, there will be warnings
|
||||
* (as User Events) from TzCtrl task, that monitors this.
|
||||
*/
|
||||
#define TRC_CFG_ENTRY_SLOTS 50
|
||||
|
||||
/**
|
||||
* @def TRC_CFG_ENTRY_SYMBOL_MAX_LENGTH
|
||||
* @brief The maximum length of symbol names, including:
|
||||
* - Task names
|
||||
* - Named ISRs (vTraceSetISRProperties)
|
||||
* - Named kernel objects (vTraceStoreKernelObjectName)
|
||||
* - User event channel names (xTraceStringRegister)
|
||||
*
|
||||
* If longer symbol names are used, they will be truncated by the recorder,
|
||||
* which will affect the trace display. In that case, there will be warnings
|
||||
* (as User Events) from TzCtrl task, that monitors this.
|
||||
*/
|
||||
#define TRC_CFG_ENTRY_SYMBOL_MAX_LENGTH 32
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_STREAMING_CONFIG_H */
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Percepio Trace Recorder Initialization v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* This file should only be included in a project if there is a need to
|
||||
* initialize the Trace Recorder before main() has been called.
|
||||
* An example of this scenario is if you have a global object instance that has
|
||||
* a constructor that creates an object that should be traced.
|
||||
* This file will make it easier to initiate the recorder correctly.
|
||||
*
|
||||
* Usage:
|
||||
* Add a call to TraceRecorderInit::Initialize() wherever a traced object is
|
||||
* created before the Trace Recorder is normally initialized. This will ensure
|
||||
* the Trace Recorder is initialized only once.
|
||||
*
|
||||
* Set TRC_CFG_RECORDER_DATA_PTR_INIT to 0 in trcSnapshotConfig.h to ensure
|
||||
* RecorderInitialized isn't initialized to 0 after the recorder has been
|
||||
* already initialized.
|
||||
*
|
||||
* Finally, call vTraceEnable(TRC_START) after hardware is initialized to
|
||||
* start gathering trace events.
|
||||
*/
|
||||
|
||||
#include <TraceRecorderInit.h>
|
||||
#include <trcRecorder.h>
|
||||
|
||||
extern "C" uint32_t RecorderInitialized;
|
||||
|
||||
/* Public */
|
||||
bool TraceRecorderInit::Initialize()
|
||||
{
|
||||
/* Lazy initialization, and constructor is only run once ensuring that we only initialize the recorder once */
|
||||
static TraceRecorderInit instance;
|
||||
|
||||
return instance.IsInitialized();
|
||||
}
|
||||
|
||||
/* Private */
|
||||
TraceRecorderInit::TraceRecorderInit()
|
||||
{
|
||||
RecorderInitialized = 0;
|
||||
xTraceInitialize();
|
||||
}
|
||||
|
||||
TraceRecorderInit::~TraceRecorderInit()
|
||||
{
|
||||
}
|
||||
|
||||
bool TraceRecorderInit::IsInitialized()
|
||||
{
|
||||
return RecorderInitialized != 0;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Percepio Trace Recorder Initialization v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* This file should only be included in a project if there is a need to
|
||||
* initialize the Trace Recorder before main() has been called.
|
||||
* An example of this scenario is if you have a global object instance that has
|
||||
* a constructor that creates an object that should be traced.
|
||||
* This file will make it easier to initiate the recorder correctly.
|
||||
*
|
||||
* Usage:
|
||||
* Add a call to TraceRecorderInit::Initialize() wherever a traced object is
|
||||
* created before the Trace Recorder is normally initialized. This will ensure
|
||||
* the Trace Recorder is initialized only once.
|
||||
*
|
||||
* Set TRC_CFG_RECORDER_DATA_PTR_INIT to 0 in trcSnapshotConfig.h to ensure
|
||||
* RecorderInitialized isn't initialized to 0 after the recorder has been
|
||||
* already initialized.
|
||||
*
|
||||
* Finally, call vTraceEnable(TRC_START) after hardware is initialized to
|
||||
* start gathering trace events.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class TraceRecorderInit
|
||||
{
|
||||
public:
|
||||
static bool Initialize();
|
||||
private:
|
||||
TraceRecorderInit();
|
||||
~TraceRecorderInit();
|
||||
|
||||
bool IsInitialized();
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
Percepio Trace Recorder Initialization v4.6.0
|
||||
Copyright 2021 Percepio AB
|
||||
www.percepio.com
|
||||
|
||||
This folder contains files that should only be included in a project
|
||||
if there is a need to initialize the Trace Recorder before main()
|
||||
has been called.
|
||||
|
||||
An example of this scenario is if you have a global object instance that has
|
||||
a constructor that creates an object that should be traced.
|
||||
TraceRecorderInit will make it easier to initiate the recorder correctly.
|
||||
|
||||
Usage:
|
||||
Add a call to TraceRecorderInit::Initialize() wherever a traced object
|
||||
is created before the Trace Recorder is normally initialized, or simply
|
||||
as early as absloutely possible. This will ensure the Trace Recorder is
|
||||
initialized only once.
|
||||
|
||||
Set TRC_CFG_RECORDER_DATA_INIT to 0 in trcConfig.h to ensure
|
||||
recorder data isn't initialized cleared after the recorder has been
|
||||
already initialized.
|
||||
|
||||
It is possible that you also need to make sure certain recorder data isn't
|
||||
cleared when RAM sections are initialized. Create a RAM section that isn't
|
||||
cleared, then set the appropriate attribute in TRC_CFG_RECORDER_DATA_ATTRIBUTE.
|
||||
This attribute will then be set for all necessary recorder data that should
|
||||
not be cleared.
|
||||
|
||||
After the hardware and clocks are properly initialized, use
|
||||
vTraceEnable(TRC_START) to start the tracing.
|
||||
@@ -1,21 +0,0 @@
|
||||
Tracealyzer Stream Port for Amazon FreeRTOS TCP/WIFI
|
||||
Percepio AB
|
||||
www.percepio.com
|
||||
----------------------------------------------------
|
||||
|
||||
This directory contains a "stream port" for the Tracealyzer recorder library,
|
||||
i.e., the specific code needed to use a particular interface for streaming a
|
||||
Tracealyzer RTOS trace. The stream port is defined by a set of macros in
|
||||
trcStreamPort.h, found in the "include" directory.
|
||||
|
||||
This particular stream port is for streaming via a TCP socket in Amazon
|
||||
FreeRTOS (AFR) directly to a host computer on the local network, typically
|
||||
using Wifi. Read more in trcStreamPort.h.
|
||||
|
||||
To use this stream port, make sure that include/trcStreamPort.h is found
|
||||
by the compiler (i.e., add this folder to your project's include paths) and
|
||||
add all included source files to your build. Make sure no other versions of
|
||||
trcStreamPort.h are included by mistake!
|
||||
|
||||
See also http://percepio.com/2016/10/05/rtos-tracing
|
||||
and https://percepio.com/2018/10/11/tuning-your-custom-trace-streaming/
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* This stream port provides trace streaming using the Amazon FreeRTOS sockets
|
||||
* layer and is intended for streaming over Wifi directly to a computer on the
|
||||
* local Wifi network.
|
||||
*
|
||||
* Note that this does NOT use the TLS encryption available in Amazon
|
||||
* FreeRTOS, due to performance and memory usage concerns. However, it does not
|
||||
* use any AWS services either, and is intended for your local network only.
|
||||
*
|
||||
* This should be started using vTraceEnable(TRC_START) and this call should be
|
||||
* made AFTER the kernel has started and the Wifi interface is ready.
|
||||
*
|
||||
* In the Tracealyzer setting -> "PSF Streaming Settings" make sure that the
|
||||
* "Target Connection" setting is "TCP (Target Initiated)".
|
||||
*
|
||||
* To use this, make sure to start the trace recording in Tracealyzer before
|
||||
* you start your target system. This ensures that Tracealyzer is ready when
|
||||
* the target system connects.
|
||||
*
|
||||
* And don't forget to enter the IP address of the Tracealyzer host computer
|
||||
* in trcStreamPort.h.
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
* 1: The tracing will increase the stack usage of you application, so you
|
||||
* may want to increase configMINIMAL_STACK_SIZE in your FreeRTOSConfig.h.
|
||||
*
|
||||
* 2: To reduce the amount of trace data, we recommend disabling the tracing
|
||||
* of OS Ticks and memory allocation events.
|
||||
* See TRC_CFG_INCLUDE_OSTICK_EVENTS in trcConfig.h.
|
||||
*
|
||||
* 3: The transmission of trace data is done in the TzCtrl task. To avoid that
|
||||
* the trace streaming is blocked during the (long) MQTT connection phase,
|
||||
* make sure the scheduling priority of TzCtrl is higher than the MQTT task.
|
||||
* Otherwise, if you prefer to run the TzCtrl task at lower priority to avoid
|
||||
* interfering with your application, wait with the vTraceEnable call until
|
||||
* after the MQTT connection is established.
|
||||
* See TRC_CFG_CTRL_TASK_PRIORITY in trcStreamingConfig.h.
|
||||
*
|
||||
* 4: The Wifi transmission of trace data often uses FreeRTOS functions, that
|
||||
* are traced and thus produce additional trace data. This may cause a fast
|
||||
* increase in trace data rate, that may saturate the trace buffer and cause
|
||||
* data loss (i.e. incomplete traces).
|
||||
* To eliminate this effect and reduce the amount of trace data produced, we
|
||||
* recommend excluding all FreeRTOS objects that are used by Wifi stack.
|
||||
* This is done using vTraceSetFilterGroup and vTraceSetFilterMask:
|
||||
*
|
||||
* // Just before wifi initialization:
|
||||
*
|
||||
* // All objects created after this point are assigned to group 15.
|
||||
* vTraceSetFilterGroup(FilterGroup15);
|
||||
*
|
||||
* // Only trace objects assigned to group 0 (the default group).
|
||||
* vTraceSetFilterMask(FilterGroup0);
|
||||
*
|
||||
* // The wifi stack initialization... (creates semaphores etc.)
|
||||
* if ( eWifi_Connected == prvWifiConnect() )
|
||||
* {
|
||||
* yMainState = eMain_StartApplication;
|
||||
*
|
||||
* // When connected, restore the FilterGroup setting to Group 0, so
|
||||
* // that later created objects are included, like the TzCtrl task
|
||||
* // created in vTraceEnable. Excluding tasks is not recommended!
|
||||
* vTraceSetFilterGroup(FilterGroup0);
|
||||
*
|
||||
* // Then call vTraceEnable to start the tracing.
|
||||
* vTraceEnable(TRC_START);
|
||||
* }
|
||||
*
|
||||
* 5: If you still get "red sections" in Tracealyzer (lost data), you need
|
||||
* to adjust the other settings in trcStreamingConfig.h.
|
||||
*
|
||||
* - TRC_CFG_PAGED_EVENT_BUFFER_PAGE_COUNT
|
||||
* Increase this, as long as you have memory to spare.
|
||||
*
|
||||
* - TRC_CFG_PAGED_EVENT_BUFFER_PAGE_SIZE
|
||||
* Increase this, as long as you have memory to spare.
|
||||
* But don't exceed the maximum payload size of the Wifi chip, which
|
||||
* is often limited to 1000-1500 bytes. Some chips crash if you try to
|
||||
* send to large chunks...
|
||||
*
|
||||
* - TRC_CFG_CTRL_TASK_DELAY
|
||||
* Decrease this to flush the trace buffer more frequently.
|
||||
*
|
||||
* See also http://percepio.com/2016/10/05/rtos-tracing
|
||||
* and https://percepio.com/2018/10/11/tuning-your-custom-trace-streaming/
|
||||
*/
|
||||
|
||||
#ifndef TRC_STREAM_PORT_H
|
||||
#define TRC_STREAM_PORT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define HOST_IPADDRESS_0 192
|
||||
#define HOST_IPADDRESS_1 168
|
||||
#define HOST_IPADDRESS_2 10
|
||||
#define HOST_IPADDRESS_3 116
|
||||
#define HOST_PORT 12000
|
||||
|
||||
void prvInitSocket( void );
|
||||
int32_t prvReadFromSocket( void * ptrData,
|
||||
uint32_t size,
|
||||
int32_t * ptrBytesRead );
|
||||
int32_t prvWriteToSocket( void * ptrData,
|
||||
uint32_t size,
|
||||
int32_t * ptrBytesWritten );
|
||||
|
||||
#define TRC_STREAM_PORT_INIT() \
|
||||
TRC_STREAM_PORT_MALLOC(); \
|
||||
prvInitSocket();
|
||||
|
||||
#define TRC_STREAM_PORT_USE_INTERNAL_BUFFER 1
|
||||
|
||||
#define TRC_STREAM_PORT_WRITE_DATA( _ptrData, _size, _ptrBytesWritten ) prvWriteToSocket( _ptrData, _size, _ptrBytesWritten )
|
||||
|
||||
#define TRC_STREAM_PORT_READ_DATA( _ptrData, _size, _ptrBytesRead ) prvReadFromSocket( _ptrData, _size, _ptrBytesRead )
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_STREAM_PORT_H */
|
||||
@@ -1,163 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* This stream port provides trace streaming using the Amazon FreeRTOS sockets
|
||||
* layer and is intended for streaming over Wifi directly to a computer on the
|
||||
* local Wifi network.
|
||||
*
|
||||
* Note that this does NOT use the TLS encryption available in Amazon
|
||||
* FreeRTOS, due to performance and memory usage concerns. However, it does not
|
||||
* use any AWS services either, and is intended for your local network only.
|
||||
*
|
||||
* This should be started using vTraceEnable(TRC_START) and this call should be
|
||||
* made AFTER the kernel has started and the Wifi interface is ready.
|
||||
*
|
||||
* In the Tracealyzer setting -> "PSF Streaming Settings" make sure that the
|
||||
* "Target Connection" setting is "TCP (Target Initiated)".
|
||||
*
|
||||
* To use this, make sure to start the trace recording in Tracealyzer before
|
||||
* you start your target system. This ensures that Tracealyzer is ready when
|
||||
* the target system connects.
|
||||
*
|
||||
* And don't forget to enter the IP address of the Tracealyzer host computer
|
||||
* in trcStreamPort.h.
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
* 1: The tracing will increase the stack usage of you application, so you
|
||||
* may want to increase configMINIMAL_STACK_SIZE in your FreeRTOSConfig.h.
|
||||
*
|
||||
* 2: To reduce the amount of trace data, we recommend disabling the tracing
|
||||
* of OS Ticks and memory allocation events.
|
||||
* See TRC_CFG_INCLUDE_OSTICK_EVENTS in trcConfig.h.
|
||||
*
|
||||
* 3: The transmission of trace data is done in the TzCtrl task. To avoid that
|
||||
* the trace streaming is blocked during the (long) MQTT connection phase,
|
||||
* make sure the scheduling priority of TzCtrl is higher than the MQTT task.
|
||||
* Otherwise, if you prefer to run the TzCtrl task at lower priority to avoid
|
||||
* interfering with your application, wait with the vTraceEnable call until
|
||||
* after the MQTT connection is established.
|
||||
* See TRC_CFG_CTRL_TASK_PRIORITY in trcStreamingConfig.h.
|
||||
*
|
||||
* 4: The Wifi transmission of trace data often uses FreeRTOS functions, that
|
||||
* are traced and thus produce additional trace data. This may cause a fast
|
||||
* increase in trace data rate, that may saturate the trace buffer and cause
|
||||
* data loss (i.e. incomplete traces).
|
||||
* To eliminate this effect and reduce the amount of trace data produced, we
|
||||
* recommend excluding all FreeRTOS objects that are used by Wifi stack.
|
||||
* This is done using vTraceSetFilterGroup and vTraceSetFilterMask:
|
||||
*
|
||||
* // Just before wifi initialization:
|
||||
*
|
||||
* // All objects created after this point are assigned to group 15.
|
||||
* vTraceSetFilterGroup(FilterGroup15);
|
||||
*
|
||||
* // Only trace objects assigned to group 0 (the default group).
|
||||
* vTraceSetFilterMask(FilterGroup0);
|
||||
*
|
||||
* // The wifi stack initialization... (creates semaphores etc.)
|
||||
* if ( eWifi_Connected == prvWifiConnect() )
|
||||
* {
|
||||
* yMainState = eMain_StartApplication;
|
||||
*
|
||||
* // When connected, restore the FilterGroup setting to Group 0, so
|
||||
* // that later created objects are included, like the TzCtrl task
|
||||
* // created in vTraceEnable. Excluding tasks is not recommended!
|
||||
* vTraceSetFilterGroup(FilterGroup0);
|
||||
*
|
||||
* // Then call vTraceEnable to start the tracing.
|
||||
* vTraceEnable(TRC_START);
|
||||
* }
|
||||
*
|
||||
* 5: If you still get "red sections" in Tracealyzer (lost data), you need
|
||||
* to adjust the other settings in trcStreamingConfig.h.
|
||||
*
|
||||
* - TRC_CFG_PAGED_EVENT_BUFFER_PAGE_COUNT
|
||||
* Increase this, as long as you have memory to spare.
|
||||
*
|
||||
* - TRC_CFG_PAGED_EVENT_BUFFER_PAGE_SIZE
|
||||
* Increase this, as long as you have memory to spare.
|
||||
* But don't exceed the maximum payload size of the Wifi chip, which
|
||||
* is often limited to 1000-1500 bytes. Some chips crash if you try to
|
||||
* send to large chunks...
|
||||
*
|
||||
* - TRC_CFG_CTRL_TASK_DELAY
|
||||
* Decrease this to flush the trace buffer more frequently.
|
||||
*
|
||||
* See also http://percepio.com/2016/10/05/rtos-tracing
|
||||
* and https://percepio.com/2018/10/11/tuning-your-custom-trace-streaming/
|
||||
*/
|
||||
|
||||
#include <trcRecorder.h>
|
||||
|
||||
#if ( TRC_USE_TRACEALYZER_RECORDER == 1 )
|
||||
#if ( TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING )
|
||||
|
||||
#include <aws_secure_sockets.h>
|
||||
|
||||
SocketsSockaddr_t addr = { sizeof( SocketsSockaddr_t ), SOCKETS_AF_INET, 0, 0 };
|
||||
|
||||
#define IPv4( a, b, c, d ) ( uint32_t ) ( ( d << 24 ) + ( c << 16 ) + ( b << 8 ) + a )
|
||||
|
||||
Socket_t sock = 0;
|
||||
|
||||
void prvInitSocket( void )
|
||||
{
|
||||
int32_t status;
|
||||
|
||||
SOCKETS_Init();
|
||||
|
||||
sock = SOCKETS_Socket( SOCKETS_AF_INET, SOCKETS_SOCK_STREAM, SOCKETS_IPPROTO_TCP );
|
||||
|
||||
configPRINTF( ( "Connecting to %d.%d.%d.%d, port %d\r\n", HOST_IPADDRESS_0, HOST_IPADDRESS_1, HOST_IPADDRESS_2, HOST_IPADDRESS_3, HOST_PORT ) );
|
||||
|
||||
addr.ulAddress = IPv4( HOST_IPADDRESS_0, HOST_IPADDRESS_1, HOST_IPADDRESS_2, HOST_IPADDRESS_3 );
|
||||
addr.usPort = SOCKETS_htons( HOST_PORT );
|
||||
|
||||
status = SOCKETS_Connect( sock, &addr, sizeof( SocketsSockaddr_t ) );
|
||||
|
||||
if( status != SOCKETS_ERROR_NONE )
|
||||
{
|
||||
/*prvTraceError(PSF_ERROR_STREAM_PORT_FAIL); */
|
||||
configPRINTF( ( "Failed to connect, status: %d\r\n", status ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
configPRINTF( ( "Connected.\r\n" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int32_t prvWriteToSocket( void * ptrData,
|
||||
uint32_t size,
|
||||
int32_t * ptrBytesWritten )
|
||||
{
|
||||
uint32_t bytesWritten = SOCKETS_Send( sock, ptrData, size, 0 );
|
||||
|
||||
if( ptrBytesWritten != 0 )
|
||||
{
|
||||
*ptrBytesWritten = ( int32_t ) bytesWritten;
|
||||
}
|
||||
|
||||
if( bytesWritten != size )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t prvReadFromSocket( void * ptrData,
|
||||
uint32_t size,
|
||||
int32_t * ptrBytesRead )
|
||||
{
|
||||
/* Not yet implemented, since not necessary. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* if ( TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING ) */
|
||||
#endif /* if ( TRC_USE_TRACEALYZER_RECORDER == 1 ) */
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
*/
|
||||
|
||||
FUNC void tzSetEnable(int enable)
|
||||
{
|
||||
if (enable == 1)
|
||||
{
|
||||
printf("Starting Tracealyzer recorder\n");
|
||||
|
||||
// Forward the ITM data to file
|
||||
exec("ITMLOG 1 > .\\tracealyzer.psf");
|
||||
|
||||
// Send start command to Tracealyzer (not required if using vTraceEnable(TRC_START))
|
||||
exec("E CHAR tz_host_command_data = 1, 1, 0, 0, 0, 0, 0xFD, 0xFF");
|
||||
exec("tz_host_command_bytes_to_read = 8");
|
||||
}
|
||||
else if (enable == 0)
|
||||
{
|
||||
printf("Stopping Tracealyzer recorder...\n");
|
||||
|
||||
// Send stop command to Tracealyzer, to stop writing ITM data.
|
||||
exec("E CHAR tz_host_command_data = 1, 0, 0, 0, 0, 0, 0xFE, 0xFF");
|
||||
exec("tz_host_command_bytes_to_read = 8");
|
||||
|
||||
_sleep_(2000); // Wait a while to let all data be written the host file.
|
||||
|
||||
// Stop forwarding the ITM data to file and close the file.
|
||||
exec("ITMLOG 1 OFF");
|
||||
|
||||
printf("Tracealyzer recorder stopped.\n");
|
||||
|
||||
}
|
||||
else printf("Usage: tzSetEnable(0 or 1), where 0 is disable (stops recorder) and 1 enable (starts recording)");
|
||||
|
||||
}
|
||||
|
||||
|
||||
// The Tracealyzer ITM stream port for Keil µVision can be used in two ways.
|
||||
//
|
||||
// 1. Start tracing directly from startup.
|
||||
// Make sure tzSetEnable(1) is called below and vTraceEnable(TRC_START) in your target startup.
|
||||
//
|
||||
// 2. Start the trace manually, using the "Start Recording" button in Keil µVision.
|
||||
// In this case, comment out the below call to tzSetEnable and make sure you call vTraceEnable(TRC_INIT) in your target startup (not TRC_START).
|
||||
|
||||
tzSetEnable(1);
|
||||
|
||||
DEFINE BUTTON "Start Recording", "tzSetEnable(1)";
|
||||
DEFINE BUTTON "Stop Recording", "tzSetEnable(0)";
|
||||
@@ -1,34 +0,0 @@
|
||||
Tracealyzer Stream Port for ARM Cortex-M ITM
|
||||
Percepio AB
|
||||
www.percepio.com
|
||||
--------------------------------------------
|
||||
|
||||
This directory contains a "stream port" for the Tracealyzer recorder library,
|
||||
i.e., the specific code needed to use a particular interface for streaming a
|
||||
Tracealyzer RTOS trace. The stream port is defined by a set of macros in
|
||||
trcStreamPort.h, found in the "include" directory.
|
||||
|
||||
This particular stream port targets ARM's ITM interface, which together with
|
||||
a fast debug probe such as a Keil ULINKpro or ULINKplus provides excellent
|
||||
performance. This stream port does not use any RAM buffer for the trace, but
|
||||
writes the data directly to the ITM registers. This is very fast.
|
||||
|
||||
To setup Keil uVision for ITM tracing with a Keil ULINKpro (or ULINKplus),
|
||||
see Percepio Application Note PA-021, https://percepio.com/2018/05/04/keil-itm-support/
|
||||
|
||||
To setup IAR Embedded Workbench for ITM tracing with an IAR I-Jet,
|
||||
see Percepio Application Note PA-023, https://percepio.com/iar
|
||||
|
||||
To setup Lauterbach TRACE32 for ITM tracing with a uTrace,
|
||||
see Percepio Application Note PA-033, https://percepio.com/apn/PA033-TRACE32%20ITM%20Streaming.pdf
|
||||
|
||||
Learn more:
|
||||
- Tracealyzer User Manual (Help -> User Manual)
|
||||
- https://percepio.com/gettingstarted
|
||||
- Percepio Application Note PA-021 (Keil), https://percepio.com/2018/05/04/keil-itm-support/
|
||||
- Percepio Application Note PA-023 (IAR), https://percepio.com/iar
|
||||
- Percepio Application Note PA-033 (Lauterbach), https://percepio.com/apn/PA033-TRACE32%20ITM%20Streaming.pdf
|
||||
- About ITM trace, https://percepio.com/2016/06/09/arm-itm/
|
||||
- About the recorder and custom streaming, http://percepio.com/2016/10/05/rtos-tracing
|
||||
|
||||
For questions, please contact support@percepio.com
|
||||
Binary file not shown.
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Trace Recorder for Tracealyzer v4.6.0
|
||||
* Copyright 2021 Percepio AB
|
||||
* www.percepio.com
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* The configuration for trace streaming ("stream ports").
|
||||
*/
|
||||
|
||||
#ifndef TRC_STREAM_PORT_CONFIG_H
|
||||
#define TRC_STREAM_PORT_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_STREAM_PORT_ITM_PORT
|
||||
*
|
||||
* Valid values: 0 - 31
|
||||
*
|
||||
* What ITM port to use for the ITM software events. Make sure the IDE is
|
||||
* configured for the same channel.
|
||||
*
|
||||
* Default: 1 (0 is typically terminal output and 31 is used by Keil)
|
||||
*
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_STREAM_PORT_ITM_PORT 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_STREAM_PORT_CONFIG_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user