Re: Another question

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

 



On 6/16/05, Arlen Nascimento <arlen.nascimento@xxxxxxxxx> wrote:
> Ok, in the kernel, no problem :)
> I'd like to get some time that tasks take, e.g.: cpu execution time,

Ok, this can be tricky on some level, since determining the time can
add to the execution time :) But the easiest way, which is imprecise,
is to compare jiffies at the beginning of the execution to the end.
Divide that number by HZ and you have an approximate number of
seconds.

You can also use rdtscl() to store the tsc value before and after
execution, which should be more precise. The value stored by rdtscl()
is in cycles, though, so you will have to use the value in
/proc/cpuinfo to convert to time.

> how much time a process, already ready, waits to be executed and so on 

Similar means should be possible for this, as well. Are you debugging
an issue? Or, just curious?

Thanks,
Nish

--
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