From kernel 4.13 on, /proc/cpuinfo always reports the static normative
CPU clock and not the current one. So try to read the frequency from
cpufreq and only fall back to cpuinfo it that fails.
BUG: 382561
sebas |
Plasma |
From kernel 4.13 on, /proc/cpuinfo always reports the static normative
CPU clock and not the current one. So try to read the frequency from
cpufreq and only fall back to cpuinfo it that fails.
BUG: 382561
Started ksysguard, frequency now changes. If the file is not
readable, the frequency is read from cpuinfo as expected.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
I could also open all sysfs files only once and then fseek+fscanf when the value is requested, but that would only exchange a continuous fopen+fclose with fseek+more complexity IMO.
I'm fine with both approaches, but I favor KISS here.