Solaris prstat has additional capabilitIEs
such as reporting both user and kernel or system cpu utilization along with other
microstate information using the prstat -m and -L options. The -m option prints
microstate information,and -L prints statistics on per lightweight process.
在Centos或Ubuntu中有没有像prstat这样的工具?
解决方法 我相信你正在寻找的 Linux命令是top和pstree.这是linux的ptree,
#!/bin/sh# Solaris style ptree[ -x /usr/bin/ptree ] && exec /usr/bin/ptree "$@"# Print process tree# = PID : extract tree for this process# = user : filter for this (existing) user# = user = PID : do bothPATH=/bin:/usr/bin:/usr/sbin:/sbinexport PATHpsopt="-e"case in[a-z]*) psopt="-u ";shift;;esac[ -z "" ] &&exec ps $psopt -Ho pID=,args=#some effort to add less to the ps Listtmp=/tmp/ptree.$$trap 'rm $tmp' 0 HUP INT TERMps $psopt -Ho pID=,args= >$tmp<$tmp awk '{ ci=index(substr(,7),); o[ci]= }ci>s[a] { s[++a]=ci }==pID { for(i=1;i<=a;i++) { si=s[i]; if(si<=ci) print o[si] } walkdown=ci next}ci<walkdown { exit }walkdown!=0 { print }' pID=""总结
以上是内存溢出为你收集整理的linux – 在Ubuntu或Centos中的prstat全部内容,希望文章能够帮你解决linux – 在Ubuntu或Centos中的prstat所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)