-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,4 +82,4 @@ int main(void) | |
|
||
return 0; | ||
} | ||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,6 +144,7 @@ static void gather_set1_stats(int priority, uint32_t iteration) | |
*/ | ||
void bench_thread_yield(void *arg) | ||
{ | ||
ARG_UNUSED(arg); | ||
uint32_t i; | ||
|
||
bench_timing_init(); | ||
|
@@ -164,6 +165,7 @@ void bench_thread_yield(void *arg) | |
|
||
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 commentThe 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 commentThe 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_stats_report_line("Yield (no context switch)", &time_to_yield); | ||
|
@@ -172,6 +174,7 @@ void bench_thread_yield(void *arg) | |
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Even here, IIUIC, the ancillary thread ( There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The issue occurs when There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
|
||
bench_timing_stop(); | ||
|
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.