-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add Trace Hook Macros and function that returns the start of the stack. #659
Conversation
tasks.c
Outdated
@@ -1708,6 +1708,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) | |||
mtCOVERAGE_TEST_MARKER(); | |||
} | |||
|
|||
traceMOVED_TASK_TO_SUSPENDED_LIST(pxTCB); |
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 macro needed? A few lines earlier is the traceTASK_SUSPEND(pxTCB) macro (line 1688) So we already know that the function is called and the task is being suspended. Is it necessary to know that the suspension is happening 23 lines of code later?
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.
I agree this macro is not necessarily needed.
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.
traceMOVED_TASK_TO_SUSPEND_LIST seems redundant to traceTASK_SUSPEND.
include/task.h
Outdated
* | ||
* @return A pointer to the start of the stack. | ||
*/ | ||
uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) PRIVILEGED_FUNCTION; |
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 can get this information using vTaskGetInfo API -
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.
I agree. Removed it from the patchset.
Removed it from the patchset. |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #659 +/- ##
=======================================
Coverage 94.35% 94.35%
=======================================
Files 6 6
Lines 2446 2446
Branches 598 598
=======================================
Hits 2308 2308
Misses 85 85
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
FreeRTOS.h is failing uncrustify. Please take a look so we can wrap this PR up. |
@@ -94,7 +94,7 @@ | |||
|
|||
#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) ) | |||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) | |||
#define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired != pdFALSE ) portYIELD(); } while( 0 ) | |||
#define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired != pdFALSE ) { traceISR_EXIT_TO_SCHEDULER(); portYIELD(); } else { traceISR_EXIT(); } } while( 0 ) |
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.
Nit only - I wonder if this could result in confusion when reading the resultant trace if the interrupts is preempted between the execution of the trace macro and the portYIELD.
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.
https://www.freertos.org/rtos-trace-macros.html and the reference manula also needs updating to document the new macros - which the PR author can't do themselves.
Good point. |
Hey @conara, thanks for submitting this pull request! I wanted to reach out and ask if you wanted some help with closing out this PR? Or if you had planned on responding to the feedback and closing it out yourself? |
Hi @RichardBarry |
Thank you so much for helping me finalize my PR! Due to vacation I forgot this pull request. If I can help, let me know! |
Just a concern here, why the Cortex-M7 port layer is being updated but no others. The M7 port is only for r0p1 cores which contain a bug - all other core versions should use the M4F port. From, |
The website has been updated to reflect the changes
Add trace hook macro for most ports In pull request #659 we introduced better support for tracing tools like systemview. This patchset adds support for more ports as requested in the original pull request.
Add Trace Hook Macros and function that returns the start of the stack.
The purpose of this pull request is to provide better support for tracing tools such as systemview. Some time ago I made a post on the FreeRTOS forum describing the current problem: https://forums.freertos.org/t/add-additional-tracing-functionality-to-kernel/16513 . This patchset adds a few new trace hooks that can be used by trace tools such as systemview. For now, I've only added support for the Cortex-M7 port, but if the change is a good improvement, I can add support for other ports. Note that this patch set is heavily inspired on the deprecated SystemView patch set.
Test Steps
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.