Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS ARM - Incorrect process CPU times #155

Open
andrewkroh opened this issue Mar 21, 2023 · 2 comments
Open

macOS ARM - Incorrect process CPU times #155

andrewkroh opened this issue Mar 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@andrewkroh
Copy link
Member

andrewkroh commented Mar 21, 2023

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.

User: time.Duration(task.Ptinfo.Total_user),
System: time.Duration(task.Ptinfo.Total_system),

Related

@nickelnickel
Copy link

@andrewkroh do you know if there is a plan to address this issue? As noted in elastic/gosigar#168 we have confirmed this is affecting measurements by our product which relies on this for CPU measurements.

@andrewkroh
Copy link
Member Author

I'm not aware of any teams that have this on their plan at the moment. Contributions are welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants