Skip to content

Commit 566995f

Browse files
committed
[docs][utest]:Add comments for smp_bind_affinity
Add comments for smp_bind_affinity Signed-off-by: Mengchen Teng <[email protected]>
1 parent 32d5c71 commit 566995f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/utest/smp/smp_bind_affinity_tc.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,28 @@
1717
* @note Create RT_CPUS_NR threads, thread 0 is bound to core 0, other threads are not bound to specific cores,
1818
* after running for a set number of times, count the number of times each core is run on the corresponding core,
1919
* 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.
31+
*
32+
* Verification Metrics:
33+
* - Output message: [I/utest] [ PASSED ] [ result ] testcase (core.smp_bind_affinity)
34+
*
35+
* Dependencies:
36+
* - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256.
37+
*
38+
* Expected Results:
39+
* - You will see the relevant PASS message. Additionally, RT_CPUS_NR lines of printed information will be displayed,
40+
* - indicating whether each thread Tx has been running on core x all the time. The results show that only T0 has been
41+
* - running on core 0 consistently.
2042
*/
2143

2244
/* Number of thread runs */

0 commit comments

Comments
 (0)