String forms of the state from proc(5)'s documentation for proc/[pid]/status' "State" field.
()
| 28 | // String forms of the state from proc(5)'s documentation for |
| 29 | // /proc/[pid]/status' "State" field. |
| 30 | func (s State) String() string { |
| 31 | switch s { |
| 32 | case Dead: |
| 33 | return "dead" |
| 34 | case DiskSleep: |
| 35 | return "disk sleep" |
| 36 | case Running: |
| 37 | return "running" |
| 38 | case Sleeping: |
| 39 | return "sleeping" |
| 40 | case Stopped: |
| 41 | return "stopped" |
| 42 | case TracingStop: |
| 43 | return "tracing stop" |
| 44 | case Zombie: |
| 45 | return "zombie" |
| 46 | case Parked: |
| 47 | return "parked" |
| 48 | case Idle: |
| 49 | return "idle" // kernel thread |
| 50 | default: |
| 51 | return fmt.Sprintf("unknown (%c)", s) |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // Stat_t represents the information from /proc/[pid]/stat, as |
| 56 | // described in proc(5) with names based on the /proc/[pid]/status |
no outgoing calls