All of lore.kernel.org
 help / color / mirror / Atom feed
* Thread's CPU time
@ 2022-04-29 15:20 Giulio Moro
  2022-04-29 15:29 ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Giulio Moro @ 2022-04-29 15:20 UTC (permalink / raw)
  To: Xenomai Mailing list

Hi everyone,
 From /proc/xenomai/sched/stat I infer there must be an internal struct somewhere keeping track of how much CPU time is actually used by each thread. Is there any way to access this kind of statistics from a running Xenomai user space program without leaving primary mode and without attempting to read this file? I am implementing an infrastructure to measure the CPU time of a given block of code. Currently I am using Cobalt's clock_gettime(), but this only works reliably if the task does not get preempted or otherwise rescheduled between the two calls.

I have run this kind of tests offline before and that's all nice and good, but I am looking for a lightweight and non invasive way of benchmarking particular sections of large-ish programs with minimal modifications.

Thanks,
Giulio


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-02  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29 15:20 Thread's CPU time Giulio Moro
2022-04-29 15:29 ` Philippe Gerum
2022-05-02  9:42   ` Giulio Moro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.