Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Oct 2 '12 at 0:18

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

2 Answers 2

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
1  
/proc/cpuinfo is a Linux feature. prsinfo -v doesn't tell which process is using which cpu. –  jlliagre Oct 2 '12 at 6:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.