Commit Graph

1198 Commits

Author SHA1 Message Date
CYFS caca34c377 utest: fix hooklist testcase reinit 2026-06-26 17:07:01 +08:00
GuEe-GUI 6fc3e18912 fix: stabilize smp_bind_affinity_tc on SMP CI
This change fixes intermittent failures of the `core.smp_bind_affinity`
utest across SMP CI targets. The original failure was a flaky assertion on
unbound threads (`thread_inc[x] != thread_tic[x]` in thread_entry), not
incorrect bind_cpu behavior. CI logs already showed T0 binding worked
(thread_inc[0] == thread_tic[0] == 100) while the not_equal check failed.
The root issue is that unbound-thread CPU placement is platform-dependent
and outside the bind_cpu contract. On dual-core RISC-V/ARMv7 CI, an
unbound thread may legitimately run all iterations on core 0 while T0
delays on the same core, so any assertion requiring cross-core migration
(thread_inc != thread_tic, or core_mask with multiple bits) remains flaky.
This patch narrows the test to what bind_affinity actually verifies: T0
bound to core 0 must always execute on core 0. Unbound threads only add
scheduling pressure; their core_mask is printed for observation but not
asserted.
Changes:
- Sample `rt_hw_cpu_id()` and update counters under `rt_sched_lock` to
  avoid migration skew between counting and CPU sampling.
- Track `thread_core_mask` for diagnostics; assert only T0 binding via
  `thread_inc[0] == thread_tic[0]` and `thread_core_mask[0] == 1`.
- Remove flaky unbound-thread assertions (`thread_inc != thread_tic` and
  multi-core core_mask checks).
- Move T0 assertions to the main test thread after all workers finish.
- Use atomic `finsh_flag`; reset counters and `threads[]` in `utest_tc_init`.
- Spin in worker loops after `run_num` until cleanup deletes them (do not
  return from thread_entry or use `RT_WAITING_FOREVER` with `rt_thread_delay`).
- Guard `rt_thread_delete` in cleanup with non-NULL checks.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-06-17 09:51:13 +08:00
GuEe-GUI 63965cb103 [bsp][zynqmp-a53-dfzu2eg] enable full dm
This is a builtin fdt example BSP

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-06-08 14:57:37 +08:00
AFWEF_147 3f6a21d55b fix(finsh): validate backtrace thread address 2026-05-11 14:09:25 +08:00
rcitach 5d07af527d 修改vdso时间更新触发位置 2026-04-30 06:19:58 +08:00
rcitach 03f10a8a45 添加 vdso readtime 更新逻辑 2026-04-30 06:19:58 +08:00
rcitach 178e9f264f style: format code with clang-format [skip ci] 2026-04-30 06:19:58 +08:00
rcitach c92480894c 更新 vdso 框架 2026-04-30 06:19:58 +08:00
CYFS ae5b5ed182 [action][utest]:Expand kernel auto-run matrix and sync test configs 2026-04-19 20:37:38 +08:00
wdfk-prog e74547bbb3 feat(core): Add Cortex-M4 interrupt context helpers 2026-04-08 18:58:33 +08:00
wdfk-prog 2548bdb9c2 fix(src): Use interrupt nest accessor and export IRQ hook pointers 2026-04-08 18:58:33 +08:00
Rbb666 4025c51407 [kernel]Rewrite rt_thread_get_usage to use incremental statistics based on sampling windows. 2026-04-07 14:49:15 +08:00
wdfk-prog 29e5f61fb9 fix[src][thread]: add defensive check for idle thread suspension 2026-04-07 13:54:11 +08:00
Telecaster2147 c7122a46b4 style: format code with clang-format [skip ci] 2026-03-31 10:37:11 +08:00
AFWEF_147 7cd7e05ba4 fix(lwp): validate thread priority in sched syscalls 2026-03-31 10:37:11 +08:00
wdfk-prog 012e301664 docs(kservice): Update the documentation comments of the fls function 2026-03-16 10:27:53 +08:00
wdfk-prog cda0a63ab5 refactor(core): Move __rt_fls to kservice 2026-03-12 16:40:33 +08:00
wdfk-prog fe548e1505 docs(core): Add help description for RT_USING_THREADSAFE_PRINTF 2026-03-06 09:47:59 +08:00
Shaun 4a090fbd5b fix(klibc): fix incorrect %hh format output for values in [0x80, 0xff] 2026-02-25 10:51:53 +08:00
wdfk-prog db6c0ddbf3 feat(console): Add console output enable switch
- rt_console_output_enabled()/rt_console_output_is_enabled() gate rt_kprintf/rt_kputs output with the switch
2026-02-12 09:24:18 +08:00
Bernard Xiong 743b614875
[components][clock_time] Refactor time subsystem around clock_time (#11111)
* [components][clock_time] Refactor time subsystem around clock_time

Introduce the clock_time core with clock source/event separation, high-resolution scheduling, and boot-time helpers, plus clock_timer adapters for timer peripherals.

Remove legacy ktime/cputime/hwtimer implementations and migrate arch and BSP time paths to the new subsystem while keeping POSIX time integration functional.

Update drivers, Kconfig/SConscript wiring, documentation, and tests; add clock_time overview docs and align naming to clock_boottime/clock_hrtimer/clock_timer.

* [components][clock_time] Use BSP-provided clock timer frequency on riscv64

* [risc-v] Use runtime clock timer frequency for tick and delays

* [bsp] Add clock timer frequency hooks for riscv64 boards

* [bsp] Update Renesas RA driver doc clock_timer link

* [bsp] Sync zynqmp-r5-axu4ev rtconfig after config refresh

* [bsp][rk3500] Update rk3500 clock configuration

* [bsp][hpmicro] Add rt_hw_us_delay hook and update board delays

* [bsp][stm32l496-st-nucleo] enable clock_time for hwtimer sample in ci

* [bsp][hpmicro] Fix rtconfig include scope for hpm6750evk

Move rtconfig.h include outside the ENET_MULTIPLE_PORT guard for hpm6750evk and hpm6750evk2 so configuration macros are available regardless of ENET settings.

* [bsp][raspi3] select clock time for systimer

* [bsp][hpm5300evk] Trim trailing blank line

* [bsp][hpm5301evklite] Trim trailing blank line

* [bsp][hpm5e00evk] Trim trailing blank line

* [bsp][hpm6200evk] Trim trailing blank line

* [bsp][hpm6300evk] Trim trailing blank line

* [bsp][hpm6750evk] Trim trailing blank line

* [bsp][hpm6750evk2] Trim trailing blank line

* [bsp][hpm6750evkmini] Trim trailing blank line

* [bsp][hpm6800evk] Trim trailing blank line

* [bsp][hpm6e00evk] Trim trailing blank line

* [bsp][nxp] switch lpc178x to gcc and remove mcx timer source

* [bsp][stm32] fix the CONFIG_RT_USING_CLOCK_TIME issue.

* [docs][clock_time] add clock time documentation

* [docs][clock_time] Update clock time subsystem documentation

- Update device driver index to use correct page reference
- Clarify upper layer responsibilities in architecture overview
- Update README to describe POSIX/libc, Soft RTC, and device driver usage
- Refine architecture diagram with improved layout and color scheme
- Remove obsolete clock_timer.md file

* [kernel][utest] Trim trailing space

* [clock_time] Fix hrtimer wrap handling

* [clock_time] fix the static rt_inline issue

* [clock_time] fix the rt_clock_hrtimer_control result issue
2026-01-31 17:44:27 +08:00
westcity-YOLO 949cd2c720 Add standardized utest documentation block 2026-01-15 13:39:00 +08:00
wdfk-prog 3a2d67e965 fix(components): validate RT_MAIN_THREAD_PRIORITY range at build time 2026-01-07 17:47:48 +08:00
lhxj 5782174905 Most test cases in `src/utest` lack standardized functional documentation, as tracked in issue [#10895](https://github.com/RT-Thread/rt-thread/issues/10895). This leads to high maintenance costs, difficulty for new contributors, and inefficient code reviews.
Solution:
This patch adds the full, standardized documentation block to `sched_mtx_tc.c`, `sched_sem_tc.c`, `sched_thread_tc.c`, `sched_timed_mtx_tc.c` and `sched_timed_sem_tc.c` following the approved template.

The documentation details:
- Test Objectives and tested APIs
- Test Scenarios
- Verification Metrics
- Dependencies
- Test Execution command and Expected Results

This makes the test case's purpose and behavior immediately clear to future maintainers and reviewers.

Relates to [#10895](https://github.com/RT-Thread/rt-thread/issues/10895)

Signed-off-by: lhxj <2743257167@qq.com>
2025-12-14 21:14:48 +08:00
R b b666 a036ddcb34
Update RT_VER_NUM to 5.3.0 (#11039) 2025-12-12 10:34:53 +08:00
Kurngsy e4dce1df7d
fix: [kernel] [thread] Resolve delayed thread wakeup bug when calling suspend repeatedly (#10970)
* Enhance thread suspend function with stricter checks

Refactor thread suspension logic to improve clarity and correctness.

* Clean up formatting in thread.c

Removed unnecessary blank line in thread.c.

* Refactor thread suspend state handling

Refactor thread suspension logic to improve clarity and maintainability.

* Update thread.c

* Fix indentation for RT_THREAD_SUSPEND_KILLABLE case
2025-12-11 11:23:52 +08:00
Teng mengchen 957bac0434
[utest][smp]Add descriptions for the SMP test cases (interrupt_pri and spinlock) #11011 2025-12-11 11:14:43 +08:00
Tm-C-mT d9ca9c449b [docs][utest]:Add comments for smp_thread_preemption
Add comments for smp_thread_preemption.

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-12-10 17:06:41 +08:00
Tm-C-mT d56d3d95d5 [utest]:Modify the execution logic of smp_thread_preemptions
Currently, the print information of this test case fails to demonstrate that
the high-priority thread has preempted the low-priority thread. This is because
when the high-priority thread prints the thread list, there is no information
about the low-priority thread (tlow), as tlow has already completed execution
and been destroyed. Therefore, the current execution logic cannot confirm the
successful completion of the preemption operation.

Solution: After the low-priority thread (tlow) releases the lock, add a busy-wait
loop while(!finish_flag);. At this point, when the high-priority thread (thigh)
prints the thread list information, tlow can be observed in the ready state, indicating
that it has been preempted by thigh.

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-12-10 17:06:41 +08:00
Tm-C-mT dd19c0eb72 [utest]: Solve the address misalignment issue of atomic operations
In smp_assigned_idle_cores_tc, the finish_flag involves atomic operations
and thus requires address alignment.

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-12-04 11:17:50 +08:00
Tm-C-mT 9c2279acdc [docs][utest]:Add comments for smp_bind_affinity
Add comments for smp_bind_affinity, And fixed some comment issues in smp_affinity_pri2_tc.

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-11-26 22:51:25 +08:00
Tm-C-mT cafd9c6dfe [docs][utest]:Add comments for smp_affinity_pri2
Add comments for smp_affinity_pri2

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-11-26 22:51:25 +08:00
Tm-C-mT ea37d4c2c9 [docs][utest]:Add comments for smp_affinity_pri1
Add comments for smp_affinity_pri1

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-11-26 22:51:25 +08:00
Chuan af6e310b61 docs(utest):Add standardized documentation for Mailbox Test
Signed-off-by: ChuanN-sudo <fjchuanil@gmail.com>
2025-11-23 15:14:14 +08:00
4444x 4e7a78ee0b [docs]:Add standardized function comment blocks for mutex_tc 2025-11-22 10:10:32 +08:00
R b b666 25e98bd3f2
[utest]Refactor object_tc.c, add stress and error-path coverage (#10961) 2025-11-21 11:01:36 +08:00
Tm-C-mT 573c5489fa [docs][utest]:Add explanatory comments for the utest of thread allocation for idle harts
Add explanatory comments for the utest of smp_assigned_idle_cores.

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-11-19 16:15:47 +08:00
Tm-C-mT 9308564a92 [utest]: Modify the utest logic for thread allocation of idle harts
Currently, this utest cannot determine whether threads are evenly distributed
across idle harts by observing the result of list_thread(). This is because
the presence of rt_thread_delay(5); causes all other threads to be in the
suspended state when thread information is printed. For example, if RT_CPUS_NR=4,
T0 executes list_thread() to print information, while T1~T3 are in hibernation
and thus it is impossible to observe which hart they are running on.

Solution:Here, the completion judgment condition has been modified. For example,
when RT_CPUS_NR=4, only RT_CPUS_NR-1 threads will be created (i.e., T0 to T2),
because running the utest occupies one hart. The execution is judged as completed
when finish_flag=0x0007, and the thread running the utest will call list_thread()
to print the information. Observe whether T0 to T2 are running on different
harts simultaneously.

Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
2025-11-19 16:15:47 +08:00
Copilot 45f2246f73
[Kernel][Object] Remove object name assertions, use rt_strncpy for safe truncation #10943 2025-11-19 14:10:43 +08:00
Ze-Hou 75f1d8d0dc feature: utest: add standardized utest documentation to messagequeue_tc
Signed-off-by: Ze-Hou <yingkezhou@qq.com>
2025-11-19 10:49:17 +08:00
Ze-Hou c745319c56 feature: utest: add standardized utest documentation to timer_tc
Signed-off-by: Ze-Hou <yingkezhou@qq.com>
2025-11-19 10:23:34 +08:00
R b b666 59e55f543c
[utest]Fixed assertion failure in the smp_affinity_pri2_tc use case caused by improper priority configuration. (#10956) 2025-11-18 18:02:03 +08:00
Rbb666 e484f56b6c [utest]Fixed assertion failure in the smp_affinity_pri1_tc use case caused by improper priority configuration. 2025-11-18 17:22:43 +08:00
David Frisbee 6073c22164
[docs]utest]:Add standardized utest documentation to atomic_tc and mtsafe_kprint_tc #10945 2025-11-18 17:22:03 +08:00
Rbb666 0af3b3eec1 [utest]Fixed compilation warning issues in smp/smp_affinity_prix_tc. 2025-11-18 16:57:43 +08:00
Ze-Hou de784f7cf2 feature: utest: add standardized utest documentation to event_tc
Signed-off-by: Ze-Hou <yingkezhou@qq.com>
2025-11-18 09:47:46 +08:00
David Frisbee 4103870b74
[fix][utest] correct spelling of 'pref_test' to 'perf_test' (#10937)
* [fix][utest] correct spelling of ''pref_test' to 'perf_test'
2025-11-17 16:40:00 +08:00
Copilot 30e1e5e9dc
Reorganize Group names in build system for clarity and IDE integration #10923 2025-11-16 11:40:53 +08:00
CYFS 92377190ba [docs][utest]:Add standardized utest documentation block for slab_tc 2025-11-14 23:32:08 +08:00
CYFS b53293863d [docs][utest]:Add standardized utest documentation block for object_tc 2025-11-14 12:44:52 +08:00