/proc/PID/stat
时间: 2023-09-18 12:11:00 浏览: 140
The /proc/PID/stat file contains various statistics about the process with the specified PID. The file is a single line of text, with each field separated by a space.
The fields in the file are as follows:
1. pid - process ID
2. comm - name of the command that started the process
3. state - current state of the process (e.g. running, sleeping, etc.)
4. ppid - parent process ID
5. pgrp - process group ID
6. session - session ID
7. tty_nr - controlling terminal of the process
8. tpgid - ID of the foreground process group of the controlling terminal
9. flags - process flags (e.g. whether it is being traced, etc.)
10. minflt - number of minor faults (i.e. page faults that could be resolved without disk IO)
11. cminflt - number of minor faults of child processes
12. majflt - number of major faults (i.e. page faults that required disk IO)
13. cmajflt - number of major faults of child processes
14. utime - amount of time the process has spent in user mode
15. stime - amount of time the process has spent in kernel mode
16. cutime - amount of time waited-for children have been in user mode
17. cstime - amount of time waited-for children have been in kernel mode
18. priority - priority of the process
19. nice - nice value of the process
20. num_threads - number of threads in the process
21. starttime - time the process started, in jiffies (1/100th of a second)
22. vsize - virtual memory size of the process
23. rss - resident set size of the process (i.e. amount of physical memory it is using)
24. rsslim - current limit on the resident set size
25. startcode - address of the start of the code segment
26. endcode - address of the end of the code segment
27. startstack - address of the start of the stack
28. kstkesp - current value of the stack pointer
29. kstkeip - current value of the instruction pointer
30. signal - bitmap of pending signals for the process
31. blocked - bitmap of blocked signals for the process
32. sigignore - bitmap of ignored signals for the process
33. sigcatch - bitmap of caught signals for the process
34. wchan - address of the kernel function the process is currently waiting in
35. nswap - number of pages swapped to disk
36. cnswap - number of pages swapped to disk of child processes
37. exit_signal - signal to be sent to the parent process when the process exits
38. processor - CPU the process last ran on
39. rt_priority - real-time priority of the process
40. policy - scheduling policy of the process
Note: Some fields may be displayed as 0 if they are not applicable to the process or if they are not available. Also, the values for utime, stime, cutime, and cstime are given in clock ticks, which can be converted to seconds by dividing by the value of the system variable HZ (which is typically 100 on most systems).
阅读全文