-
Notifications
You must be signed in to change notification settings - Fork 619
apps/examples/power: Add cpu usage 100 test #7037
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
base: master
Are you sure you want to change the base?
Conversation
7522e28 to
2671e3d
Compare
The power consumption is effected by CPU usage. To measure power consumption according to CPU status, Add an app that makes the usage of each CPU 100%. Signed-off-by: eunwoo.nam <eunwoo.nam@samsung.com>
2671e3d to
78676a0
Compare
allen-kim-sec
left a comment
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.
looks good to me
| clock_t prev = clock(); | ||
| clock_t now; | ||
|
|
||
| #ifdef CONFIG_SMP |
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.
Is this config checking necessary?
If we execute the codes below with the config disabled, what happen?
| CPU_ZERO(&cpuset); | ||
| CPU_SET(cpu_id, &cpuset); | ||
|
|
||
| if (pthread_setaffinity_np(this_thread, sizeof(cpu_set_t), &cpuset) != 0) { |
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.
Is it possible to change assigned cpu at running by itself??
|
|
||
| is_running = false; | ||
|
|
||
| } else if (strncmp(argv[1], "cpu", 8) == 0) { |
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.
It should be 4, not 8
The power consumption is effected by CPU usage.
To measure power consumption according to CPU status, Add an app that makes the usage of each CPU 100%.