1 The cpupower package consists of the following 1 The cpupower package consists of the following elements: 2 2 3 requirements 3 requirements 4 ------------ 4 ------------ 5 5 6 On x86 pciutils is needed at runtime (-lpci). 6 On x86 pciutils is needed at runtime (-lpci). 7 For compilation pciutils-devel (pci/pci.h) and 7 For compilation pciutils-devel (pci/pci.h) and a gcc version 8 providing cpuid.h is needed. 8 providing cpuid.h is needed. 9 For both it's not explicitly checked for (yet) 9 For both it's not explicitly checked for (yet). 10 10 11 11 12 libcpupower 12 libcpupower 13 ---------- 13 ---------- 14 14 15 "libcpupower" is a library which offers a unif 15 "libcpupower" is a library which offers a unified access method for userspace 16 tools and programs to the cpufreq core and dri 16 tools and programs to the cpufreq core and drivers in the Linux kernel. This 17 allows for code reduction in userspace tools, 17 allows for code reduction in userspace tools, a clean implementation of 18 the interaction to the cpufreq core, and suppo 18 the interaction to the cpufreq core, and support for both the sysfs and proc 19 interfaces [depending on configuration, see be 19 interfaces [depending on configuration, see below]. 20 20 21 21 22 compilation and installation 22 compilation and installation 23 ---------------------------- 23 ---------------------------- 24 24 25 There are 2 output directories - one for the b 25 There are 2 output directories - one for the build output and another for 26 the installation of the build results, that is 26 the installation of the build results, that is the utility, library, 27 man pages, etc... 27 man pages, etc... 28 28 29 default directory 29 default directory 30 ----------------- 30 ----------------- 31 31 32 In the case of default directory, build and in 32 In the case of default directory, build and install process requires no 33 additional parameters: 33 additional parameters: 34 34 35 build 35 build 36 ----- 36 ----- 37 37 38 $ make 38 $ make 39 39 40 The output directory for the 'make' command is 40 The output directory for the 'make' command is the current directory and 41 its subdirs in the kernel tree: 41 its subdirs in the kernel tree: 42 tools/power/cpupower 42 tools/power/cpupower 43 43 44 install 44 install 45 ------- 45 ------- 46 46 47 $ sudo make install 47 $ sudo make install 48 48 49 'make install' command puts targets to default 49 'make install' command puts targets to default system dirs: 50 50 51 ---------------------------------------------- 51 ----------------------------------------------------------------------- 52 | Installing file | Syste 52 | Installing file | System dir | 53 ---------------------------------------------- 53 ----------------------------------------------------------------------- 54 | libcpupower | /usr/lib 54 | libcpupower | /usr/lib | 55 ---------------------------------------------- 55 ----------------------------------------------------------------------- 56 | cpupower | /usr/bin 56 | cpupower | /usr/bin | 57 ---------------------------------------------- 57 ----------------------------------------------------------------------- 58 | cpufreq-bench_plot.sh | /usr/bin 58 | cpufreq-bench_plot.sh | /usr/bin | 59 ---------------------------------------------- 59 ----------------------------------------------------------------------- 60 | man pages | /usr/man 60 | man pages | /usr/man | 61 ---------------------------------------------- 61 ----------------------------------------------------------------------- 62 62 63 To put it in other words it makes build result 63 To put it in other words it makes build results available system-wide, 64 enabling any user to simply start using it wit 64 enabling any user to simply start using it without any additional steps 65 65 66 custom directory 66 custom directory 67 ---------------- 67 ---------------- 68 68 69 There are 2 make's command-line variables 'O' 69 There are 2 make's command-line variables 'O' and 'DESTDIR' that setup 70 appropriate dirs: 70 appropriate dirs: 71 'O' - build directory 71 'O' - build directory 72 'DESTDIR' - installation directory. This varia 72 'DESTDIR' - installation directory. This variable could also be setup in 73 the 'CONFIGURATION' block of the "Makefile" 73 the 'CONFIGURATION' block of the "Makefile" 74 74 75 build 75 build 76 ----- 76 ----- 77 77 78 $ make O=<your_custom_build_catalog> 78 $ make O=<your_custom_build_catalog> 79 79 80 Example: 80 Example: 81 $ make O=/home/hedin/prj/cpupower/build 81 $ make O=/home/hedin/prj/cpupower/build 82 82 83 install 83 install 84 ------- 84 ------- 85 85 86 $ make O=<your_custom_build_catalog> DESTDIR=< 86 $ make O=<your_custom_build_catalog> DESTDIR=<your_custom_install_catalog> 87 87 88 Example: 88 Example: 89 $ make O=/home/hedin/prj/cpupower/build DESTDI 89 $ make O=/home/hedin/prj/cpupower/build DESTDIR=/home/hedin/prj/cpupower \ 90 > install 90 > install 91 91 92 Notice that both variables 'O' and 'DESTDIR' h 92 Notice that both variables 'O' and 'DESTDIR' have been provided. The reason 93 is that the build results are saved in the cus 93 is that the build results are saved in the custom output dir defined by 'O' 94 variable. So, this dir is the source for the i 94 variable. So, this dir is the source for the installation step. If only 95 'DESTDIR' were provided then the 'install' tar 95 'DESTDIR' were provided then the 'install' target would assume that the 96 build directory is the current one, build ever 96 build directory is the current one, build everything there and install 97 from the current dir. 97 from the current dir. 98 98 99 The files will be installed to the following d 99 The files will be installed to the following dirs: 100 100 101 ---------------------------------------------- 101 ----------------------------------------------------------------------- 102 | Installing file | Syste 102 | Installing file | System dir | 103 ---------------------------------------------- 103 ----------------------------------------------------------------------- 104 | libcpupower | ${DESTDIR}/usr/lib 104 | libcpupower | ${DESTDIR}/usr/lib | 105 ---------------------------------------------- 105 ----------------------------------------------------------------------- 106 | cpupower | ${DESTDIR}/usr/bin 106 | cpupower | ${DESTDIR}/usr/bin | 107 ---------------------------------------------- 107 ----------------------------------------------------------------------- 108 | cpufreq-bench_plot.sh | ${DESTDIR}/usr/bin 108 | cpufreq-bench_plot.sh | ${DESTDIR}/usr/bin | 109 ---------------------------------------------- 109 ----------------------------------------------------------------------- 110 | man pages | ${DESTDIR}/usr/man 110 | man pages | ${DESTDIR}/usr/man | 111 ---------------------------------------------- 111 ----------------------------------------------------------------------- 112 112 113 If you look at the table for the default 'make 113 If you look at the table for the default 'make' output dirs you will 114 notice that the only difference with the non-d 114 notice that the only difference with the non-default case is the 115 ${DESTDIR} prefix. So, the structure of the ou 115 ${DESTDIR} prefix. So, the structure of the output dirs remains the same 116 regardles of the root output directory. 116 regardles of the root output directory. 117 117 118 118 119 clean and uninstall 119 clean and uninstall 120 ------------------- 120 ------------------- 121 121 122 'clean' target is intended for cleanup the bui 122 'clean' target is intended for cleanup the build catalog from build results 123 'uninstall' target is intended for removing in 123 'uninstall' target is intended for removing installed files from the 124 installation directory 124 installation directory 125 125 126 default directory 126 default directory 127 ----------------- 127 ----------------- 128 128 129 This case is a straightforward one: 129 This case is a straightforward one: 130 $ make clean 130 $ make clean 131 $ make uninstall 131 $ make uninstall 132 132 133 custom directory 133 custom directory 134 ---------------- 134 ---------------- 135 135 136 Use 'O' command line variable to remove previo 136 Use 'O' command line variable to remove previously built files from the 137 build dir: 137 build dir: 138 $ make O=<your_custom_build_catalog> clean 138 $ make O=<your_custom_build_catalog> clean 139 139 140 Example: 140 Example: 141 $ make O=/home/hedin/prj/cpupower/build clean 141 $ make O=/home/hedin/prj/cpupower/build clean 142 142 143 Use 'DESTDIR' command line variable to uninsta 143 Use 'DESTDIR' command line variable to uninstall previously installed files 144 from the given dir: 144 from the given dir: 145 $ make DESTDIR=<your_custom_install_catalog> 145 $ make DESTDIR=<your_custom_install_catalog> 146 146 147 Example: 147 Example: 148 make DESTDIR=/home/hedin/prj/cpupower uninstal 148 make DESTDIR=/home/hedin/prj/cpupower uninstall 149 149 150 150 151 running the tool 151 running the tool 152 ---------------- 152 ---------------- 153 153 154 default directory 154 default directory 155 ----------------- 155 ----------------- 156 156 157 $ sudo cpupower 157 $ sudo cpupower 158 158 159 custom directory 159 custom directory 160 ---------------- 160 ---------------- 161 161 162 When it comes to run the utility from the cust 162 When it comes to run the utility from the custom build catalog things 163 become a little bit complicated as 'just run' 163 become a little bit complicated as 'just run' approach doesn't work. 164 Assuming that the current dir is '<your_custom 164 Assuming that the current dir is '<your_custom_install_catalog>/usr', 165 issuing the following command: 165 issuing the following command: 166 166 167 $ sudo ./bin/cpupower 167 $ sudo ./bin/cpupower 168 will produce the following error output: 168 will produce the following error output: 169 ./bin/cpupower: error while loading shared lib 169 ./bin/cpupower: error while loading shared libraries: libcpupower.so.1: 170 cannot open shared object file: No such file o 170 cannot open shared object file: No such file or directory 171 171 172 The issue is that binary cannot find the 'libc 172 The issue is that binary cannot find the 'libcpupower' library. So, we 173 shall point to the lib dir: 173 shall point to the lib dir: 174 sudo LD_LIBRARY_PATH=lib64/ ./bin/cpupower 174 sudo LD_LIBRARY_PATH=lib64/ ./bin/cpupower 175 175 176 176 177 THANKS 177 THANKS 178 ------ 178 ------ 179 Many thanks to Mattia Dongili who wrote the au 179 Many thanks to Mattia Dongili who wrote the autotoolization and 180 libtoolization, the manpages and the italian l 180 libtoolization, the manpages and the italian language file for cpupower; 181 to Dave Jones for his feedback and his dump_ps 181 to Dave Jones for his feedback and his dump_psb tool; to Bruno Ducrot for his 182 powernow-k8-decode and intel_gsic tools as wel 182 powernow-k8-decode and intel_gsic tools as well as the french language file; 183 and to various others commenting on the previo 183 and to various others commenting on the previous (pre-)releases of 184 cpupower. 184 cpupower. 185 185 186 186 187 Dominik Brodowski 187 Dominik Brodowski
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.