2021-07-28 12:58:44

by Shivank Garg

[permalink] [raw]
Subject: /proc/pid/sched units

Hi Everyone,

I'm analyzing the cpu time taken ("se.sum_exec_runtime" in
/proc/$pid/sched) by process in different configurations for my
project work. But I was not able to get the time units for the values
displayed in the file. I tried searching it in source code -
kernel/sched/cputime.c,include/linux/sched.h etc. but it left me more
confused.

Can you please answer me about the measurement units (is it
microseconds, nanoseconds, jiffles ...) ?

Also, I was not able to find proper documentation for /proc/pid/sched.
Please point to me if it's already there. If not, I would love to
contribute toward documenting these variables. It would be very
helpful for newbies (like me) in future.

Thanks,
Best Regards,
Shivank Garg


2021-07-28 13:15:26

by Matthew Wilcox

[permalink] [raw]
Subject: Re: /proc/pid/sched units

On Wed, Jul 28, 2021 at 06:26:44PM +0530, Shivank Garg wrote:
> Hi Everyone,
>
> I'm analyzing the cpu time taken ("se.sum_exec_runtime" in
> /proc/$pid/sched) by process in different configurations for my
> project work. But I was not able to get the time units for the values
> displayed in the file. I tried searching it in source code -
> kernel/sched/cputime.c,include/linux/sched.h etc. but it left me more
> confused.

include/linux/sched/types.h: * @sum_exec_runtime: total time spent on the CPU, in nanoseconds

why did that leave you more confused?