Skip to main content
MStew.1
Associate III
February 26, 2023
Solved

Trace Hook Macros in Azure RTOS ThreadX

Hello,

I worked until now with FreeRTOS. And in FreeRTOS there are Trace Hook Macros.

Is there an equivalent on Azure RTOS ThreadX?

Trace hook macros on FreeRTOS are a very powerful feature that permit you to collect data on how your embedded application is behaving.

Key points of interest within the FreeRTOS source code contain empty macros that an application can re-define for the purpose of providing application specific trace facilities. The application need only implement those macros of particular interest - with unused macros remaining empty and therefore not impacting the application timing

Specifically I am looking for:

traceTASK_SWITCHED_IN()

Called after a task has been selected to run. At this point pxCurrentTCB contains the handle of the task about to enter the Running state.

traceTASK_SWITCHED_OUT()

Called before a new task is selected to run. At this point pxCurrentTCB contains the handle of the task about to leave the Running state.

I looked at the Azure RTOS documentation but could not find this similar feature?

This topic has been closed for replies.
Haithem Rahmani
Haithem RahmaniBest answer
ST Employee
February 26, 2023

Hi @MStew.1​ 

In ThreadX there is the following API that offers similar functionality.

https://learn.microsoft.com/en-us/azure/rtos/threadx/chapter4#tx_thread_entry_exit_notify

regards

Haithem.

2 replies

Haithem Rahmani
Haithem RahmaniBest answer
ST Employee
February 26, 2023

Hi @MStew.1​ 

In ThreadX there is the following API that offers similar functionality.

https://learn.microsoft.com/en-us/azure/rtos/threadx/chapter4#tx_thread_entry_exit_notify

regards

Haithem.

MStew.1
MStew.1Author
Associate III
February 26, 2023

Thank you very much, I will look into this API