Something went wrong. Try again.
Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216The cpupower package consists of the following elements:
requirements------------
On x86 pciutils is needed at runtime (-lpci).For compilation pciutils-devel (pci/pci.h) and a gcc versionproviding cpuid.h is needed.For both it's not explicitly checked for (yet).
libcpupower----------
"libcpupower" is a library which offers a unified access method for userspacetools and programs to the cpufreq core and drivers in the Linux kernel. Thisallows for code reduction in userspace tools, a clean implementation ofthe interaction to the cpufreq core, and support for both the sysfs and procinterfaces [depending on configuration, see below].
compilation and installation----------------------------
There are 2 output directories - one for the build output and another forthe installation of the build results, that is the utility, library,man pages, etc...
default directory-----------------
In the case of default directory, build and install process requires noadditional parameters:
build-----
$ make
The output directory for the 'make' command is the current directory andits subdirs in the kernel tree:tools/power/cpupower
install-------
$ sudo make install
'make install' command puts targets to default system dirs:
-----------------------------------------------------------------------| Installing file | System dir |-----------------------------------------------------------------------| libcpupower | /usr/lib |-----------------------------------------------------------------------| cpupower | /usr/bin |-----------------------------------------------------------------------| cpufreq-bench_plot.sh | /usr/bin |-----------------------------------------------------------------------| man pages | /usr/man |-----------------------------------------------------------------------| systemd service | /usr/lib/systemd/system |-----------------------------------------------------------------------| systemd support script | /usr/libexec |-----------------------------------------------------------------------
To put it in other words it makes build results available system-wide,enabling any user to simply start using it without any additional steps
custom directory----------------
There are 2 make's command-line variables 'O' and 'DESTDIR' that setupappropriate dirs:'O' - build directory'DESTDIR' - installation directory. This variable could also be setup inthe 'CONFIGURATION' block of the "Makefile"
build-----
$ make O=<your_custom_build_catalog>
Example:$ make O=/home/hedin/prj/cpupower/build
install-------
$ make O=<your_custom_build_catalog> DESTDIR=<your_custom_install_catalog>
Example:$ make O=/home/hedin/prj/cpupower/build DESTDIR=/home/hedin/prj/cpupower \> install
Notice that both variables 'O' and 'DESTDIR' have been provided. The reasonis that the build results are saved in the custom output dir defined by 'O'variable. So, this dir is the source for the installation step. If only'DESTDIR' were provided then the 'install' target would assume that thebuild directory is the current one, build everything there and installfrom the current dir.
The files will be installed to the following dirs:
-----------------------------------------------------------------------| Installing file | System dir |-----------------------------------------------------------------------| libcpupower | ${DESTDIR}/usr/lib |-----------------------------------------------------------------------| cpupower | ${DESTDIR}/usr/bin |-----------------------------------------------------------------------| cpufreq-bench_plot.sh | ${DESTDIR}/usr/bin |-----------------------------------------------------------------------| man pages | ${DESTDIR}/usr/man |-----------------------------------------------------------------------| systemd service | ${DESTDIR}/usr/lib/systemd/system |-----------------------------------------------------------------------| systemd support script | ${DESTDIR}/usr/libexec |-----------------------------------------------------------------------
If you look at the table for the default 'make' output dirs you willnotice that the only difference with the non-default case is the${DESTDIR} prefix. So, the structure of the output dirs remains the sameregardles of the root output directory.
clean and uninstall-------------------
'clean' target is intended for cleanup the build catalog from build results'uninstall' target is intended for removing installed files from theinstallation directory
default directory-----------------
This case is a straightforward one:$ make clean$ make uninstall
custom directory----------------
Use 'O' command line variable to remove previously built files from thebuild dir:$ make O=<your_custom_build_catalog> clean
Example:$ make O=/home/hedin/prj/cpupower/build clean
Use 'DESTDIR' command line variable to uninstall previously installed filesfrom the given dir:$ make DESTDIR=<your_custom_install_catalog>
Example:make DESTDIR=/home/hedin/prj/cpupower uninstall
running the tool----------------
default directory-----------------
$ sudo cpupower
custom directory----------------
When it comes to run the utility from the custom build catalog thingsbecome a little bit complicated as 'just run' approach doesn't work.Assuming that the current dir is '<your_custom_install_catalog>/usr',issuing the following command:
$ sudo ./bin/cpupowerwill produce the following error output:./bin/cpupower: error while loading shared libraries: libcpupower.so.1:cannot open shared object file: No such file or directory
The issue is that binary cannot find the 'libcpupower' library. So, weshall point to the lib dir:sudo LD_LIBRARY_PATH=lib64/ ./bin/cpupower
systemd service---------------
A systemd service is also provided to run the cpupower utility at boot withsettings read from a configuration file.
If you want systemd to find the new service after the installation, the serviceunit must have been installed in one of the system unit search path directories(such as '/usr/lib/systemd/system/', which is the default location) and (unlessyou are willing to wait for the next reboot) you need to issue the followingcommand:
$ sudo systemctl daemon-reload
If you want to enable this systemd service, edit '/etc/cpupower-service.conf'(uncommenting at least one of the options, depending on your preferences)and then issue the following command:
$ sudo systemctl enable --now cpupower.service
THANKS------Many thanks to Mattia Dongili who wrote the autotoolization andlibtoolization, the manpages and the italian language file for cpupower;to Dave Jones for his feedback and his dump_psb tool; to Bruno Ducrot for hispowernow-k8-decode and intel_gsic tools as well as the french language file;and to various others commenting on the previous (pre-)releases of cpupower.
Dominik Brodowski