RTEMS | CPU Usage api (!864)
Sam Price (@TheSamPrice)
gitlab at rtems.org
Sun Feb 15 01:06:09 UTC 2026
Sam Price commented on a discussion on cpukit/include/rtems/cpuuse.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/864#note_142780
> /* Forward declaration */
> struct rtems_printer;
>
> +/**
> + * @brief CPU usage snapshot.
> + *
> + * One instance describes a single thread's CPU usage at the time a sample is
> + * taken.
> + */
> +typedef struct {
> + /** Thread identifier for the record. */
> + rtems_id id;
> + /**
> + * CPU time this thread has consumed since the last reset. Use together with
The units would be defined in the struct Timestamp_Control task_total;
To get real units you would need to use the helper functions.
I guess these are internal helper calls because they are prefixed with _
```
| static __inline__ time_t | _Timestamp_Get_seconds (const Timestamp_Control *_time) |
|-----------------------------|----------------------------------------------------------------|
| | Gets seconds portion of timestamp. More... |
| | |
| static __inline__ uint32_t | _Timestamp_Get_nanoseconds (const Timestamp_Control *_time) |
| | Gets nanoseconds portion of timestamp. More... |
| | |
| static __inline__ uint64_t | _Timestamp_Get_as_nanoseconds (const Timestamp_Control *_time) |
| | Gets the timestamp as nanoseconds. More... |
```
Please advise on how you want units handled.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/864#note_142780
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260215/ca473ad7/attachment-0001.htm>
More information about the bugs
mailing list