Debian Codegraph @

tools/power/cpupower/README

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