Parameters for traceCREATE_COUNTING_SEMAPHORES
I am busy putting together a set of traceXXXX macros covering the whole
scope of functions. Essentially I am mapping all functions into 3
different categories being:
vFreeRTOSTraceTASK(): all task related functions
vFreeRTOSTraceQUEUE(): queue, mutex and semaphore
vFreeRTOSTraceTIMER(): timer related functions
Within each of the functions I am just streaming max 8 character string
(built compact just identifying the object and event) as fast and direct
as possible to the UART.
What I have noticed is that with counting semaphores, no parameter is
passed. When compared with queues and mutexes, I would have assumed
passing the xHandle value would make sense. Am I missing something, a
reason why nothing is passed?
Rgds
Andre
Parameters for traceCREATE_COUNTING_SEMAPHORES
Some of the macros were updated to accommodate the specific needs of the FreeRTOS+Trace tool, so it might be related to that.
Can you give a specific example of a queue trace macro that does include the paraemter, and a mutex macro that doesn’t include the parameter, so I may be able to give a more specific answer.
Regards.
Parameters for traceCREATE_COUNTING_SEMAPHORES
As an example, have a look at calling of:
traceCREATEMUTEX(pxNewQueue)
vs
traceCREATECOUNTING_SEMAPHORE()
Would it not make sense to provide the xHandle as parameter to identify the semaphore?
Parameters for traceCREATE_COUNTING_SEMAPHORES
I would agree it is probably sub-optimal.
In the case of a counting semaphore more than one trace macro is
invoiced, first the macros in xQueueGenericCreate() [which is itself
called by xQueueCreateCountingSemaphore()] and then
traceCREATECOUNTINGSEMAPHORE() – so presumably the handle is already
known from when xQueueGenericCreate() was called.
You can still obtain the handle, but you would need to look at the code
to see what the handle was called at the point the macro was called. In
the case highlighted it is simply “xHandle”.
Just looking at the macro definitions used by FreeRTOS+Trace (which are
in /FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h) it
appears traceCREATECOUNTINGSEMAPHORE() is not used – so maybe that is
why it never had the parameter?
Regards.
Parameters for traceCREATE_COUNTING_SEMAPHORES
As an aside, I’m not sure a serial port would be sufficiently fast to
stream data at the rate a running application would generate it.
Regards.
Parameters for traceCREATE_COUNTING_SEMAPHORES
Currently running UART at 961.2k, and limiting the specific macros enabled to limit output volume, works reasonably for th exceptions I need to track.
Next step will be to provide support for GPIO pin status, mainly to track task switching on a logic analyser.
I can then mix the 2 output mechanisms based on the nature of the trace..