LinuxCommandLibrary

powertop

Identify processes using excessive power

TLDR

Calibrate power usage measurements

$ sudo powertop --calibrate
copy

Generate HTML power usage report in the current directory
$ sudo powertop --html=[power_report.html]
copy

Tune to optimal settings
$ sudo powertop --auto-tune
copy

Generate a report for a specified number of seconds (instead of 20 by default)
$ sudo powertop --time=[5]
copy

SYNOPSIS

powertop [OPTIONS]

PARAMETERS

-h, --help
    Displays the help message and exits.

-v, --version
    Shows the powertop version information and exits.

-d, --debug
    Enables debug output for more verbose operation, useful for troubleshooting.

-r, --html=FILENAME
    Generates a detailed HTML report of the current power consumption analysis to the specified FILENAME.

-c, --csv=FILENAME
    Generates a CSV report suitable for spreadsheet analysis to the specified FILENAME.

-t, --time=SECONDS
    Runs powertop for the specified number of SECONDS in non-interactive mode and then exits.

-C, --calibrate
    Performs a calibration cycle to improve the accuracy of power consumption estimates, especially when running on battery.

-a, --auto-tune
    Applies all recommended power-saving tunables (marked as "Good") to the system automatically. This is a common and powerful option for immediate optimization.

-q, --quiet
    Suppresses non-essential output, making it useful for scripting or automated environments.

--workload=COMMAND
    Executes COMMAND during the calibration or reporting phase to simulate a specific system load and observe its power impact.

--battery
    Forces powertop to use battery discharge data for calibration and reporting, even if the system is currently on AC power.

--no-ac
    Prevents powertop from checking for AC power status, useful for debugging specific power states or scenarios.

DESCRIPTION

powertop is an essential Linux utility developed by Intel that helps users identify what is consuming power on their system and suggests ways to reduce it. It provides an interactive, curses-based interface showing real-time power consumption estimates for individual processes, devices, kernel timers, and other system components. The tool categorizes items as "Good" or "Bad" for power efficiency and offers a "Tunables" tab where users can apply various power-saving optimizations, such as enabling runtime PM for USB devices, configuring ALPM for SATA controllers, or adjusting CPU frequency scaling governors.

It leverages kernel data like wakeups, device activity, and CPU states to generate its insights. powertop is invaluable for laptop users looking to extend battery life, server administrators aiming to reduce energy costs, and developers optimizing embedded systems for low power. It's a proactive tool that not only reports but also helps implement power efficiency improvements, aiming to maximize energy savings without compromising system stability.

CAVEATS

powertop requires root privileges (e.g., using sudo) to display full power consumption information and apply tunables. Power consumption estimates are approximations and may not always be perfectly accurate, especially without proper calibration. Applying --auto-tune might, in rare cases, affect performance or cause minor system instability with certain hardware configurations (e.g., some USB devices might misbehave after suspension). The tool itself consumes some power while running. Modern Linux kernels and hardware often have good default power management, so powertop's impact might be less dramatic on newer systems but still valuable for fine-tuning.

INTERACTIVE INTERFACE TABS

When run without arguments, powertop presents an interactive interface with several tabs:

  • Overview: Provides a summary of estimated power consumption.
  • Idle stats: Shows how much time the CPU spends in various idle (C-states).
  • Device stats: Displays activity and estimated power usage for individual hardware devices.
  • Tunables: Lists potential power-saving optimizations, indicating whether they are currently "Bad" (not optimized) or "Good" (optimized). You can toggle these manually.
  • WakeUp (or Frequency/Statistics): Shows what components are waking up the system or detailed statistics on CPU frequencies.

CALIBRATION FOR ACCURACY

For the most accurate power consumption estimates, especially for battery drain, it is highly recommended to run powertop with the --calibrate option. This performs a short calibration cycle, usually involving a few minutes of measurement, to better understand your system's specific power characteristics while on battery power.

GENERATING REPORTS

For long-term analysis or sharing results, powertop can generate static reports in HTML or CSV formats using the --html=FILENAME or --csv=FILENAME options respectively. These reports capture the detailed power statistics and tunable recommendations at a specific point in time, allowing for offline review and comparison.

HISTORY

powertop was initially developed by Intel's LessWatts.org initiative, launched around 2007, with the primary goal of improving Linux power efficiency, especially for mobile devices like laptops. It quickly became an indispensable tool for identifying power regressions in the Linux kernel and user-space applications. Its development has continued to evolve alongside kernel changes and new hardware, playing a crucial role in making Linux a more power-efficient operating system. It remains a cornerstone tool for power analysis and optimization within the Linux ecosystem.

SEE ALSO

tlp(8), tuned(8), upower(7), acpi(1), cpufreq(1), turbostat(8)

Copied to clipboard