LinuxCommandLibrary

cpufreq-info

Display CPU frequency scaling information

TLDR

Show CPU frequency information for all CPUs

$ cpufreq-info
copy

Show CPU frequency information for the specified CPU
$ cpufreq-info [[-c|--cpu]] [cpu_number]
copy

Show the allowed minimum and maximum CPU frequency
$ cpufreq-info [[-l|--hwlimits]]
copy

Show the current minimum and maximum CPU frequency and policy in table format
$ cpufreq-info [[-o|--proc]]
copy

Show available CPU frequency policies
$ cpufreq-info [[-g|--governors]]
copy

Show current CPU work frequency in a human-readable format, according to the cpufreq kernel module
$ cpufreq-info [[-f|--freq]] [[-m|--human]]
copy

Show current CPU work frequency in a human-readable format, by reading it from hardware (only available to root)
$ sudo cpufreq-info [[-w|--hwfreq]] [[-m|--human]]
copy

SYNOPSIS

cpufreq-info [OPTIONS] [CPU]

PARAMETERS

-c
    Specify the CPU to query. If omitted, information for all online CPUs is displayed. CPU indices are zero-based (e.g., 0, 1, 2).

-g
    Display the current CPU frequency scaling governor.

-f
    Display the current CPU frequency.

-s
    Display the current CPU frequency scaling driver in use (e.g., 'acpi_cpufreq', 'intel_pstate').

-p
    Display the current minimum and maximum frequencies allowed by the scaling policy.

-m
    Display all available CPU frequencies supported by the hardware and driver.

-l
    Display all available CPU frequency scaling governors.

-u
    Display the hardware's minimum and maximum CPU frequencies (limits).

-w
    Display the frequency of the 'weighted' policy (less commonly used output).

-o
    Display output in the old (legacy) format.

-v
    Provide more verbose output.

-h
    Display a help message and exit.

DESCRIPTION

The cpufreq-info command is a utility from the cpufrequtils package designed to provide detailed information about the CPU frequency scaling capabilities and current state of your system's processors.

It can report various aspects such as the current CPU frequency, the active scaling governor (e.g., 'ondemand', 'powersave', 'performance'), the minimum and maximum frequencies allowed by the current policy, and the available frequencies and governors supported by the hardware and kernel driver.

This tool is invaluable for system administrators and users looking to monitor power management settings, diagnose performance issues related to CPU throttling, or verify that their CPU frequency scaling is working as expected. It reads its information directly from the Linux kernel's sysfs interface, specifically the /sys/devices/system/cpu/cpuX/cpufreq/ directories.

CAVEATS

cpufreq-info relies heavily on the Linux kernel's cpufreq subsystem and appropriate CPU frequency scaling drivers (e.g., acpi_cpufreq, intel_pstate) being loaded and functional. Information accuracy and completeness depend on kernel and hardware support. While basic queries typically don't require root privileges, accessing some /sys filesystem entries might be restricted, potentially leading to incomplete output without sufficient permissions. Modern CPU drivers like intel_pstate often handle frequency scaling internally, which can make some traditional cpufreq mechanisms less relevant or directly controllable.

DEPENDENCIES

The command relies on the Linux kernel's cpufreq subsystem being compiled in and appropriate CPU frequency scaling drivers (e.g., acpi_cpufreq for ACPI-compliant systems, intel_pstate for modern Intel CPUs) being loaded. It also requires access to the /sys/devices/system/cpu/cpuX/cpufreq/ directory structure, which is part of the sysfs pseudo-filesystem.

USAGE EXAMPLES

To get info for all CPUs:
cpufreq-info

To get info for CPU 0 only:
cpufreq-info -c 0

To see the current governor for CPU 1:
cpufreq-info -c 1 -g

To list all available governors on your system:
cpufreq-info -l

HISTORY

cpufreq-info is a key component of the cpufrequtils package, which emerged to provide user-space tools for interacting with the Linux kernel's CPU frequency scaling subsystem (cpufreq). This subsystem has been a part of the kernel for many years, evolving significantly to improve power efficiency and performance on various CPU architectures. The command's development has closely tracked the kernel's advancements in power management, offering a consistent interface to query complex scaling behaviors.

SEE ALSO

cpufreq-set(1), lscpu(1), nproc(1), powertop(8)

Copied to clipboard