Skip to content

FlashIAP: Add timing test #7383

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

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

davidsaada
Copy link
Contributor

Description

Add a timing test for FlashIAP erase and write operations.

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@0xc0170 0xc0170 requested a review from a team July 2, 2018 06:57
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2018

How is this testing timing ? there are few asserts that check return type. The timing is only informative via printf ?

@davidsaada
Copy link
Contributor Author

How is this testing timing ? there are few asserts that check return type. The timing is only informative via printf ?

The output of this test is indeed the information given to us via prints. Information we now gather, which can be a base for an extension of this test, in case we see outstanding results.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2018

The output of this test is indeed the information given to us via prints. Information we now gather, which can be a base for an extension of this test, in case we see outstanding results.

Is it that we would run CI, you would gather results and update this PR to actually set some acceptable timing range ?

@ARMmbed/mbed-os-test Please review

@davidsaada
Copy link
Contributor Author

Is it that we would run CI, you would gather results and update this PR to actually set some acceptable timing range ?

Indeed so. May add other tests, but this is the most reasonable outcome.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jul 2, 2018

Build : SUCCESS

Build number : 2496
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7383/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jul 2, 2018

@mbed-ci
Copy link

mbed-ci commented Jul 2, 2018

@davidsaada davidsaada force-pushed the david_flashiap_timing_test branch from 9118dae to 66152e6 Compare July 3, 2018 10:57
@davidsaada
Copy link
Contributor Author

Fixed a few bugs in calculations and pushed. @0xc0170 please rerun morph build.

@cmonr
Copy link
Contributor

cmonr commented Jul 5, 2018

@davidsaada Need someone from @ARMmbed/mbed-os-storage to OK this before we can start CI.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 10, 2018

Running CI to gather test data as previously requested

/morph build

@mbed-ci
Copy link

mbed-ci commented Jul 10, 2018

Build : SUCCESS

Build number : 2557
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7383/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jul 10, 2018

@cmonr
Copy link
Contributor

cmonr commented Jul 11, 2018

/morph export-build

@cmonr
Copy link
Contributor

cmonr commented Jul 11, 2018

Pinging @ARMmbed/mbed-os-storage again

@mbed-ci
Copy link

mbed-ci commented Jul 11, 2018

@cmonr
Copy link
Contributor

cmonr commented Jul 11, 2018

Is it that we would run CI, you would gather results and update this PR to actually set some acceptable timing range?

On hold, awaiting an update.

@davidsaada davidsaada force-pushed the david_flashiap_timing_test branch from 66152e6 to f9db073 Compare July 17, 2018 16:57
@davidsaada
Copy link
Contributor Author

Added timing acceptance checks.

@jamesbeyond
Copy link
Contributor

General speaking, we do not recommend the use of printf() inside GreenTea tests.
Since it is through mbed retargeting instead of GreanTea framework, the integrity of the GreenTea communication messages is not guaranteed.

We suggest using utest_printf() or greentea_send_kv() to send messages to the serial output, which will achieve the same results.
Also, those messages can be handled by host side test scripts if necessary.
@cmonr @davidsaada

@studavekar
Copy link
Contributor

In addition to @jamesbeyond comment, we should try to avoid greentea_send_kv() if KV pair is not consumed by green tea.

@davidsaada is there a way to reduce the traffic on uart as we have seen test failure because of it ref - IOTMORF-1861

@davidsaada
Copy link
Contributor Author

@davidsaada is there a way to reduce the traffic on uart as we have seen test failure because of it ref - IOTMORF-1861

Yes, Added a flash map print. Will remove it as it's not necessary for the test.

printf("Flash layout:\n");
while(address < end_address) {
sector_size = flash_device.get_sector_size(address);
printf("Address 0x%08x, size %6d\n", address, sector_size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we reduce the number of print for the test, we may hit similar issue to IOTMORF-1861

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 20, 2018

@jamesbeyond @studavekar Is this printf vs greentea kv / utest printf documented anywhere ? If not, can we add it. I've noticed this in some other tests also - often debug messages are left in tests.

@davidsaada davidsaada force-pushed the david_flashiap_timing_test branch from f9db073 to 57f4d05 Compare July 22, 2018 11:05
@davidsaada
Copy link
Contributor Author

Removed flash map prints.


if (num_write_sizes) {
avg_erase_time /= num_write_sizes;
printf("\nErase size %6u bytes: avg %10u, min %10u, max %10u (usec)\n\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still there are 3 prints that do not have any value until the test fails (if it fails, then printing erase size makes sense but only if it fails).

Can we remove all 3 printf from from this test case (move them to assert msg rather)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 I would like to keep these prints to monitor these times also on success tests. We suspect these times can change with wear of the flash. They will also help us to understand for every device the level of intrusiveness of NVStore and SOTP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood.

We suggest using utest_printf() or greentea_send_kv() to send messages to the serial output, which will achieve the same results.

@jamesbeyond Should these be updated to utest_printf() ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be updated to utest_printf() ?

We'd suggest to utest_printf() over printf(), unless they are not interchangeable. In your case, I think the outcome would be the same.
Because it is less risk of disturbing the greentea communication strings, especially greentea is busy polling on serial.

Is this printf vs greentea kv / utest printf documented anywhere ? If not, can we add it. I've noticed this in some other tests also - often debug messages are left in tests.

Sorry, we don't have a formal document about that. We will add one in.

@0xc0170 @davidsaada @dannybenor

@cmonr
Copy link
Contributor

cmonr commented Aug 2, 2018

@davidsaada Thoughts on @jamesbeyond' comment?

@davidsaada davidsaada force-pushed the david_flashiap_timing_test branch from 57f4d05 to 7cf5b3a Compare August 2, 2018 15:39
@davidsaada
Copy link
Contributor Author

Thoughts on @jamesbeyond' comment?

Sorry, this slipped me. Updated all the code to use utest_printf.

@cmonr
Copy link
Contributor

cmonr commented Aug 2, 2018

@davidsaada No worries, happens to all of us :)

@cmonr
Copy link
Contributor

cmonr commented Aug 2, 2018

@0xc0170 @jamesbeyond @studavekar Mind re-reviewing?

Copy link
Contributor

@studavekar studavekar left a 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.

@cmonr
Copy link
Contributor

cmonr commented Aug 2, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 2, 2018

Build : SUCCESS

Build number : 2728
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7383/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Aug 2, 2018

@mbed-ci
Copy link

mbed-ci commented Aug 2, 2018

@cmonr cmonr merged commit 8f7024a into ARMmbed:master Aug 3, 2018
@0xc0170 0xc0170 removed the needs: CI label Aug 3, 2018
@davidsaada davidsaada deleted the david_flashiap_timing_test branch August 22, 2018 09:09
pan- pushed a commit to pan-/mbed that referenced this pull request Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants