当前位置: 技术问答>linux和unix
帮忙介绍下/proc/pid/stat
来源: 互联网 发布时间:2016-11-30
本文导语: 例如: eureka:/proc/3105 # cat stat 3105 (xinetd) S 1 3105 3105 0 -1 8397120 2891 174904 39 44 1 3 111 82 15 0 1 0 3180 10997760 83 18446744073709551615 93824992231424 93824992385284 140735404291344 18446744073709551615 47683386152211 0 0 3674112...
例如:
eureka:/proc/3105 # cat stat
3105 (xinetd) S 1 3105 3105 0 -1 8397120 2891 174904 39 44 1 3 111 82 15 0 1 0 3180 10997760 83 18446744073709551615 93824992231424 93824992385284 140735404291344 18446744073709551615 47683386152211 0 0 3674112 2143547135 0 0 0 17 0 0 0 1100
请帮忙介绍下各个数据(尽量吧)代表的意思。
想通过这些数据计算cpu使用率,是不是只要关注user mode jiffies 和kernel mode jiffies
如何计算?
eureka:/proc/3105 # cat stat
3105 (xinetd) S 1 3105 3105 0 -1 8397120 2891 174904 39 44 1 3 111 82 15 0 1 0 3180 10997760 83 18446744073709551615 93824992231424 93824992385284 140735404291344 18446744073709551615 47683386152211 0 0 3674112 2143547135 0 0 0 17 0 0 0 1100
请帮忙介绍下各个数据(尽量吧)代表的意思。
想通过这些数据计算cpu使用率,是不是只要关注user mode jiffies 和kernel mode jiffies
如何计算?
|
|
$ man proc
。。。。。。
/proc/[pid]/stat
Status information about the process. This is used by ps(1). It is
defined in /usr/src/linux/fs/proc/array.c.
The fields, in order, with their proper scanf(3) format specifiers, are:
pid %d The process ID.
comm %s The filename of the executable, in parentheses. This is vis-
ible whether or not the executable is swapped out.
state %c One character from the string "RSDZTW" where R is running, S
is sleeping in an interruptible wait, D is waiting in unin-
terruptible disk sleep, Z is zombie, T is traced or stopped
(on a signal), and W is paging.
ppid %d The PID of the parent.
。。。。。。
。。。。。。
/proc/[pid]/stat
Status information about the process. This is used by ps(1). It is
defined in /usr/src/linux/fs/proc/array.c.
The fields, in order, with their proper scanf(3) format specifiers, are:
pid %d The process ID.
comm %s The filename of the executable, in parentheses. This is vis-
ible whether or not the executable is swapped out.
state %c One character from the string "RSDZTW" where R is running, S
is sleeping in an interruptible wait, D is waiting in unin-
terruptible disk sleep, Z is zombie, T is traced or stopped
(on a signal), and W is paging.
ppid %d The PID of the parent.
。。。。。。
|
最近看到一个valgrind工具,不知道是否专业。
|
不懂,学习一下.