/proc/pid/stat: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 56: Line 56:
The session ID of the process, as integer.
The session ID of the process, as integer.


==Field 14==
==Field 14 - utime==


utime - CPU time spent in user code, measured in clock ticks
Amount of time that this process has been scheduled in user mode, measured in [[Linux_7_General_Concepts#USER_HZ|clock ticks]].  Expressed as an unsigned long. This includes guest time, as described below, so that applications that are not aware of the guest time field do not lose that time from their calculations.
 
==Field 43 guest_time==
 
Guest time of the process, which is time spent running a virtual CPU for a guest operating system, measured in clock ticks. Expressed as an unsigned long.


==Field 15==
==Field 15==

Revision as of 23:03, 1 March 2018

External

Internal

Overview

/proc/<pid>/stat contains status information about a process. This information is used by ps.

Example

972 (docker-containe) S 901 972 972 0 -1 1077944576 2657 0 2 0 561 205 0 0 20 0 11 0 1820 441688064 2327 18446744073709551615 4194304 11049596 140727040242048 140727040241432 4602915 0 2079995941 0 2143420159 18446744073709551615 0 0 17 1 0 0 0 0 0 13147640 13322176 25554944 140727040249523 140727040249749 140727040249749 140727040249821 0

Content

pid (exec-file-name) state ppid pgrp session

Field 1 - pid

The process ID as integer.

Field 2 - Executable File Name

The filename of the executable, in parentheses. This is visible whether or not the executable is swapped out.

Field 3 - state

The process state, as character:

  • R - running
  • S - sleeping in an interruptible wait
  • D - waiting in uninterruptible disk sleep
  • Z - zombie
  • T - stopped on a signal or (before 2.6.33) trace stopped
  • t - tracing stop (2.6.33 onward)
  • W - paging (before 2.6.0)
  • X - dead (from 2.6.0 onward)
  • x - dead (2.6.33 to 3.13 only)
  • K - wakekill (2.6.33-3.13)
  • W - waking (2.6.33-3.13)
  • P - parked (3.9-3.13)

Field 4 - ppid

The pid of the parent process, as integer.

Field 5 - pgrp

The process group ID, as integer.

Field 6 - session

The session ID of the process, as integer.

Field 14 - utime

Amount of time that this process has been scheduled in user mode, measured in clock ticks. Expressed as an unsigned long. This includes guest time, as described below, so that applications that are not aware of the guest time field do not lose that time from their calculations.

Field 43 guest_time

Guest time of the process, which is time spent running a virtual CPU for a guest operating system, measured in clock ticks. Expressed as an unsigned long.

Field 15

stime - CPU time spent in kernel code, measured in clock ticks

Field 16

cutime - Waited-for children's CPU time spent in user code (in clock ticks)

Field 17

cstime - Waited-for children's CPU time spent in kernel code (in clock ticks)

Field 22

starttime - Time when the process started, measured in clock ticks