Skip to content

tests/bench_ztimer: add port of bench_xtimer#17391

Merged
fjmolinas merged 1 commit intoRIOT-OS:masterfrom
kaspar030:add_bench_ztimer
Dec 14, 2021
Merged

tests/bench_ztimer: add port of bench_xtimer#17391
fjmolinas merged 1 commit intoRIOT-OS:masterfrom
kaspar030:add_bench_ztimer

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

Contribution description

This is a straight-forward conversion of bench_xtimer to ztimer.
It's using ZTIMER_MSEC by default.
This is very nice to expose the cost of synchronization, e.g., for the rtt on samr21-xpro.

Probably the memory blacklist needs to be updated...

Testing procedure

Issues/PRs references

@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 14, 2021
@github-actions github-actions bot added Area: doc Area: Documentation Area: tests Area: tests and testing framework labels Dec 14, 2021
Copy link
Copy Markdown
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

Some comments, lets see what Murdock says

@kaspar030
Copy link
Copy Markdown
Contributor Author

yeah, I did a s/xtimer/ztimer/ now :)

*
*/
before = ztimer_now(ZTIMER_USEC);
_base = BASE - (before - start);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the idea behind this?? Its dynamically changing the offest as the test progresses, this makes some timers trigger unexpectedly depending on how long the test took

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BASE is supposed to be set way in the future, so that during the test, no timer actually triggers.
That's verified by expect(!triggers) throughout the test.

#endif

#ifndef BASE
#define BASE (100000LU)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
#define BASE (100000LU)
#define BASE (1000000LU)

Without this with frdm-kw41z I actually have it triggering early...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've increased to 10000000 (10 million). It just has to be far enough in the future to never trigger.

@fjmolinas
Copy link
Copy Markdown
Contributor

Please squash!

Copy link
Copy Markdown
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

ACK!

@fjmolinas fjmolinas merged commit f88ee8c into RIOT-OS:master Dec 14, 2021
@kaspar030 kaspar030 deleted the add_bench_ztimer branch December 14, 2021 22:43
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants