mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Instantaneous snapshot of CPU schedule
@ 2009-10-27  7:44 J K Rai
  2009-10-27 10:36 ` Alan Cox
  2009-11-08  9:48 ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: J K Rai @ 2009-10-27  7:44 UTC (permalink / raw)
  To: lkml; +Cc: Peter Zijlstra, Ingo Molnar

Hello

Is there any utility using which we can take current (instantaneous) snapshot of process schedule on the linux based system from user land. Like use a system call or command to know what is running on each of the cpus 0..n-1 (assuming n cpus in the system). Output could be like tuple (pid, cpu_no).

If such utility does not exist then kindly throw some light / ideas so that it could be implemented.

Regards,
Jitendra


      Add whatever you love to the Yahoo! India homepage. Try now! http://in.yahoo.com/trynew

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

* Re: Instantaneous snapshot of CPU schedule
  2009-10-27  7:44 Instantaneous snapshot of CPU schedule J K Rai
@ 2009-10-27 10:36 ` Alan Cox
  2009-11-08  9:48 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2009-10-27 10:36 UTC (permalink / raw)
  To: J K Rai; +Cc: lkml, Peter Zijlstra, Ingo Molnar

On Tue, 27 Oct 2009 13:14:34 +0530 (IST)
J K Rai <jk.anurag@yahoo.com> wrote:

> Hello
> 
> Is there any utility using which we can take current (instantaneous) snapshot of process schedule on the linux based system from user land. Like use a system call or command to know what is running on each of the cpus 0..n-1 (assuming n cpus in the system). Output could be like tuple (pid, cpu_no).
> 
> If such utility does not exist then kindly throw some light / ideas so that it could be implemented.

I'm not sure it would be terribly useful. You know what is running on at
least one of the processors - your snapshot tool. So for uniprocessor its
100% useless, for dual processor 50% useless.

It would also be incredibly expensive to serialize everything on the
system just to take a measurement.

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

* Re: Instantaneous snapshot of CPU schedule
  2009-10-27  7:44 Instantaneous snapshot of CPU schedule J K Rai
  2009-10-27 10:36 ` Alan Cox
@ 2009-11-08  9:48 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2009-11-08  9:48 UTC (permalink / raw)
  To: J K Rai, Mike Galbraith,
	=?unknown-8bit?B?RnLDqWTDqXJpYw==?= Weisbecker,
	Arnaldo Carvalho de Melo
  Cc: lkml, Peter Zijlstra


* J K Rai <jk.anurag@yahoo.com> wrote:

> Hello
> 
> Is there any utility using which we can take current (instantaneous) 
> snapshot of process schedule on the linux based system from user land. 
> Like use a system call or command to know what is running on each of 
> the cpus 0..n-1 (assuming n cpus in the system). Output could be like 
> tuple (pid, cpu_no).
> 
> If such utility does not exist then kindly throw some light / ideas so 
> that it could be implemented.

We have a tool that can record scheduling events and analyze/display 
them, see:

  perf sched record

  perf sched latency
  perf sched map
  perf sched trace
  perf sched replay

the latest version is in:

  http://people.redhat.com/mingo/tip.git/README

do 'cd tools/perf; make -j install' to get the 'perf' command.

Now, your specific question was 'instantaneous'. I wouldnt mind such an 
extension to 'perf sched record':

  perf sched record --snapshot

or so. Then 'perf sched map' would show which task is running on which 
CPU. Other output modes would be possible too.

Would you be interested in extending 'perf sched' in such a fashion?

	Ingo

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

end of thread, other threads:[~2009-11-08  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-27  7:44 Instantaneous snapshot of CPU schedule J K Rai
2009-10-27 10:36 ` Alan Cox
2009-11-08  9:48 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®