Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Why is this information important in case of a short-living process? Please make sure there is no XY problem here. What actual problem are you trying to solve? Commented May 9, 2023 at 8:33
  • @KamilMaciorowski This could be useful in general. However, I edited the question adding more details. Commented May 9, 2023 at 8:42
  • I don't see where top shows the CPU "running" a process or thread. If a process is using 10% of a CPU, then 90% of the time no CPU is running it. top can show you the "Last used CPU", but with a warning that even asking is likely to alter the outcome across the whole system. For ps, the thread cumulative CPU time is found from the time between entry and exit of user mode (not continuously updated). CFS deals with variable time-slices, and longest appears to be capped at 0.006 secs, which means any separate process attempting to monitor is hopelessly lagging behind. Commented May 9, 2023 at 11:57