Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to check the number of processors using by a particular process in unix solaris. Which command we can use for that?

Thanks, D.

share|improve this question

migrated from Oct 2 '12 at 0:18

This question came from our site for professional and enthusiast programmers.

A single threaded process will only use at most one CPU and unless bounded to a processor set it can be any of them.

To know what CPUs a given process is using at a given time, you can run this command (replace pid is the process id):

prstat -p pid -n 65536 -c 0 1 | grep cpu

Remove the | grep cpu part to see all threads, including those currently sleeping.

Note that even multi-threaded processes will rarely use a lot of CPUs, if any, as they are often I/O bound, not CPU bound.

share|improve this answer
Oh, I misunderstood his question I guess. I read it as "Check number of processors using a command". – favoretti Oct 2 '12 at 6:57

You can use psrinfo -v for that.

share|improve this answer
cat /proc/cpuinfo – Ivan Oct 2 '12 at 1:51
/proc/cpuinfo is a Linux feature. prsinfo -v doesn't tell which process is using which cpu. – jlliagre Oct 2 '12 at 6:21

You must log in to answer this question.