Enable CPU frequency chart (netdata.cpu.cpufreq)

Problem/Question

I want to enable the CPU frequency chart, and for that, i have enabled required options in the netdata.conf section [plugin:proc:/proc/stat]. please check the netdata.conf configuration options:

[plugins]
        idlejitter = no
        node.d = no
        fping = no
        cgroups = yes
        check for new plugins every = 300
        slabinfo = yes
        nfacct = yes
        apps = no
        tc = no
        perf = yes
        # PATH environment variable = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
        # PYTHONPATH environment variable = 
        # proc = yes


[statsd]
        enabled = no

[plugin:proc]
        /proc/sys/kernel/random/entropy_avail = no
        /proc/net/rpc/nfsd = no
        /proc/net/rpc/nfs = no
        /proc/net/softnet_stat = no
        /proc/net/stat/synproxy = no
        /proc/net/ip_vs/stats = no
        /proc/spl/kstat/zfs/arcstats = no
        /sys/kernel/mm/ksm = no
        /sys/fs/btrfs = no
        ipc = no
        netdata server resources = no
        /proc/pagetypeinfo = no
        # /proc/stat = yes

[plugin:proc:/proc/stat]
        per cpu core utilization = no
        # cpu utilization = yes
        # cpu interrupts = yes
        # context switches = yes
        # processes started = yes
        # processes running = yes
         keep per core files open = yes
         keep cpuidle files open = yes
         core_throttle_count = auto
         package_throttle_count = no
         cpu frequency = yes
         cpu idle states = yes
        # core_throttle_count filename to monitor = /sys/devices/system/cpu/%s/thermal_throttle/core_throttle_count
        # package_throttle_count filename to monitor = /sys/devices/system/cpu/%s/thermal_throttle/package_throttle_count
         scaling_cur_freq filename to monitor = /sys/devices/system/cpu/%s/cpufreq/scaling_cur_freq
        # time_in_state filename to monitor = /sys/devices/system/cpu/%s/cpufreq/stats/time_in_state
        # schedstat filename to monitor = /proc/schedstat
        # cpuidle name filename to monitor = /sys/devices/system/cpu/cpu%zu/cpuidle/state%zu/name
        # cpuidle time filename to monitor = /sys/devices/system/cpu/cpu%zu/cpuidle/state%zu/time
        # filename to monitor = /proc/stat

Relevant documents I followed or actions I took to solve the issue

Environment/Browser/Agent’s version etc

netdata
v1.31.0-68-g2e88104dd

cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

uname -a

Linux 5.10.0-0.deb10.16-amd64 #1 SMP Debian 5.10.127-2~bpo10+1 (2022-07-28) x86_64 GNU/Linux

What I expected to happen

  1. Current CPU Frequency (cpu.cpufreq) chart on netdata.

  2. Needed netdata.cpu.cpufreq.cpuX measurements (tables) in InfluxDB

Example : 
root@DEB-SystemPr-f02f74b24382:# influx
Connected to http://localhost:8086 version 1.8.1
InfluxDB shell version: 1.8.1
> show databases
name: databases
name
----
netdata
> use netdata
Using database netdata
> show measurements
name: measurements
name
----
netdata.cpu.cpufreq.cpuX
netdata.cpu.cpufreq.cpuX
netdata.cpu.cpufreq.cpuX
netdata.cpu.cpu0_cpuidle.C0__active_
netdata.cpu.cpu0_cpuidle.C1_ACPI
netdata.cpu.cpu0_cpuidle.C2_ACPI
netdata.cpu.cpu0_cpuidle.C3_ACPI
netdata.cpu.cpu0_cpuidle.POLL
netdata.cpu.cpu0_interrupts.CAL

Hi @Samadhan_Fuke and welcome! :slight_smile:

Assuming that all you want is CPU frequency (average, per core etc) then…
As far as I know, you should not need to customise the netdata.conf for this to work. It should work out of the box. I have it working on a bunch of systems, both x86 and arm. I’m using mostly Ubuntu but that should be similar enough for our purposes :+1:

Are you able to get the CPU frequency using native tools? We should check this since netdata cannot gather information that isn’t there.
There are a few different method depending on your underlying hardware and so I tend to prefer using something like (note most of these will require root or elevation using sudo):

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq

or to watch it change just prefix the watch command:

watch -n 1 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq

I’d also see if you can get anything out of:

cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

And perhaps see if you have data populated under this directory:

/sys/devices/system/cpu/cpu*/cpufreq/stats/

e.g.

cat /sys/devices/system/cpu/cpu*/cpufreq/stats/trans_table

The actual data in the trans_table isn’t too important but I would be expect to see some varying numbers there.

2 Likes