-
Notifications
You must be signed in to change notification settings - Fork 20
Fix yield test and remove few compile warnings #14
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: main
Are you sure you want to change the base?
Conversation
|
||
for (i = 1; i <= ITERATIONS; i++) { | ||
gather_set1_stats(MAIN_PRIORITY, i); | ||
bench_collect_resources(); |
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 right? The ancillary thread should never run, so it never adds itself to the "remove list".
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.
As @edersondisouza pointed out, the ancillary thread should never run. If it is actually running then the test is not working as intended and further investigation would be needed. The presence of bench_collect_resources()
would then be hiding a problem.
|
||
/** | ||
* @brief Special ISR used to measure irq latency | ||
*/ |
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.
For the commit message: you give a more detailed description of the issue on the PR message - could you please add that info to the commit message? It's better to have more information in it.
|
||
for (i = 1; i < ITERATIONS; i++) { | ||
gather_set2_stats(MAIN_PRIORITY, i); | ||
bench_collect_resources(); |
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.
Even here, IIUIC, the ancillary thread (bench_set2_helper
) doesn't ever get to the bench_thread_exit()
, it's aborted before - am I missing something?
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.
My debugging shows that bench_thread_exit is called 1000times (or ITERATIONS times). Which effectively leads to buffer overflow. (I used different FreeRTOS_config.h than the one provided)
I have followed how other tests were organized - gather_xx_stats, bench_collect_resources. When this same template was applied on the failing test, it started to work. I have not analyzed how gather_set[12]_stats works for the yield test.
The test framework should not assume what bench does on the inside.
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.
You indicated that a different configuration file was used. Can you identify the key differences?
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.
The issue occurs when configUSE_TIME_SLICING
is defined 1 in FreeRTOSConfig.h . The bench_set2_helper()
will run into bench_thread_exit()
after the time slice of bench_thread_yield()
is used up.
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.
Nice catch, I didn't notice this option, as it was not in my config file and defaults to being enabled by default. I didnt have enough time to get back to testing this.
This PR fixes yield test with FreeRTOS.
This PR also does some cleaning: