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

Function proc_get_cpu_mhz() is valid for only a few architectures #133

Closed
vvmitrofanov opened this issue Jan 20, 2022 · 3 comments
Closed

Comments

@vvmitrofanov
Copy link
Contributor

vvmitrofanov commented Jan 20, 2022

It happened that we run your tests on RISC-V arch and found out that some metrics on the final output are zero. Delving into the code showed that proc_get_cpu_mhz() always returns 0, just because this function reads CPU MHz information from /proc/cpuinfo but only a few arches print out this information into this file. To be honest it is difficult to add sth into /proc/cpuinfo.
See requests to solve this problem:

  1. https://patchwork.kernel.org/project/linux-arm-kernel/patch/1465333713-14339-2-git-send-email-jon.mason@broadcom.com/#19266527
  2. https://patchwork.kernel.org/project/linux-arm-kernel/patch/1386924222-23169-1-git-send-email-vkale@apm.com/

Why not to get this information from /sys/devices/system/cpu/cpufreq/ ?
It is a portable and clear way to get it.

@sshaulnv
Copy link
Contributor

Was the issue resolved after this fix? 08d1c89

@vmitrofanov
Copy link

@sshaulnv, yes this patch fix it

@HassanKhadour
Copy link
Contributor

Thanks for your contribution!

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

No branches or pull requests

4 participants