FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

Add traceQUEUE_SEND{_FROM_ISR,}_EXT and traceQUEUE_RESET hooks. #1062

Closed schilkp closed 1 month ago

schilkp commented 1 month ago

Description

The current hooks were not effective at allowing a tracer to track the number of items in a queue, since it could not differentiate between a queueOVERWRITE, queueSEND_TO_BACK, and queueSEND_TO_FRONT send, and could not (efficiently) trace a queue reset.

For sends, this adds extended tracing macros that, if not implemented, fall back on the original tracing macros for backwards compatibility, and introduces a new traceQUEUE_RESET hook.

Discussed here: https://forums.freertos.org/t/queue-tracing/20054/4

Test Steps

No unit test regressions. My work-in-progress tracer can access the required information.

Checklist:

I am not aware of any tracing test infrastructure, but would be happy to update it if it is pointed out to me.

Similarly if there is any documentation that I can work on updating, please let me know and I am happy to do so.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

schilkp commented 1 month ago

@aggarg Sorry I seem to have removed your suggestions when fixing the uncrustify fails. They are incorporated now.

I wasn't aware that your commits would somehow end up on my fork/could get overwritten when I force-pushed to my own fork.

For the record: https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/faa28781602152624b588711bec9dba7a5fd5599

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.31%. Comparing base (8c49c54) to head (c72f612). Report is 33 commits behind head on main.

Files Patch % Lines
queue.c 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1062 +/- ## ========================================== - Coverage 93.00% 92.31% -0.69% ========================================== Files 6 6 Lines 3200 3228 +28 Branches 879 886 +7 ========================================== + Hits 2976 2980 +4 - Misses 111 132 +21 - Partials 113 116 +3 ``` | [Flag](https://app.codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/pull/1062/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreeRTOS) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/pull/1062/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreeRTOS) | `92.31% <75.00%> (-0.69%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreeRTOS#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

aggarg commented 1 month ago

@schilkp As per our discussion here, should I close this PR?

schilkp commented 1 month ago

@schilkp As per our discussion here, should I close this PR?

Yes please go ahead. This will be folded into a different PR.

Thanks!