linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2004-03-15 22:49 Kevin Leung
  2004-03-15 23:26 ` your mail Richard B. Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Leung @ 2004-03-15 22:49 UTC (permalink / raw)
  To: linux-kernel

Hello All,

I am very new to Linux and am working on a project. The nature of the 
project is to essentially record all process/thread scheduling activity for 
use in a later application. I wanted to know if any experts out there knew 
of any libraries that could essentially "monitor" or "listen" for any 
scheduling changes made. For instance if the kernel decides to set process A 
from "sleeping" to "running" and process B from "running" to "sleeping", I 
wanted to know if there was a function that could generate an immediate 
notification of this event. Priority change information is also desireable. 
The more aspects which trigger notificaiton, the better. As a first attempt, 
I tried understanding the source code of the system monitor application. I 
gained some insight, but still have questions. Mainly questions pertaining 
to how the system monitor application receives the most "up-to-the-minute" 
information on what process are running, what processes are sleeping etc. I 
got stuck in the code and decided to explore another means.  Any advice or 
insight into the matter would be greatly appreciated. If a library isn't 
available, does anyone know the difficulty involved if I tried to modify the 
kernel to provide this information?

Please CC me the comments and responses posted to the list in response to my 
posting

Thank You in advance

_________________________________________________________________
Frustrated with dial-up? Lightning-fast Internet access for as low as 
$29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/


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

* Re: your mail
  2004-03-15 22:49 Kevin Leung
@ 2004-03-15 23:26 ` Richard B. Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard B. Johnson @ 2004-03-15 23:26 UTC (permalink / raw)
  To: Kevin Leung; +Cc: linux-kernel

On Mon, 15 Mar 2004, Kevin Leung wrote:

> Hello All,
>
> I am very new to Linux and am working on a project. The nature of the
> project is to essentially record all process/thread scheduling activity for
> use in a later application. I wanted to know if any experts out there knew
> of any libraries that could essentially "monitor" or "listen" for any
> scheduling changes made. For instance if the kernel decides to set process A
> from "sleeping" to "running" and process B from "running" to "sleeping", I
> wanted to know if there was a function that could generate an immediate
> notification of this event.

No. FYI, there are hundreds-of-thousands of such "events" per second
of operation! Basically, any time some task is waiting for I/O its
CPU is taken away and given to somebody else. This is what "sleeping"
usually means. Once the I/O completes, the task gets the CPU
again and that's what "running" means. If you were to instrument
these two state-changes for all tasks, it would certainly leave
only a new percent of CPU available for the tasks. This would
royally screw up the meaning of anything you were trying to
instrument.

> Priority change information is also desireable.

If you mean the dynamic priority that keeps changing until
the task is executed, no. If you mean priority like
'nice', you can instrument the sys-call.

> The more aspects which trigger notificaiton, the better. As a first attempt,

There is a kernel logging daemon that writes 'printk' messages. This
works by having a user-mode daemon open and read /proc/kmsg. You can
make a similar communications interface, using the existing daemon
as a template, that will instrument anything you want.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



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

end of thread, other threads:[~2004-03-15 23:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-15 22:49 Kevin Leung
2004-03-15 23:26 ` your mail Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).