-
Notifications
You must be signed in to change notification settings - Fork 3k
Add CPU stats for greentea tests #7294
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
Conversation
I like this! Do we have some way to measure tick counts and use the data as performance measurement? @0xc0170 |
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.
I -really- like this.
@studavekar Thoughts? |
@screamerbg I think the people that could best answer that are @SenRamakri and/or @deepikabhavnani |
Performance in terms of what? With the help of deep sleep / sleep comparison you can compare to see if deep sleep will help in battery saving (need to do some target specific analysis for that) - May be in future |
greentea_send_kv("__cpu_info up time", mbed_uptime()); | ||
greentea_send_kv("__cpu_info sleep time", mbed_time_sleep()); | ||
greentea_send_kv("__cpu_info deepsleep time", mbed_time_deepsleep()); | ||
greentea_send_kv("__cpu_info % sleep / deep", (mbed_time_sleep() * 100) / mbed_uptime(), (mbed_time_deepsleep() * 100) / mbed_uptime()); |
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.
(mbed_time_deepsleep() * 100) / mbed_uptime())
Not sure how useful this stat is, it says how much % time system spent in sleep since it was up. But will be interesting to see its result for different test application.
This would be a good addition to provide additional cpu information, It would useful for teams to check device sleep status during the test execution. 👍 |
/morph build |
Build : FAILUREBuild number : 2424 |
Darn. Looks like it's not going to be that simple and easy. @jeromecoutant, please take a look at the build failures. |
#if defined(MBED_CPU_STATS_ENABLED) | ||
static void send_CPU_info() | ||
{ | ||
greentea_send_kv("__cpu_info up time", mbed_uptime()); |
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.
mbed_uptime
, mbed_time_sleep
, mbed_time_deepsleep
are not API's. They are internal functions in Mbed OS.
Please use mbed_stats_cpu_get
to get all CPU related info
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.
@deepikabhavnani We might want to add that detail to the documentation? These functions are declared in power management header file - thus I would also use it . I do not see any internal detail mentioned there.
If they are internal, why are there declared then in the power m. header file (we got there _internal functions - intention is clear).
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.
@0xc0170 - I was not completely clear with my comment, those functions can be used if required. But since this PR is about adding CPU stats for testing it will be good to use actual API mbed_stats_cpu_get
and not the functions called by API.
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.
Understood . Still confusing to a user - which one to use? Is it fine as it is, all those functions exposed ?
@jeromecoutant Can you update to use mbed_stats_cpu_get
rather?
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.
User can use mbed_uptime just to know since when the system is up and running (ok to have public). mbed_stats_cpu_get will give all the cpu related information. We have plans to expand this API to have additional information and parts of which may not be in power management header file.
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.
We need to be clear about mbed_uptime vs mbed_stats.
@deepikabhavnani Please address the comment about those functions. Once done, this should be good to go
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.
@jeromecoutant Can you update to use mbed_stats_cpu_get rather?
35c9ddc
ebd8655
to
35c9ddc
Compare
@0xc0170 Update is done |
Considering that previous set was approved (similar to the current one, just one change there), starting CI /morph build |
Build : SUCCESSBuild number : 2471 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 2100 |
/morph export-build |
Exporter Build : FAILUREBuild number : 2103 |
Test : SUCCESSBuild number : 2248 |
/morph export-build |
Exporter Build : SUCCESSBuild number : 2109 |
Description
Here is a proposition to add CPU info at the end of each greentea tests.
[1529585766.11][CONN][RXD] {{__cpu_info up time;1779541}}
[1529585766.15][CONN][RXD] {{__cpu_info sleep time;4516}}
[1529585766.19][CONN][RXD] {{__cpu_info deepsleep time;931397}}
[1529585766.22][CONN][RXD] {{__cpu_info % sleep / deep;0;49}}
Pull request type