Re: Time statistics of process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Michel,

I think I can handle this one, despite my current lack of knowledge..
Let me see if I can provide a better explanation..

This is a structure that contains information about scheduling, for a
single process, by the look of it.

cpu_time gives a measure of the amount of time the process has spent
running on the given cpu (Presumably there's one of these structures for
each cpu, for each process).  That's probably given in jiffies or
something, I dunnno =)

run_delay gives the amount of time spent waiting for access to the given
cpu, in order to run (in a blocked/sleeping state, as it were) - That
means, run_delay + cpu_time gives the total real time that process has
existed, presumably.

pcnt gives the number of timeslices that the process has had on the cpu
(A timeslice is a period of time that a process is allowed to run,
before surrendering the CPU to another process.. The amount of time is
given by the TIMESLICE constant, and it's implemented by using a timer
IRQ set to that amount of time).

last_arrival is, as the comments say, the last time the process had the
CPU.  It's probably in jiffies or something too.  Similarly, last_queued
gives a measure of how long it's been since the process was queued for
the CPU.  I don't know what this value would be when the process is
waiting for IO; It may just equal the last time the process was waiting,
and perhaps it would be updated once the IO completes, ready to run the
process again.

So how'd I do? =)

Have fun,


Mike


Michel Cunha wrote:
> Hi all,
> i need some help about the variables into struct sched_info. 
> 
> struct sched_info {
>          /* cumulative counters */
>         unsigned long   cpu_time,       /* time spent on the cpu */
>                         run_delay,      /* time spent waiting on a runqueue */
>                         pcnt;           /* # of timeslices run on this cpu */
> 
>         /* timestamps */
>         unsigned long   last_arrival,   /* when we last ran on a cpu */
>                        last_queued;    /* when we were last queued to run */
> };
> 
> I need to know what means this attributes into this struct. I am
> trying to understand what this comments wants to "say", therefore i
> could wish more explanation about them.
> 
> 
> Thanks a lot.
> 
> 

- --
Mike Tyson <mike@xxxxxxxxxxxxx>
M: (+61) 0407 754 124
W: http://tzidesign.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCvLSx/eih+gEb7pQRAkrJAJ4mAeyBFW2Jf0Se+OIcMUQC9OwfcQCfdzjz
P0roKlrcmkAnKvvpowBmUEE=
=9b9r
-----END PGP SIGNATURE-----

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux