mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 08:47:45 -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 )
|
||||
endif()
|
||||
|
||||
if( COVERAGE_TEST )
|
||||
if( ( COVERAGE_TEST ) OR ( NO_TRACING ) )
|
||||
set( COVERAGE_TEST 1 )
|
||||
add_compile_options( -DprojCOVERAGE_TEST=1 )
|
||||
else()
|
||||
|
|
|
@ -143,8 +143,10 @@ static BaseType_t prvStaticAllocationsWithNullBuffers( void )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static BaseType_t prvTraceUtils( void )
|
||||
{
|
||||
#if( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
static BaseType_t prvTraceUtils( void )
|
||||
{
|
||||
EventGroupHandle_t xEventGroup;
|
||||
QueueHandle_t xQueue;
|
||||
BaseType_t xReturn = pdPASS;
|
||||
|
@ -202,8 +204,8 @@ static BaseType_t prvTraceUtils( void )
|
|||
xReturn = pdFAIL;
|
||||
}
|
||||
|
||||
/* Exercise the task trace utilities. Value of 100 is arbitrary, just want
|
||||
* to check the value that is set is also read back. */
|
||||
/* Exercise the task trace utilities. Value of 100 is arbitrary, just
|
||||
* want to check the value that is set is also read back. */
|
||||
uxValue = 100;
|
||||
xTaskHandle = xTaskGetCurrentTaskHandle();
|
||||
vTaskSetTaskNumber( xTaskHandle, uxValue );
|
||||
|
@ -221,8 +223,8 @@ static BaseType_t prvTraceUtils( void )
|
|||
/* Timer trace util functions are exercised in prvTimerQuery(). */
|
||||
|
||||
|
||||
/* Exercise the stream buffer utilities. Try creating with a trigger level
|
||||
* of 0, it should then get capped to 1. */
|
||||
/* Exercise the stream buffer utilities. Try creating with a trigger
|
||||
* level of 0, it should then get capped to 1. */
|
||||
xStreamBuffer = xStreamBufferCreate( sizeof( uint32_t ), 0 );
|
||||
|
||||
if( xStreamBuffer != NULL )
|
||||
|
@ -265,7 +267,9 @@ static BaseType_t prvTraceUtils( void )
|
|||
}
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* #if( configUSE_TRACE_FACILITY == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static BaseType_t prvPeekTimeout( void )
|
||||
|
@ -370,8 +374,10 @@ static BaseType_t prvQueueQueryFromISR( void )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static BaseType_t prvTaskQueryFunctions( void )
|
||||
{
|
||||
#if( configUSE_TRACE_FACILITY == 1)
|
||||
|
||||
static BaseType_t prvTaskQueryFunctions( void )
|
||||
{
|
||||
static TaskStatus_t xStatus, * pxStatusArray;
|
||||
TaskHandle_t xTimerTask, xIdleTask;
|
||||
BaseType_t xReturn = pdPASS;
|
||||
|
@ -469,7 +475,7 @@ static BaseType_t prvTaskQueryFunctions( void )
|
|||
xReturn = pdFAIL;
|
||||
}
|
||||
|
||||
/* Basic santity check of array contents. */
|
||||
/* Basic sanity check of array contents. */
|
||||
for( ux = 0; ux < uxReturned; ux++ )
|
||||
{
|
||||
if( pxStatusArray[ ux ].eCurrentState >= ( UBaseType_t ) eInvalid )
|
||||
|
@ -491,7 +497,9 @@ static BaseType_t prvTaskQueryFunctions( void )
|
|||
}
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* #if( configUSE_TRACE_FACILITY == 1) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static BaseType_t prvDummyTagFunction( void * pvParameter )
|
||||
|
@ -609,12 +617,16 @@ static BaseType_t prvTimerQuery( void )
|
|||
xReturn = pdFAIL;
|
||||
}
|
||||
|
||||
#if( configUSE_TRACE_FACILITY == 1 )
|
||||
{
|
||||
vTimerSetTimerNumber( xTimer, uxTimerNumber );
|
||||
|
||||
if( uxTimerGetTimerNumber( xTimer ) != uxTimerNumber )
|
||||
{
|
||||
xReturn = pdFAIL;
|
||||
}
|
||||
}
|
||||
#endif /* #if( configUSE_TRACE_FACILITY == 1 ) */
|
||||
|
||||
xTimerDelete( xTimer, portMAX_DELAY );
|
||||
}
|
||||
|
@ -632,10 +644,16 @@ BaseType_t xRunCodeCoverageTestAdditions( void )
|
|||
BaseType_t xReturn = pdPASS;
|
||||
|
||||
xReturn &= prvStaticAllocationsWithNullBuffers();
|
||||
|
||||
#if( configUSE_TRACE_FACILITY == 1 )
|
||||
{
|
||||
xReturn &= prvTraceUtils();
|
||||
xReturn &= prvTaskQueryFunctions();
|
||||
}
|
||||
#endif
|
||||
|
||||
xReturn &= prvPeekTimeout();
|
||||
xReturn &= prvQueueQueryFromISR();
|
||||
xReturn &= prvTaskQueryFunctions();
|
||||
xReturn &= prvTaskTags();
|
||||
xReturn &= prvTimerQuery();
|
||||
|
||||
|
|
|
@ -737,6 +737,8 @@ static void prvDemonstrateTaskStateAndHandleGetFunctions( void )
|
|||
xErrorCount++;
|
||||
}
|
||||
|
||||
#if( configUSE_TRACE_FACILITY == 1 )
|
||||
{
|
||||
/* Also with the vTaskGetInfo() function. */
|
||||
vTaskGetInfo( xTimerTaskHandle, /* The task being queried. */
|
||||
&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";
|
||||
xErrorCount++;
|
||||
}
|
||||
}
|
||||
#endif /* #if( configUSE_TRACE_FACILITY == 1 ) */
|
||||
|
||||
/* 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue