diff --git a/pkg/trace/watchdog/cpu_aix.go b/pkg/trace/watchdog/cpu_aix.go index 298b5da78e796..090739aa3923a 100644 --- a/pkg/trace/watchdog/cpu_aix.go +++ b/pkg/trace/watchdog/cpu_aix.go @@ -89,6 +89,7 @@ import ( // As explained above, we will skip 120 bytes into the status file to locate the user CPU time. const skip = 120 +const nsecs_per_sec = 1000000000 func cpuTimeUser(pid int32) (float64, error) { f, err := os.Open(fmt.Sprintf("/proc/%d/status", pid)) @@ -101,6 +102,6 @@ func cpuTimeUser(pid int32) (float64, error) { var userNsecs int32 binary.Read(f, binary.BigEndian, &userSecs) binary.Read(f, binary.BigEndian, &userNsecs) - time := float64(userSecs) + (float64(userNsecs) / 1000000000) + time := float64(userSecs) + (float64(userNsecs) / nsecs_per_sec) return time, nil }