mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
Enable task run time monitoring in osx simulation
This commit is contained in:
parent
0e815540ff
commit
dee17f8fd4
@ -125,10 +125,10 @@ void TaskMonitorUpdateAll(void)
|
|||||||
data.StackRemaining[n] = 10000;
|
data.StackRemaining[n] = 10000;
|
||||||
#else
|
#else
|
||||||
data.StackRemaining[n] = uxTaskGetStackHighWaterMark(handles[n]) * 4;
|
data.StackRemaining[n] = uxTaskGetStackHighWaterMark(handles[n]) * 4;
|
||||||
|
#endif
|
||||||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||||
/* Generate run time stats */
|
/* Generate run time stats */
|
||||||
data.RunningTime[n] = uxTaskGetRunTime(handles[n]) / deltaTime;
|
data.RunningTime[n] = uxTaskGetRunTime(handles[n]) / deltaTime;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,9 +88,14 @@ to exclude the API function. */
|
|||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
||||||
|
|
||||||
|
/* Enable run time stats collection */
|
||||||
|
#define configGENERATE_RUN_TIME_STATS 1
|
||||||
|
#define INCLUDE_uxTaskGetRunTime 1
|
||||||
|
|
||||||
|
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
|
||||||
|
#define portGET_RUN_TIME_COUNTER_VALUE() clock()
|
||||||
|
|
||||||
|
#error Here
|
||||||
/* This is the raw value as per the Cortex-M3 NVIC. Values can be 255
|
/* This is the raw value as per the Cortex-M3 NVIC. Values can be 255
|
||||||
(lowest) to 1 (highest maskable) to 0 (highest non-maskable). */
|
(lowest) to 1 (highest maskable) to 0 (highest non-maskable). */
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY 15 << 4 /* equivalent to NVIC priority 15 */
|
#define configKERNEL_INTERRUPT_PRIORITY 15 << 4 /* equivalent to NVIC priority 15 */
|
||||||
|
@ -1044,6 +1044,19 @@ void vTaskList( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
|
|||||||
*/
|
*/
|
||||||
void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
|
void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <PRE>unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask );</PRE>
|
||||||
|
*
|
||||||
|
* Returns the run time of selected task
|
||||||
|
*
|
||||||
|
* @param xTask Handle of the task associated with the stack to be checked.
|
||||||
|
* Set xTask to NULL to check the stack of the calling task.
|
||||||
|
*
|
||||||
|
* @return The run time of selected task
|
||||||
|
*/
|
||||||
|
unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>void vTaskStartTrace( char * pcBuffer, unsigned portBASE_TYPE uxBufferSize );</PRE>
|
* <PRE>void vTaskStartTrace( char * pcBuffer, unsigned portBASE_TYPE uxBufferSize );</PRE>
|
||||||
|
@ -1312,6 +1312,24 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
|
|||||||
xTaskResumeAll();
|
xTaskResumeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if ( INCLUDE_uxTaskGetRunTime == 1 )
|
||||||
|
|
||||||
|
unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask )
|
||||||
|
{
|
||||||
|
unsigned long runTime;
|
||||||
|
|
||||||
|
tskTCB *pxTCB;
|
||||||
|
pxTCB = prvGetTCBFromHandle( xTask );
|
||||||
|
runTime = pxTCB->ulRunTimeCounter;
|
||||||
|
pxTCB->ulRunTimeCounter = 0;
|
||||||
|
return runTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/*----------------------------------------------------------*/
|
/*----------------------------------------------------------*/
|
||||||
|
|
||||||
@ -2112,6 +2130,7 @@ tskTCB *pxNewTCB;
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
|
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user