elastic / elastic/go-sysinfo

macOS ARM - Incorrect process CPU times

Open
#155 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
405
Forks
91
PR merge metrics
No merged PRs in 30d

Description

Based on similar code in other projects it looks like the process CPU times may not be scaled correctly on Apple M1 / M2 hardware. This code needs to apply a scaling factor from https://developer.apple.com/documentation/driverkit/mach_timebase_info_t to the ticks. Under intel macs these were simple 1 tick = 1 nanosecond so it just worked.

https://github.com/elastic/go-sysinfo/blob/f544eca983fbc8de1d9f479ba18628dbcebb3e87/providers/darwin/process_darwin.go#L155-L156

## Related
- https://openradar.appspot.com/radar?id=5055988478509056
- https://github.com/elastic/gosigar/issues/168
- https://github.com/elastic/elastic-agent-system-metrics/issues/79

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.