git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9191 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
Giovanni Di Sirio 2016-03-31 15:07:56 +00:00
parent e783e741f5
commit e47e9096bd
3 changed files with 54 additions and 30 deletions

View File

@ -48,7 +48,7 @@
* @details Frequency of the system timer that drives the system ticks. This
* setting also defines the system tick time unit.
*/
#define CH_CFG_ST_FREQUENCY 1000
#define CH_CFG_ST_FREQUENCY 10000
/**
* @brief Time delta constant for the tick-less mode.
@ -58,7 +58,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
#define CH_CFG_ST_TIMEDELTA 0
#define CH_CFG_ST_TIMEDELTA 2
/** @} */
@ -396,7 +396,7 @@
* @note This debug option is not currently compatible with the
* tickless mode.
*/
#define CH_DBG_THREADS_PROFILING TRUE
#define CH_DBG_THREADS_PROFILING FALSE
/** @} */

View File

@ -1341,6 +1341,7 @@ static THD_FUNCTION(thread1, p) {
chMtxUnlock(&m1);
}
#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
/* Low priority thread */
static THD_FUNCTION(thread2L, p) {
@ -1427,6 +1428,7 @@ static THD_FUNCTION(thread3HH, p) {
chMtxUnlock(&m2);
test_emit_token('A');
}
#endif /* CH_DBG_THREADS_PROFILING */
static THD_FUNCTION(thread4A, p) {
@ -1562,7 +1564,7 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value>Three threads are involved in the classic priority inversion scenario, a medium priority thread tries to starve an high priority thread by blocking a low priority thread into a mutex lock zone. The test expects the threads to reach their goal in increasing priority order by rearranging their priorities in order to avoid the priority inversion trap.</value>
</description>
<condition>
<value />
<value>CH_DBG_THREADS_PROFILING</value>
</condition>
<various_code>
<setup_code>
@ -1624,7 +1626,7 @@ test_assert_sequence("ABC", "invalid sequence");]]></value>
<value>Five threads are involved in the complex priority inversion scenario, the priority inheritance algorithm is tested for depths greater than one. The test expects the threads to perform their operations in increasing priority order by rearranging their priorities in order to avoid the priority inversion trap.</value>
</description>
<condition>
<value />
<value>CH_DBG_THREADS_PROFILING</value>
</condition>
<various_code>
<setup_code>

View File

@ -87,6 +87,7 @@ static THD_FUNCTION(thread1, p) {
chMtxUnlock(&m1);
}
#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
/* Low priority thread */
static THD_FUNCTION(thread2L, p) {
@ -173,6 +174,7 @@ static THD_FUNCTION(thread3HH, p) {
chMtxUnlock(&m2);
test_emit_token('A');
}
#endif /* CH_DBG_THREADS_PROFILING */
static THD_FUNCTION(thread4A, p) {
@ -297,6 +299,7 @@ static const testcase_t test_005_001 = {
test_005_001_execute
};
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
/**
* @page test_005_002 [5.2] Priority inheritance, simple case
*
@ -308,6 +311,12 @@ static const testcase_t test_005_001 = {
* order by rearranging their priorities in order to avoid the priority
* inversion trap.
*
* <h2>Conditions</h2>
* This test is only executed if the following preprocessor condition
* evaluates to true:
* - CH_DBG_THREADS_PROFILING
* .
*
* <h2>Test Steps</h2>
* - [5.2.1] Getting the system time for test duration measurement.
* - [5.2.2] The three contenders threads are created and let run
@ -358,7 +367,9 @@ static const testcase_t test_005_002 = {
NULL,
test_005_002_execute
};
#endif /* CH_DBG_THREADS_PROFILING */
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
/**
* @page test_005_003 [5.3] Priority inheritance, complex case
*
@ -369,6 +380,12 @@ static const testcase_t test_005_002 = {
* operations in increasing priority order by rearranging their
* priorities in order to avoid the priority inversion trap.
*
* <h2>Conditions</h2>
* This test is only executed if the following preprocessor condition
* evaluates to true:
* - CH_DBG_THREADS_PROFILING
* .
*
* <h2>Test Steps</h2>
* - [5.3.1] Getting the system time for test duration measurement.
* - [5.3.2] The five contenders threads are created and let run
@ -422,6 +439,7 @@ static const testcase_t test_005_003 = {
NULL,
test_005_003_execute
};
#endif /* CH_DBG_THREADS_PROFILING */
/**
* @page test_005_004 [5.4] Priority return verification
@ -1012,8 +1030,12 @@ static const testcase_t test_005_009 = {
*/
const testcase_t * const test_sequence_005[] = {
&test_005_001,
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
&test_005_002,
#endif
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
&test_005_003,
#endif
&test_005_004,
#if (!CH_CFG_USE_MUTEXES_RECURSIVE) || defined(__DOXYGEN__)
&test_005_005,