FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2013 Threads] Bug fix - runtime statistics collectionPosted by Philip Pemberton on August 14, 2013 Hi, There appears to be a bug in FreeRTOS 7.5.2's tasks.c. If a FreeRTOS application enables runtime statistics and defines the portALT_GET_RUN_TIME_COUNTER_VALUE macro but does not provide the portGET_RUN_TIME_COUNTER_VALUE function, tasks.c will fail to link (or possibly fail to compile at all, depending on compiler warning/error promotion options). To fix this, replace the following code block in tasks.c: #if ( configGENERATE_RUN_TIME_STATS == 1) { if( pulTotalRunTime != NULL ) { *pulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE(); } } #else
With this: #if ( configGENERATE_RUN_TIME_STATS == 1) { if( pulTotalRunTime != NULL ) { #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE portALT_GET_RUN_TIME_COUNTER_VALUE( *pulTotalRunTime ); #else *pulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE(); #endif } } #else
Thanks, Phil.
RE: Bug fix - runtime statistics collectionPosted by Philip Pemberton on August 14, 2013 Just had a dig through SVN. Looks like this was introduced in rev 1960 (FreeRTOS 7.4.2 probably didn't have this bug, but 7.5.0 certainly did):
http://freertos.svn.sourceforge.net/viewvc/freertos/trunk/FreeRTOS/Source/tasks.c?r1=1959&r2=1960&
The proverbial "smoking gun" is at Line 1489. Note that rev 1959 contains an ifdef to check whether the portALT_GET_RUN_TIME_COUNTER_VALUE macro is declared and uses the aforementioned macro if it is. Failing that, it falls back to using portGET_RUN_TIME_COUNTER_VALUE. The replacement code on the right (line 1491 onwards) does not contain this ifdef and thus introduces a bug.
RE: Bug fix - runtime statistics collectionPosted by Richard on August 14, 2013 Thank you for taking the time to report this.
I have committed the fix to SVN and added a note with a link to the fix in the "known issues" list.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|