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.
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.
You can use psrinfo -v
for that.
prsinfo -v
doesn't tell which process is using which cpu.