Skip to main content
Visitor II
February 26, 2023
Solved

Trace Hook Macros in Azure RTOS ThreadX

  • February 26, 2023
  • 1 reply
  • 1451 views

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.
    Best answer by Haithem Rahmani

    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.

    1 reply

    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.1Author
    Visitor II
    February 26, 2023

    Thank you very much, I will look into this API