linux中的ps实用程序(procps),如何检查使用了哪个CPU [英] ps utility in linux (procps), how to check which CPU is used
本文介绍了linux中的ps实用程序(procps),如何检查使用了哪个CPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是有关procps
软件包的实用程序ps
,适用于Linux.
It is about procps
package, utility ps
for linux.
是否可以打印每个进程(线程)上次使用的CPU数量?
Can it print the number of last used CPU for each process (thread)?
更新:不是CPU时间(10秒),而是CPU编号(CPU0,CPU5,CPU123)
Update: Not a CPU Time (10 seconds), but a CPU NUMBER (CPU0,CPU5,CPU123)
推荐答案
哪个是多个处理器?根据手册,它没有为此提供选项.但是在我的Debian稳定系统上,它接受未记录的-o cpu
在查看源代码和
ps L
的输出之后,我相信您的答案是cpuid
或sgi_p
输出选项,分别是列ID CPUID和P.
'cpu'应该可以根据output.c中的注释工作,但是当前它与'nop'输出pr_nop()相关联:
which of multiple processors? it does not offer an option for that according to the manpage. but on my Debian stable system it accepts the undocumented -o cpu
after looking at the source, and the output of
ps L
, I believe your answer is either the cpuid
or sgi_p
output options, column IDs CPUID and P, respectively.
And 'cpu' should work according to this note in output.c, but it's currently tied to the 'nop' output pr_nop():
{"cpu", "CPU", pr_nop, sr_nop, 3, 0, BSD, AN|RIGHT}, /* FIXME ... HP-UX wants this as the CPU number for SMP? */
这篇关于linux中的ps实用程序(procps),如何检查使用了哪个CPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文