mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 16:57:41 -04:00
Fix demo build issue , when configUSE_TRACE_FACILITY is disabled (#1189)
This PR enables the FreeRTOS Posix Blinky GCC Demo to be used without the configUSE_TRACE_FACILITY enabled. It is achieved by using `-DNO_TRACING=1` CMake option to disable tracing. By default, -DNO_TRACING is set to 0, and the tracing is enabled.
This commit is contained in:
parent
2adaf8471f
commit
77cc06d692
3 changed files with 237 additions and 215 deletions
|
@ -10,7 +10,7 @@ else()
|
||||||
add_compile_options( -DTRACE_ON_ENTER=0 )
|
add_compile_options( -DTRACE_ON_ENTER=0 )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( COVERAGE_TEST )
|
if( ( COVERAGE_TEST ) OR ( NO_TRACING ) )
|
||||||
set( COVERAGE_TEST 1 )
|
set( COVERAGE_TEST 1 )
|
||||||
add_compile_options( -DprojCOVERAGE_TEST=1 )
|
add_compile_options( -DprojCOVERAGE_TEST=1 )
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -143,6 +143,8 @@ static BaseType_t prvStaticAllocationsWithNullBuffers( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if( configUSE_TRACE_FACILITY == 1 )
|
||||||
|
|
||||||
static BaseType_t prvTraceUtils( void )
|
static BaseType_t prvTraceUtils( void )
|
||||||
{
|
{
|
||||||
EventGroupHandle_t xEventGroup;
|
EventGroupHandle_t xEventGroup;
|
||||||
|
@ -202,8 +204,8 @@ static BaseType_t prvTraceUtils( void )
|
||||||
xReturn = pdFAIL;
|
xReturn = pdFAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exercise the task trace utilities. Value of 100 is arbitrary, just want
|
/* Exercise the task trace utilities. Value of 100 is arbitrary, just
|
||||||
* to check the value that is set is also read back. */
|
* want to check the value that is set is also read back. */
|
||||||
uxValue = 100;
|
uxValue = 100;
|
||||||
xTaskHandle = xTaskGetCurrentTaskHandle();
|
xTaskHandle = xTaskGetCurrentTaskHandle();
|
||||||
vTaskSetTaskNumber( xTaskHandle, uxValue );
|
vTaskSetTaskNumber( xTaskHandle, uxValue );
|
||||||
|
@ -221,8 +223,8 @@ static BaseType_t prvTraceUtils( void )
|
||||||
/* Timer trace util functions are exercised in prvTimerQuery(). */
|
/* Timer trace util functions are exercised in prvTimerQuery(). */
|
||||||
|
|
||||||
|
|
||||||
/* Exercise the stream buffer utilities. Try creating with a trigger level
|
/* Exercise the stream buffer utilities. Try creating with a trigger
|
||||||
* of 0, it should then get capped to 1. */
|
* level of 0, it should then get capped to 1. */
|
||||||
xStreamBuffer = xStreamBufferCreate( sizeof( uint32_t ), 0 );
|
xStreamBuffer = xStreamBufferCreate( sizeof( uint32_t ), 0 );
|
||||||
|
|
||||||
if( xStreamBuffer != NULL )
|
if( xStreamBuffer != NULL )
|
||||||
|
@ -266,6 +268,8 @@ static BaseType_t prvTraceUtils( void )
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* #if( configUSE_TRACE_FACILITY == 1 ) */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static BaseType_t prvPeekTimeout( void )
|
static BaseType_t prvPeekTimeout( void )
|
||||||
|
@ -370,6 +374,8 @@ static BaseType_t prvQueueQueryFromISR( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if( configUSE_TRACE_FACILITY == 1)
|
||||||
|
|
||||||
static BaseType_t prvTaskQueryFunctions( void )
|
static BaseType_t prvTaskQueryFunctions( void )
|
||||||
{
|
{
|
||||||
static TaskStatus_t xStatus, * pxStatusArray;
|
static TaskStatus_t xStatus, * pxStatusArray;
|
||||||
|
@ -469,7 +475,7 @@ static BaseType_t prvTaskQueryFunctions( void )
|
||||||
xReturn = pdFAIL;
|
xReturn = pdFAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Basic santity check of array contents. */
|
/* Basic sanity check of array contents. */
|
||||||
for( ux = 0; ux < uxReturned; ux++ )
|
for( ux = 0; ux < uxReturned; ux++ )
|
||||||
{
|
{
|
||||||
if( pxStatusArray[ ux ].eCurrentState >= ( UBaseType_t ) eInvalid )
|
if( pxStatusArray[ ux ].eCurrentState >= ( UBaseType_t ) eInvalid )
|
||||||
|
@ -492,6 +498,8 @@ static BaseType_t prvTaskQueryFunctions( void )
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* #if( configUSE_TRACE_FACILITY == 1) */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static BaseType_t prvDummyTagFunction( void * pvParameter )
|
static BaseType_t prvDummyTagFunction( void * pvParameter )
|
||||||
|
@ -609,12 +617,16 @@ static BaseType_t prvTimerQuery( void )
|
||||||
xReturn = pdFAIL;
|
xReturn = pdFAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if( configUSE_TRACE_FACILITY == 1 )
|
||||||
|
{
|
||||||
vTimerSetTimerNumber( xTimer, uxTimerNumber );
|
vTimerSetTimerNumber( xTimer, uxTimerNumber );
|
||||||
|
|
||||||
if( uxTimerGetTimerNumber( xTimer ) != uxTimerNumber )
|
if( uxTimerGetTimerNumber( xTimer ) != uxTimerNumber )
|
||||||
{
|
{
|
||||||
xReturn = pdFAIL;
|
xReturn = pdFAIL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif /* #if( configUSE_TRACE_FACILITY == 1 ) */
|
||||||
|
|
||||||
xTimerDelete( xTimer, portMAX_DELAY );
|
xTimerDelete( xTimer, portMAX_DELAY );
|
||||||
}
|
}
|
||||||
|
@ -632,10 +644,16 @@ BaseType_t xRunCodeCoverageTestAdditions( void )
|
||||||
BaseType_t xReturn = pdPASS;
|
BaseType_t xReturn = pdPASS;
|
||||||
|
|
||||||
xReturn &= prvStaticAllocationsWithNullBuffers();
|
xReturn &= prvStaticAllocationsWithNullBuffers();
|
||||||
|
|
||||||
|
#if( configUSE_TRACE_FACILITY == 1 )
|
||||||
|
{
|
||||||
xReturn &= prvTraceUtils();
|
xReturn &= prvTraceUtils();
|
||||||
|
xReturn &= prvTaskQueryFunctions();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
xReturn &= prvPeekTimeout();
|
xReturn &= prvPeekTimeout();
|
||||||
xReturn &= prvQueueQueryFromISR();
|
xReturn &= prvQueueQueryFromISR();
|
||||||
xReturn &= prvTaskQueryFunctions();
|
|
||||||
xReturn &= prvTaskTags();
|
xReturn &= prvTaskTags();
|
||||||
xReturn &= prvTimerQuery();
|
xReturn &= prvTimerQuery();
|
||||||
|
|
||||||
|
|
|
@ -737,6 +737,8 @@ static void prvDemonstrateTaskStateAndHandleGetFunctions( void )
|
||||||
xErrorCount++;
|
xErrorCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if( configUSE_TRACE_FACILITY == 1 )
|
||||||
|
{
|
||||||
/* Also with the vTaskGetInfo() function. */
|
/* Also with the vTaskGetInfo() function. */
|
||||||
vTaskGetInfo( xTimerTaskHandle, /* The task being queried. */
|
vTaskGetInfo( xTimerTaskHandle, /* The task being queried. */
|
||||||
&xTaskInfo, /* The structure into which information on the task will be written. */
|
&xTaskInfo, /* The structure into which information on the task will be written. */
|
||||||
|
@ -753,6 +755,8 @@ static void prvDemonstrateTaskStateAndHandleGetFunctions( void )
|
||||||
pcStatusMessage = "Error: vTaskGetInfo() returned incorrect information about the timer task";
|
pcStatusMessage = "Error: vTaskGetInfo() returned incorrect information about the timer task";
|
||||||
xErrorCount++;
|
xErrorCount++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif /* #if( configUSE_TRACE_FACILITY == 1 ) */
|
||||||
|
|
||||||
/* Other tests that should only be performed once follow. The test task
|
/* Other tests that should only be performed once follow. The test task
|
||||||
* is not created on each iteration because to do so would cause the death
|
* is not created on each iteration because to do so would cause the death
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue