RTEMS | perioduse needs updated to use _Thread_Get_name (#5720)

Sam Price (@TheSamPrice) gitlab at rtems.org
Sun Aug 23 03:56:50 UTC 2026




Sam Price commented: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5720#note_157751


@vijay Did you say you wanted to work this?

I would compare cpuuse vs perioduse on how they print names.
Also i am not sure where 38 came from for the string length.  I feel like that should be a #define 

I ran into this when trying to use the rate monotonic commands, but all of the CFS threads use the posix set name rather than the legacy name.

Briefly looking there is a dynamic printf * that I have never gotten to use.
```c
#define THREAD_NAME_SIZE 38 <- Not sure if this name exists or is named something else.

rtems_printf(
  printer,
  "  ID   %*s COUNT MISSED      CPU TIME         WALL TIME\n"
  "       %*s              MIN/MAX/AVG        MIN/MAX/AVG\n",
  THREAD_NAME_SIZE,
  "OWNER",
  THREAD_NAME_SIZE,
  ""
);

Or macro tricks

#define STRINGIFY_(x) #x
#define STRINGIFY(x) STRINGIFY_(x)

rtems_printf(
  printer,
  "  ID   %" STRINGIFY(THREAD_NAME_SIZE) "s COUNT MISSED   "
  "   CPU TIME         WALL TIME\n"
  "       %" STRINGIFY(THREAD_NAME_SIZE) "s              "
  "   MIN/MAX/AVG        MIN/MAX/AVG\n",
  "OWNER",
  ""
);
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5720#note_157751
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/5-59ydwxqzynjvfrcfvmunc14ns-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260823/4c0d29ce/attachment-0001.htm>


More information about the bugs mailing list