libct/system: add I and P process states

Those states are available since Linux 4.14 (kernel commits
8ef9925b02c23e3838d5 and 06eb61844d841d003). Before this
patch, they were shown as unknown.

This is mostly cosmetical.

Note that I is described in /proc/pid/status as just "idle", although
elsewhere it says it's an idle kernel thread. Let's have it as "idle"
for brevity.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-08-03 19:28:48 -07:00
parent f90008aec8
commit a37a89f4db
+6
View File
@@ -19,6 +19,8 @@ const ( // Only values for Linux 3.14 and later are listed here
Stopped State = 'T' Stopped State = 'T'
TracingStop State = 't' TracingStop State = 't'
Zombie State = 'Z' Zombie State = 'Z'
Parked State = 'P'
Idle State = 'I'
) )
// String forms of the state from proc(5)'s documentation for // String forms of the state from proc(5)'s documentation for
@@ -39,6 +41,10 @@ func (s State) String() string {
return "tracing stop" return "tracing stop"
case Zombie: case Zombie:
return "zombie" return "zombie"
case Parked:
return "parked"
case Idle:
return "idle" // kernel thread
default: default:
return fmt.Sprintf("unknown (%c)", s) return fmt.Sprintf("unknown (%c)", s)
} }