# FreeRTOS TRACE\_FACILITY

**URL:** <https://forums.freertos.org/t/freertos-trace-facility/14592>\
**Category:** Kernel\
**Created:** [March 2, 2022, 7:54pm UTC](https://forums.freertos.org/t/freertos-trace-facility/14592 "2022-03-02T19:54:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kishor](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@Kishor](https://forums.freertos.org/u/Kishor)\
**Post date:** [March 2, 2022, 7:54pm UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/1 "2022-03-02T19:54:37Z")

</div>

Hi all,  
I am trying to use trace facility of FreeRTOS.  
please refer my configuration as below picture “FreeRTOSConfig.h”

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/5/58345b93c4924fcc8167100a38448f21b71b4ced.png)

Definition in main.c

```
 void RTOS_AppConfigureTimerForRuntimeStats(void)
 {
         RTOS_RunTimeCounter = 0;
 }

 uint32_t RTOS_AppGetRuntimeCounterValueFromISR(void)
 {
     return RTOS_RunTimeCounter++; /* increment runtime counter */
  // return RTOS_RunTimeCounter;
 }

```

vTaskGetRunTimeStats call as shown in below pic in one of the task which is executing with configured period.

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/4/4df0feeac329a51168a97e2b521e5003f5f4dc7d.png)

Can you please tell me how to view all task statistics as explained inhttps://www.freertos.org/rtos-run-time-stats.html

Regards,  
Kishor

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 2, 2022, 8:39pm UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/2 "2022-03-02T20:39:18Z")

</div>

The text is in cBuffer, which you can view or print out. If you want binary data then use [RTOS - uxTaskGetSystemState()](https://www.freertos.org/uxTaskGetSystemState.html) instead.

Also, your “get counter value” function is just incrementing a variable, whereas it should be returning the current count of a hardware timer, or at least a fast periodically incrementing variable.

---

<div class="post-metadata">

**Author:** ![Kishor](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@Kishor](https://forums.freertos.org/u/Kishor)\
**Post date:** [March 2, 2022, 10:29pm UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/3 "2022-03-02T22:29:36Z")

</div>

Thank you for reply,  
I have no idea how to convert this buffer in to readable format.

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/7/745e4fcf26f1419aeb35bf9f02c2c3935e94fa0f.png)

In the example it shows in much simple format as below

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/1/133ea1f628f3084d570ab0d10ff31fc19ced661c.png)

Can you please guide me how can I get the data as shown in example image?

Regards,  
Kishor

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [March 3, 2022, 12:07am UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/4 "2022-03-03T00:07:45Z")

</div>

Do you have `printf`? If yes, you can do `printf("%s", cBuffer)`?

---

<div class="post-metadata">

**Author:** ![Kishor](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@Kishor](https://forums.freertos.org/u/Kishor)\
**Post date:** [March 4, 2022, 9:47am UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/5 "2022-03-04T09:47:18Z")

</div>

Thank you very much for the reply I will check this option,  
Regards,  
Kishor

---

<div class="post-metadata">

**Author:** ![Kishor](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@Kishor](https://forums.freertos.org/u/Kishor)\
**Post date:** [March 15, 2022, 3:51am UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/6 "2022-03-15T03:51:53Z")

</div>

The printf does not work. The question remain same how can I get buffer of unsigned Char in to a format which shown in RTOS example with Abs and %Time?

Regards,  
Kishor

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 15, 2022, 4:32am UTC](https://forums.freertos.org/t/freertos-trace-facility/14592/7 "2022-03-15T04:32:54Z")

</div>

Can you elaborate on “printf doesn’t work. If you call printf(“hello”) does hello print out? If not then it sounds like printf is not directing the output to wherever you want it to go, so you would need to fix that first.
