OpenSolaris

  subsites   code review   repo   packages   bugs   defect   polls   planet
You are not signed in. Sign in or register.

PowerTOP for OpenSolaris

Overview

PowerTOP is an observability tool that shows how effectively your system is taking advantage of the CPU's power management features. By running the tool on an otherwise idle system, you can see how much time the CPUs are spending running in lower power states. Ideally, an unutilized (idle) system will spend 100% of its time running at the lowest power CPU states, but because of background user and kernel activity (random software periodically waking to poll status), idle systems typically consume more power than they should.

PowerTOP shows you which software (user and kernel) is waking up, and how often. By fixing, filing bugs against, (or just not running) power inefficient software you can help improve your system's power efficiency.

More information about the Linux version of PowerTOP can be found here.

Download

Version 1.1 is available through SVR4 packages and require Solaris Nevada build 82 or better.
Use tar(1) to uncompress, then pgkadd(1M) to install. Use pkgrm(1M) to uninstall.
Please report bugs and feedback to the development team alias, tesla dash dev at opensolaris dot org.

Status

  • PowerTOP v1.1 has been released on July 21st, 2008. The new version features new options, increased functionalities and several bug fixes. Among the new features are:
    • Cross calls have been added to the event report
    • PowerTOP will display all of the available processor states, resizing its subwindows accordingly
    • New option for dumping the analysis to the screen for a specified number of times
    • PowerTOP runs on xVM Server as of Solaris Nevada build 94


    Changelog for 1.1 (indexed by the repository's revision/changeset number):
    5961:1c1174047c7a : PowerTOP's windows flicker on some systems
    5960:cd8dc39ce8cb : 2586 residency and average values overflowing
    5959:758269452891 : Fix #define print(), no battery snapshot if no kstat module and version 1.1
    5958:d9e4d5d57a4e : 2394 PowerTOP segfaults on libcurses.so.1`getmaxy+4()
    5957:9ed270691352 : 2540 PowerTOP doesn't show battery information when fully charged and plugged in
    5956:f3359ae782d5 : Return values, header cleanup
    5955:9b1c31702fc2 : Clear lint, passes one and two
    5954:339748282add : Fix cstyle, sccs keywords
    5953:6a2cca9e6186 : 2431 PowerTOP shpuld use wnoutrefresh() and doupdate()
    5952:47ca80460eea : Non numerical values when the system doesn't transition state
    5951:e9ab1d5fa6e0 : fix powertop p-state number limitation
    5950:8f3616a1fdc0 : cpupm suggestion shouldn't appear if p-state transition is not supported
    5949:5ff89cae3d23 : Move idle-state-transition from mach_cpu_idle() to cpu_idle() to include xVM
    5948:222c995fda61 : Add dump [count] option
    5947:271245b140c4 : Filter invalid intervals and fix initial message
    5946:6459cc573263 : Add kstat battery module lookup
    5945:abffa8abed71 : Follow 6682365 and update kstat's battery module to acpi_drv
    5944:45d1819fddf9 : PowerTOP dumps core when -d option is followed by keystrokes
    5943:81cccedbddca : Fixes to interval and avg residency calculation
    5942:abfd51222b22 : Fix usage, exit status, command line option
    5941:6ad26c71e18a : Too many blank lines between states and wakeups report
    5940:acd5524b920a : Adding xcalls to event report
    

  • PowerTOP v1.0 has been released on May 14th, 2008. The PowerTOP command consumes several DTrace probes that were integrated into Nevada build 82. Therefore, for complete functionality the PowerTOP command should be run on a system based on Nevada build 82 (or better), or BFUed with archives constructed from the PowerTOP source respository.

Development

  • Building PowerTOP: After cloning the repository (see below), modify the opensolaris.sh file (under usr/src/tools/env/) according to your configuration. Run 'bldenv opensolaris.sh' to set up your environment variables and 'dmake' on usr/src/cmd/powertop to build the tool. The binary will be created under the architecture specific directory.
  • LINT: PowerTOP is LINT free for both passes one and two. When changing the code, make sure to run 'dmake lint' and that the output has no erros or warnings.
  • cstyle: PowerTOP follows the same cstyle rules as the WOS. Make sure to run 'hg cstyle' prior to integrating changes to the repo.
  • Please consult the OpenSolaris Developer's Reference if you have any questions - or drop us a line over at tesla dash dev at opensolaris dot org.

PowerTOP OpenSolaris Source Repository

  • powertop: Anonymous pull is allowed. You must either be a leader of this project (or a committer for the powertop repository) to push. Please read these instructions on how to use Mercurial repositories.

    Gate Status: The repository is is synced against build 82. A webrev detailing the repositories differences vs. Nevada is available here.

    Closed Binaries tarballs: Build 82 closed bins tarballs (needed for nightly(1)) can be downloaded here.

    To bringover from the powertop repository
        $ hg clone ssh://your-login@hg.opensolaris.org/hg/tesla/powertop
        
    For help with using Mercurial, or the ON tools, you can:

  • To make a (debug) kernel (using powertop as an example workspace, and opensolaris.sh as the environment file)
        $ cd powertop
        $ /opt/onbld/bin/bldenv -d /opt/onbld/bin/opensolaris.sh 
        $ cd usr/src/tools
        $ dmake install
        $ cd $CODEMGR_WS/usr/src/uts
        $ dmake install
        
  • To create a kernel tarball to install (x86)...
        $ /opt/onbld/bin/Install -G my_powertop_kernel -k i86pc
        
  • To build BFU archives, you need to get (and extract) the "closed bins" tarball(s) into your workspace. See above for current pointers (you must use versions appropriate for the build of onnv against which your repo is synced).
        $ cd powertop
        $ tar xf on-closed-bins.i386.tar
        $ /opt/onbld/bin/nightly /opt/onbld/bin/opensolaris.sh
        
  • See the OpenSolaris Developer's Reference for details on how to use kernel tarballs generated by Install(1).