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

Try to read tsc_freq_khz from kernel if available, for more accurate cycles_per_sec #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lun3x
Copy link

@lun3x lun3x commented Apr 12, 2023

This repo outlines a method for exporting the TSC frequency in kHz from the linux kernel. If it is available it would be useful to use it. This PR tries to read this value and uses it if available. If not it falls back to the existing calculations.

https://github.com/trailofbits/tsc_freq_khz

Hope this is useful!

Assert cps and cps2 are eq

fix syntax

use error types

specify error types

print string if error

Trim whitespace before parsing

Try read from kernel first, otherwise calculate value

Syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant