-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[components][finsh] add cputh cmd #8091
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉那几个weak函数的实现并不是完全合适的。另外,关于cpu usage,应该有软件包了的吧(不完全确定)。cpu usage实现了,放软件包中也挺好的
|
rtt的package中确实有一个cpu_usage,可以显示cpu的总体使用率,范围大概从0~100。 |
可以一样的放到软件包中;选择、编译了软件包后,命令也会自动导出到msh中。 |
单独放到软件包里很多人都不知道这个功能,是不是把结果集成到 ps / list thread 命令里,这样更加方便呀 |
如果放在软件包中,是否要关闭这个PR,然后重新提交。我看到软件包只有索引,不包含代码 |
我建议可以放在 RTT utilities 里,而且最好不要占用各种系统 hook 。避免开启这个功能,导致系统 hook 没法被其他软件包使用 |
👌 那么可以完善好一套易用的cpu usage出来吧 |
集成到ps命令里不太方便,目前的实现方法需要经过指定的时间后才能计算统计结果,会影响ps的显示 |
是指路径rt-thread\components\utilities?目前的实现方法必须要使用rt_scheduler_hook这个系统hook。或者我们增加一个额外hook供cpuusage使用? |
PS 效果可以参考 ucos 。hook 去掉后,可以直接在调度器源码位置加代码,通过宏隔离 |
加入内核的话 是不是得考虑smp的场景也加进来 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
增加cpu使用率的功能,能够方便的查看每个线程在单位时间内的cpu使用率
你的解决方案是什么 (what is your solution)
在什么测试环境下测试通过 (what is the test environment)
使用at32f437-starter开发板和stm32f429-atk-apollo开发板测试通过
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up