CPU and Frequency Graph not working

I noticed my CPU frequency graphs weren’t working, they showed a static non-changing CPU0 frequency and CPU1, CPU2, CPU3 as NaN. I tried to follow the HW change instruction to clear out the RRD data, and reboot.

This seems to have broken them completely now, with files not found.

I note the CPU’s its is looking for is cpu-1. However on my system, my cpu’s are cpu-0 and cpu-2. I believe cpu-1 and cpu-3 are disabled SMT threads. My CPU has SMT disabled due to HW vulnerabilities. If I try and cat the entries in cpu-1 or cpu-3 they return Device or resource busy.

image

Looking at the code in the graphs.pl I can see it does detect 2 cpus, however it looks like the CPU Graph and Frequency graph are attempting to use cpu0 and cpu1, rather than cpu0 and cpu2.

Collectd seems to be generating data for cpu-0 and cpu-2

[root@ipfire localhost]# ls -lha ./cpu-*
./cpu-0:
total 1.2M
drwxr-xr-x 2 root root 200 Apr 13 01:08 .
drwxr-xr-x 56 root root 1.1K Apr 13 01:08 …
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-idle.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-interrupt.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-nice.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:57 cpu-softirq.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-steal.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-system.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-user.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-wait.rrd

./cpu-2:
total 1.2M
drwxr-xr-x 2 root root 200 Apr 13 01:08 .
drwxr-xr-x 56 root root 1.1K Apr 13 01:08 …
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-idle.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-interrupt.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-nice.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:57 cpu-softirq.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-steal.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-system.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-user.rrd
-rw-r–r-- 1 root root 152K Apr 13 01:54 cpu-wait.rrd

Any idea how to get it to look at cpu-0 and cpu-2?

I would try to do your first step again…

It can take a little while to start graphing.
But this sounds like a bug.

I’ve tried running the instruction twice, and it still doesnt work.

It has been non working for over day now.

Data is being generated as far as I can see, its just as shown above where the cpu number is 0 and 2, whereas the graph wants to find a file name cpu-1.

I can make the graphs appear if I create symbolic links. For ‘CPU Graph’, the data exists, so I just symbolic link cpu-2 to cpu-1

‘CPU Frequency Graph’ is a little more messed up, as for some reason it is looking for cpu-0, cpu-1, cpu-2. Looking in the cpufreq folder, data is only being generated for cpu-0. There is nothing to symbolic link, so I can link all 3 to cpu-0.

Graphs now appear, and CPU Graph is good. CPU Frequency Graph doesnt appear to have any data, despite the Max/Min/Current still having data (3 times due to the symbolic links).

I think CPU Frequency is a bit messy due to the cpufreqtools output. For whatever reason, the output of “CPU 1” doesnt work, “Segmentation Fault”. I’m not sure though if this should be valid or not. This is a single CPU AMD RX-427BB cpu with 2 cores, and 4 threads; of which SMT is disabled, so it should show up with 2 cpus?

If I check the cpu frequency through /proc/cpuinfo | grep MHz
image
There are indeed two independent clock frequencies shown. They go up and down with CPU usage.

Collectd seems to be having issues with cpufreq plugin,

[root@ipfire log]# cat ./messages | grep collectd
Apr 14 00:49:34 ipfire collectd[3731]: cpufreq: fgets: Device or resource busy
Apr 14 00:49:34 ipfire collectd[3731]: read-function of plugin `cpufreq' failed. Will suspend it for 30720 seconds.
Apr 14 01:16:38 ipfire ipfire: Error in RRD::graph for cpu freq: opening '/var/log/rrd/collectd/localhost/cpufreq/cpufreq-1.rrd': No such file or directory  (system.cgi, cpufreq, day)
Apr 14 01:16:38 ipfire ipfire: Error in RRD::graph for cpu: opening '/var/log/rrd/collectd/localhost/cpu-1/cpu-wait.rrd': No such file or directory  (system.cgi, cpu, day)
Apr 14 04:22:59 ipfire collectd[3731]: Exiting normally.
Apr 14 04:22:59 ipfire collectd[3731]: collectd: Stopping 1 read threads.
Apr 14 04:22:59 ipfire collectd[3731]: ping plugin: Shutting down thread.
Apr 14 04:22:59 ipfire collectd[3731]: rrdtool plugin: Shutting down the queue thread. This may take a while.
Apr 14 04:23:01 ipfire collectd[6911]: cpufreq plugin: Found 4 CPUs
Apr 14 04:23:01 ipfire collectd[6911]: Initialization complete, entering read-loop.
Apr 14 04:23:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 04:23:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 60 seconds.
Apr 14 04:24:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 04:24:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 120 seconds.
Apr 14 04:26:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 04:26:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 240 seconds.
Apr 14 04:30:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 04:30:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 480 seconds.
Apr 14 04:38:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 04:38:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 960 seconds.
Apr 14 04:54:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 04:54:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 1920 seconds.
Apr 14 05:26:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 05:26:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 3840 seconds.
Apr 14 06:30:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 06:30:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 7680 seconds.
Apr 14 08:38:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 08:38:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 15360 seconds.
Apr 14 12:02:13 ipfire ipfire: Error in RRD::graph for cpu: opening '/var/log/rrd/collectd/localhost/cpu-1/cpu-wait.rrd': No such file or directory  (system.cgi, cpu, day)
Apr 14 12:02:13 ipfire ipfire: Error in RRD::graph for cpu freq: opening '/var/log/rrd/collectd/localhost/cpufreq/cpufreq-1.rrd': No such file or directory  (system.cgi, cpufreq, day)
Apr 14 12:54:01 ipfire collectd[6911]: cpufreq: fgets: Device or resource busy
Apr 14 12:54:01 ipfire collectd[6911]: read-function of plugin `cpufreq' failed. Will suspend it for 30720 seconds.
Apr 14 15:46:04 ipfire ipfire: Error in RRD::graph for cpu freq: opening '/var/log/rrd/collectd/localhost/cpufreq/cpufreq-1.rrd': No such file or directory  (system.cgi, cpufreq, day)
Apr 14 15:46:05 ipfire ipfire: Error in RRD::graph for cpu: opening '/var/log/rrd/collectd/localhost/cpu-1/cpu-wait.rrd': No such file or directory  (system.cgi, cpu, day)
Apr 14 15:49:24 ipfire ipfire: Error in RRD::graph for cpu freq: opening '/var/log/rrd/collectd/localhost/cpufreq/cpufreq-1.rrd': No such file or directory  (system.cgi, cpufreq, day)
Apr 14 15:49:31 ipfire ipfire: Error in RRD::graph for cpu freq: opening '/var/log/rrd/collectd/localhost/cpufreq/cpufreq-1.rrd': No such file or directory  (system.cgi, cpufreq, day)
Apr 14 15:50:28 ipfire ipfire: Error in RRD::graph for cpu freq: opening '/var/log/rrd/collectd/localhost/cpufreq/cpufreq-2.rrd': No such file or directory  (system.cgi, cpufreq, day)

Not helping, but I have the same issue. The frequency graphs have never worked for me since I started using IPF in the last couple of months… I’ve tried following the instructions linked to here. I’ve done everything except reboot and see the same issue with as the previous poster, repeating:

Apr 14 15:39:10 gateway collectd[13161]: cpufreq: fgets: Device or resource busy
Apr 14 15:39:10 gateway collectd[13161]: read-function of plugin `cpufreq' failed. Will suspend it for 60 seconds.

This may be a Bug. I would make a bug report…
Probably hardware specific.

OK will do

Looks to be an already open one which hasn’t be looked at. So I’ve added it to that one.

https://bugzilla.ipfire.org/show_bug.cgi?id=12589

1 Like