KernelHung returns values from /proc/sys/kernel/hung_task_detect_count.
()
| 30 | |
| 31 | // KernelHung returns values from /proc/sys/kernel/hung_task_detect_count. |
| 32 | func (fs FS) KernelHung() (KernelHung, error) { |
| 33 | data, err := os.ReadFile(fs.proc.Path("sys", "kernel", "hung_task_detect_count")) |
| 34 | if err != nil { |
| 35 | return KernelHung{}, err |
| 36 | } |
| 37 | val, err := strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64) |
| 38 | if err != nil { |
| 39 | return KernelHung{}, err |
| 40 | } |
| 41 | return KernelHung{ |
| 42 | HungTaskDetectCount: &val, |
| 43 | }, nil |
| 44 | } |