当我读取stat文件时,输出如下
15465 (out1) S 15290 15465 15290 34817 15465 4202496 185 0 0 0 1505506 4263936 89 18446744070709551615 4194304 4196524 14073395142929294514079514142840 1399571897360 0 0 0 18446744071582981369 0 17 1 0 0 0 6 6295080 629 5608 235960 1407951431498 14079514951431506 1407951431506 1407951434736
也就是说,在城域网中有52条线,...whereas约有44条线。为什么会有这些额外的信息??
有谁能详细说明一下。我正在编写Ubuntu12.04,内核是3.5.0-40-泛型。
发布于 2016-01-05 21:02:02
有关stat内容的非常好的文档可在Linux /proc文件系统手册上获得:
Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
..............................................................................
Field Content
pid process id
tcomm filename of the executable
state state (R is running, S is sleeping, D is sleeping in an
uninterruptible wait, Z is zombie, T is traced or stopped)
ppid process id of the parent process
pgrp pgrp of the process
sid session id
tty_nr tty the process uses
tty_pgrp pgrp of the tty
flags task flags
min_flt number of minor faults
cmin_flt number of minor faults with child's
maj_flt number of major faults
cmaj_flt number of major faults with child's
utime user mode jiffies
stime kernel mode jiffies
cutime user mode jiffies with child's
cstime kernel mode jiffies with child's
priority priority level
nice nice level
num_threads number of threads
it_real_value (obsolete, always 0)
start_time time the process started after system boot
vsize virtual memory size
rss resident set memory size
rsslim current limit in bytes on the rss
start_code address above which program text can run
end_code address below which program text can run
start_stack address of the start of the main process stack
esp current value of ESP
eip current value of EIP
pending bitmap of pending signals
blocked bitmap of blocked signals
sigign bitmap of ignored signals
sigcatch bitmap of caught signals
0 (place holder, used to be the wchan address, use /proc/PID/wchan instead)
0 (place holder)
0 (place holder)
exit_signal signal to send to parent thread on exit
task_cpu which CPU the task is scheduled on
rt_priority realtime priority
policy scheduling policy (man sched_setscheduler)
blkio_ticks time spent waiting for block IO
gtime guest time of the task in jiffies
cgtime guest time of the task children in jiffies
start_data address above which program data+bss is placed
end_data address below which program data+bss is placed
start_brk address above which program heap can be expanded with brk()
arg_start address above which program command line is placed
arg_end address below which program command line is placed
env_start address above which program environment is placed
env_end address below which program environment is placed
exit_code the thread's exit_code in the form reported by the waitpid system call
..............................................................................发布于 2014-02-14 08:34:32
下面是形成/proc/[pid]/stat文件内容的代码
http://lxr.free-electrons.com/source/fs/proc/stat.c?v=3.5#L74
https://stackoverflow.com/questions/21773756
复制相似问题