feat(process): 实现进程与线程CPU时间统计及clock_nanosleep支持#1517
Merged
fslongjin merged 2 commits intoDragonOS-Community:masterfrom Dec 20, 2025
Merged
feat(process): 实现进程与线程CPU时间统计及clock_nanosleep支持#1517fslongjin merged 2 commits intoDragonOS-Community:masterfrom
fslongjin merged 2 commits intoDragonOS-Community:masterfrom
Conversation
Member
fslongjin
commented
Dec 20, 2025
- 新增ProcessCpuTime结构体,用于统计用户态、内核态及总执行时间
- 为PCB添加cputime_wait_queue,支持CLOCK_PROCESS/THREAD_CPUTIME_ID的clock_nanosleep
- 在调度器CPU时间统计中增加CPU-time等待队列唤醒逻辑
- 扩展clock_gettime和clock_nanosleep系统调用,支持进程和线程CPU时间时钟
- 添加PosixTimeSpec::from_ns方法,便于从纳秒创建时间规格
- 更新测试白名单,添加clock_nanosleep_test
- 新增ProcessCpuTime结构体,用于统计用户态、内核态及总执行时间 - 为PCB添加cputime_wait_queue,支持CLOCK_PROCESS/THREAD_CPUTIME_ID的clock_nanosleep - 在调度器CPU时间统计中增加CPU-time等待队列唤醒逻辑 - 扩展clock_gettime和clock_nanosleep系统调用,支持进程和线程CPU时间时钟 - 添加PosixTimeSpec::from_ns方法,便于从纳秒创建时间规格 - 更新测试白名单,添加clock_nanosleep_test Signed-off-by: longjin <longjin@DragonOS.org>
Member
Author
|
@claude review this PR in Chinese |
|
Claude finished @fslongjin's task in 4m 19s —— View job PR #1517 代码审查待办事项:
审查总结✅ 实现质量优秀本PR实现了进程与线程CPU时间统计及 🔍 关键实现细节
|
- 在`process_cputime_ns`中添加对无效线程组关系的防御性回退和日志记录 - 为`thread_cputime_ns`添加原子操作顺序的注释说明 - 新增多线程CPU时间测试程序,验证进程CPU时间累加线程时间的功能 Signed-off-by: longjin <longjin@DragonOS.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.