RTEMS | Draft: add programmatic interface for data produced by cpuuse (!232)
Kinsey Moore (@opticron)
gitlab at rtems.org
Mon Oct 14 20:33:10 UTC 2024
Kinsey Moore commented on a discussion on cpukit/libmisc/cpuuse/cpuusagereport.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/232#note_113108
> +static bool cpu_usage_visitor( Thread_Control *the_thread, void *arg )
> +{
> + cpu_usage_context *ctx;
> + ctx = arg;
> + cpuuse_info * cpuuse_data;
> + cpuuse_data = ctx-> cpuuse_data;
> + _Thread_Get_name( the_thread, cpuuse_data->name, sizeof( cpuuse_data->name ) );
> + cpuuse_data->time_used_after_last_reset =
> + _Thread_Get_CPU_time_used_after_last_reset(the_thread );
> + _TOD_Get_uptime( &cpuuse_data->uptime );
> + _Timestamp_Subtract( &cpuuse_data->time_used_after_last_reset,
> + &cpuuse_data->uptime, &cpuuse_data->total );
> + _Timestamp_Divide( &cpuuse_data->time_used_after_last_reset,
> + &cpuuse_data->total, &cpuuse_data->ival, &cpuuse_data->fval );
> + cpuuse_data->seconds = _Timestamp_Get_seconds(
> + &cpuuse_data->time_used_after_last_reset );
I should have been more specific, 2 spaces beyond the current indentation level.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/232#note_113108
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/20241014/202e48a9/attachment-0001.htm>
More information about the bugs
mailing list