帮忙介绍下/proc/pid/stat

oluckly 2010-11-04 04:03:24
例如:
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

如何计算?
...全文
289 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
sky04551 2011-05-17
  • 打赏
  • 举报
回复
大家帮下忙!
oluckly 2010-11-11
  • 打赏
  • 举报
回复
没人帮忙啊?
浪漫江湖 2010-11-08
  • 打赏
  • 举报
回复
不懂,学习一下.
oluckly 2010-11-08
  • 打赏
  • 举报
回复
大家帮下忙!
oluckly 2010-11-05
  • 打赏
  • 举报
回复
谢谢楼上的朋友!
请问如何利用时间差获取这个文件数据,来计算此进程的cpu占用率呢?请帮忙给个思路!
labelll 2010-11-05
  • 打赏
  • 举报
回复
最近看到一个valgrind工具,不知道是否专业。
bluejays 2010-11-04
  • 打赏
  • 举报
回复
$ 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.
。。。。。。

23,116

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧