-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
kernel: Add k_thread_runtime_stats_is_enabled function #80450
base: main
Are you sure you want to change the base?
Conversation
fc52903
to
075a033
Compare
70b4aa0
to
04e6d25
Compare
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.
Thanks for all of the POSIX clock work.
Just a question / suggestion regarding runtime function call overhead.
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.
Just some suggestions around CONFIG_POSIX_THREAD_CPUTIME
5302a73
to
e9323cc
Compare
I've made change, Please riewer again! |
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.
Kernel side seems reasonable to me.
@rruuaanng - needs a rebase again to resolve the merge conflict, but it would also be a good opportunity to add @ycsin's change request as well. |
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.
One more nitpick that I can't get past. But that's my only complaint, feel free to assume +1 once resolved.
cf17e92
to
bc2896f
Compare
1ac81f7
to
8966b7c
Compare
Add posix 'CLOCK_THREAD_CPUTIME_ID' support to measure the total CPU execution time of the current thread. Signed-off-by: James Roy <rruuaanng@outlook.com>
Add test for 'clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts)'. Signed-off-by: James Roy <rruuaanng@outlook.com>
Add 'k_thread_runtime_stats_is_enabled' function, whichs used to check whether runtime statistics collection is enabled for a thread. Signed-off-by: James Roy <rruuaanng@outlook.com>
Add test for 'k_thread_runtime_stats_is_enabled(tid)'. Signed-off-by: James Roy <rruuaanng@outlook.com>
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.
🥳
Add 'k_thread_runtime_stats_is_enabled' to 'usage.c', which's used to check whether runtime statistics collection is enabled for a thread.
It can determine whether the thread has enabled runtime statistics collection when the program is running. It allows users to add conditional statements based on this function when using it.
for example:
And it can provide a complete support when similar operations are needed. for example
enable
,disable
,is_enabled
.For example, its use in the implementation of CLOCK_THREAD_CPUTIME_ID actually lacks k_thread_runtime_stats_is_enabled, which makes the entire function impossible to implement safely. It is necessary.
..