|
17 | 17 | * @note Create RT_CPUS_NR threads, thread 0 is bound to core 0, other threads are not bound to specific cores, |
18 | 18 | * after running for a set number of times, count the number of times each core is run on the corresponding core, |
19 | 19 | * thread 0 should always be run on core 0, other threads will be run on different cores. |
| 20 | + * |
| 21 | + * Test Case Name: [smp_bind_affinity] |
| 22 | + * |
| 23 | + * Test Objectives: |
| 24 | + * - Verify that threads bound to specific cores run on those cores. |
| 25 | + * |
| 26 | + * Test Scenarios: |
| 27 | + * - RT_CPUS_NR threads (T0~T(RT_CPUS_NR-1)) are created, with only T0 bound to core 0. When thread Tx is running, |
| 28 | + * - thread_tic[x] increments by 1; if x is equal to the core ID, thread_inc[x] also increments by 1. After the |
| 29 | + * - program runs for a period of time, observe the value relationship between the thread_inc and thread_tic arrays. |
| 30 | + * - If thread_inc[x] is equal to thread_tic[x], it indicates that thread Tx is correctly bound to core x. In this test case, |
| 31 | + * - only thread_inc[0] will be equal to thread_tic[0]. |
| 32 | + * |
| 33 | + * Verification Metrics: |
| 34 | + * - Output message: [I/utest] [ PASSED ] [ result ] testcase (core.smp_bind_affinity) |
| 35 | + * |
| 36 | + * Dependencies: |
| 37 | + * - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256. |
| 38 | + * |
| 39 | + * Expected Results: |
| 40 | + * - You will see the relevant PASS message. Additionally, RT_CPUS_NR lines of printed information will be displayed, |
| 41 | + * - indicating whether each thread Tx has been running on core x all the time. The results show that only T0 has been |
| 42 | + * - running on core 0 consistently. |
20 | 43 | */ |
21 | 44 |
|
22 | 45 | /* Number of thread runs */ |
|
0 commit comments