-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for the get_vcpu_ms hostcall #129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code itself looks good, so my comments below are mostly build and idiom related.
The test failures here make me wonder if we need to bump our Viceroy requirement? |
Co-authored-by: Federico G. Schwindt <[email protected]>
The timout during the test makes me think it might be a scheduler issue where the process isn't running asynchronously because something is stalled in the sleep. I can look into this more. |
This adds support for a hostcall that fetches the amount of time that the guest has spent on the VCPU, but does not include any time the guest has spent idle. The Viceroy implementation is forthcoming.
The raw hostcall provides this value in milliseconds, but the little reading on time in Go suggested that translating this to a
Duration
would be more natural. I can revisit this decision, or obviously folks can reach in and get the raw millisecond value from the internal library.The test case included makes sure that we don't count sleeping time. It may be worth adding an additional test to verify that we do count active time.