FreeRTOS-Kernel/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcStaticBuffer.c
Soren Ptak 3a2f6646f0
Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083)
* Use new version of CI-CD Actions,  checkout@v3 instead of checkout@v2 on all jobs
* Use cSpell spell check, and use ubuntu-20.04 for formatting check
* Add in bot formatting action
* Update freertos_demo.yml and freertos_plus_demo.yml files to increase github log readability
* Add in a Qemu demo onto the workflows.
2023-09-06 12:35:37 -07:00

57 lines
1.8 KiB
C

/*
* Percepio Trace Recorder for Tracealyzer v4.6.0
* Copyright 2021 Percepio AB
* www.percepio.com
*
* SPDX-License-Identifier: Apache-2.0
*
* The implementation for the static buffer.
*/
#include <trcRecorder.h>
#if ( TRC_USE_TRACEALYZER_RECORDER == 1 )
#if ( TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING )
TraceStaticBufferTable_t * pxTraceStaticBufferTable;
traceResult xTraceStaticBufferInitialize( TraceStaticBufferBuffer_t * pxBuffer )
{
TRC_ASSERT_EQUAL_SIZE( TraceStaticBufferBuffer_t, TraceStaticBufferTable_t );
/* This should never fail */
TRC_ASSERT( pxBuffer != 0 );
pxTraceStaticBufferTable = ( TraceStaticBufferTable_t * ) pxBuffer;
xTraceSetComponentInitialized( TRC_RECORDER_COMPONENT_STATIC_BUFFER );
return TRC_SUCCESS;
}
#if ( ( TRC_CFG_USE_TRACE_ASSERT ) == 1 )
/* Returns a pointer to a maximum sized static buffer */
traceResult xTraceStaticBufferGet( void ** ppvBuffer )
{
int32_t ISR_nesting;
/* This should never fail */
TRC_ASSERT( xTraceIsComponentInitialized( TRC_RECORDER_COMPONENT_STATIC_BUFFER ) );
TRC_ASSERT( ppvBuffer != 0 );
TRC_ASSERT( xTraceISRGetCurrentNesting( &ISR_nesting ) == TRC_SUCCESS );
/* Task dummy events begin at 0, ISR dummy events begin at index 1 */
*ppvBuffer = ( void * ) &pxTraceStaticBufferTable->coreDummyEvents[ TRC_CFG_GET_CURRENT_CORE() ].dummyEvents[ ISR_nesting + 1 ];
return TRC_SUCCESS;
}
#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
#endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
#endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */