Bug 12589 - CPU frequency Graph cannot show if Enable Simultaneous Multi-Threading (SMT) is forced
Summary: CPU frequency Graph cannot show if Enable Simultaneous Multi-Threading (SMT) ...
Status: MODIFIED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: x86_64 Unspecified
: - Unknown - Minor Usability
Assignee: Assigned to nobody - feel free to grab it and work on it
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-16 15:56 UTC by Roberto Peña
Modified: 2024-04-18 06:41 UTC (History)
5 users (show)

See Also:


Attachments
CPU frequency Graph error (31.48 KB, image/jpeg)
2021-03-16 15:56 UTC, Roberto Peña
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Peña 2021-03-16 15:56:12 UTC
Created attachment 863 [details]
CPU frequency Graph error

https://fireinfo.ipfire.org/profile/e18bc373e6d86f265a7fc18c032c25d6c78e9a47

IPFire 2.25 (x86_64) - Core Update 154

In this PC, if "Enable Simultaneous Multi-Threading (SMT)" is in Automatic, appears correctly 6 cores but, if is in Froced, after reboot, appears following:

No se puede mostrar la imagen "hhtps://192.168.1.1:444/cgi-bin/system.cgi?cpufreq?day" porque contiene errores.
Comment 1 Nick 2024-04-18 03:41:26 UTC
I appear to be seeing this issue too, however mine is both CPU Frequency and CPU Usage.

Thread here, https://community.ipfire.org/t/cpu-and-frequency-graph-not-working/11463/7 with images capture in there.

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.

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

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
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)
Comment 2 Nick 2024-04-18 03:44:44 UTC
Still a problem on Core Update 184,

Fireinfo https://www.ipfire.org/fireinfo/profile/cf409cd042212714bed149fe6e8d4b93b70855a2
Comment 4 Nick 2024-04-18 06:41:29 UTC
Thanks Arne, what about CPU Usage, the first graph. That still seems to look for cpu-0 and cpu-1 despite Collectd providing data for cpu-0 and cpu-2?

I had to symlink cpu-1 to cpu-2 to get it to work.