6

我知道进程的pid。top -H -p <pid>在 Linux 上工作,但我无法让它在 Solaris 上运行:

$ top -H -p 3677
/usr/local/packages/top/bin/top-default: illegal option -- H
Top version 3.5beta7
Usage: top-default [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]
$ top -p 3677
/usr/local/packages/top/bin/top-default: illegal option -- p
Top version 3.5beta7
Usage: top-default [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]

我必须通过哪些选项来查找进程在 Solaris 上使用的线程数?

$ uname
SunOS
$ 
4

1 回答 1

8

使用 prstat。线程数显示在最后一列(NLWP = 轻量级进程数)。

$ prstat -p 1124,4152,1144
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
  1144 jlliagre   22M   11M sleep   59    0   4:16:05 2.2% multiload-apple/1
  4152 jlliagre  374M  182M sleep   59    0   0:24:53 0.9% firefox-bin/11
  1124 jlliagre   71M   52M sleep   59    0   0:31:50 0.2% java/20

Total: 3 processes, 32 lwps, load averages: 0.14, 0.12, 0.11
于 2011-02-15T06:54:56.857 回答