So a OS multi-tasks and runs one process at a given moment (assuming it's a single core machine). Is there a way I can track/poll and find which process was running at what time and at what time it was put in the queue and retrieved back. Are there any system calls for this ?. Is there a way to achieve this without modifying the linux kernel's source.
A:
I don't think you can do this natively. AFAIK linux does not a keep a history track of this information.
Nuno Furtado
2009-06-29 09:07:45
+3
A:
I think you need lttng, it definitely give a you a elaborate view of the system's task switch thing(and much more than that) with the lttng viewer. Lttng's kernel part has been merged to current Linux kernel, and you can use it if your kernel has enabled this feature. Here is some screen shots for lttng.
arsane
2009-06-29 09:10:26
This is exactly what I was looking for. Thank you. :)
Ankur Gupta
2009-06-29 09:53:08
A:
That's an illogical question. If you are querying the OS from a script/process then the active program is ... YOURS.
Though I guess if you want the history you could watch the /proc
directory or the output from ps
SpliFF
2009-06-29 09:28:26
It's not a illogical question. Perhaps it's not well formed/ put properly.
Ankur Gupta
2009-06-29 10:02:12
If you have a single core, whichever process is doing the monitoring is bound to discover that it, itself is running.
MarkR
2009-06-29 14:43:53