diff --git a/debian/build/tools/Makefile b/debian/build/tools/Makefile index a3cdd8728..1ea9cf3d2 100644 --- a/debian/build/tools/Makefile +++ b/debian/build/tools/Makefile @@ -2,6 +2,7 @@ SUBDIRS = \ hv \ lib/lockdep \ perf \ + power/cpupower \ usb/usbip include ../Makefile.inc diff --git a/debian/build/tools/power/cpupower/Makefile b/debian/build/tools/power/cpupower/Makefile new file mode 100644 index 000000000..66e2c75aa --- /dev/null +++ b/debian/build/tools/power/cpupower/Makefile @@ -0,0 +1,20 @@ +OUTDIR = tools/power/cpupower +prefix = /usr/sbin + +include ../../../Makefile.inc + +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + DEBUG = true +endif + +all: + mkdir out + $(shell dpkg-buildflags --export=cmdline) $(MAKE) -C $(top_srcdir)/tools/power/cpupower -f Makefile O=$(CURDIR)/out DEBUG=$(DEBUG) CPUFREQ_BENCH=false V=true + +install: + $(MAKE) -C $(top_srcdir)/tools/power/cpupower -f Makefile O=$(CURDIR)/out install mandir=/usr/share/man DESTDIR=$(DESTDIR) CPUFREQ_BENCH=false + +clean: + mkdir -p out + $(MAKE) -C $(top_srcdir)/tools/power/cpupower -f Makefile O=$(CURDIR)/out clean + rm -rf out diff --git a/debian/changelog b/debian/changelog index 726613e6a..a6b12f4a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ linux-tools (4.4.6-1) UNRELEASED; urgency=medium - uapi: update install list after nvme.h rename - perf stat: Do not clean event's private stats + [ Mattia Dongili ] + * Build linux-cpupower. + -- Ben Hutchings Sun, 20 Mar 2016 15:35:32 +0000 linux-tools (4.4-4) unstable; urgency=medium diff --git a/debian/libcpupower-dev.install b/debian/libcpupower-dev.install new file mode 100644 index 000000000..b34190552 --- /dev/null +++ b/debian/libcpupower-dev.install @@ -0,0 +1,2 @@ +usr/include/* +usr/lib/lib*.so diff --git a/debian/libcpupower0.install b/debian/libcpupower0.install new file mode 100644 index 000000000..d0dbfd18a --- /dev/null +++ b/debian/libcpupower0.install @@ -0,0 +1 @@ +usr/lib/lib*.so.* diff --git a/debian/libcpupower0.symbols b/debian/libcpupower0.symbols new file mode 100644 index 000000000..a356760d1 --- /dev/null +++ b/debian/libcpupower0.symbols @@ -0,0 +1,44 @@ +libcpupower.so.0 libcpupower0 #MINVER# + cpufreq_cpu_exists@Base 4.4 + cpufreq_get_affected_cpus@Base 4.4 + cpufreq_get_available_frequencies@Base 4.4 + cpufreq_get_available_governors@Base 4.4 + cpufreq_get_driver@Base 4.4 + cpufreq_get_freq_hardware@Base 4.4 + cpufreq_get_freq_kernel@Base 4.4 + cpufreq_get_hardware_limits@Base 4.4 + cpufreq_get_policy@Base 4.4 + cpufreq_get_related_cpus@Base 4.4 + cpufreq_get_stats@Base 4.4 + cpufreq_get_transition_latency@Base 4.4 + cpufreq_get_transitions@Base 4.4 + cpufreq_modify_policy_governor@Base 4.4 + cpufreq_modify_policy_max@Base 4.4 + cpufreq_modify_policy_min@Base 4.4 + cpufreq_put_affected_cpus@Base 4.4 + cpufreq_put_available_frequencies@Base 4.4 + cpufreq_put_available_governors@Base 4.4 + cpufreq_put_driver@Base 4.4 + cpufreq_put_policy@Base 4.4 + cpufreq_put_related_cpus@Base 4.4 + cpufreq_put_stats@Base 4.4 + cpufreq_set_frequency@Base 4.4 + cpufreq_set_policy@Base 4.4 + sysfs_cpu_exists@Base 4.4 + sysfs_get_available_frequencies@Base 4.4 + sysfs_get_freq_affected_cpus@Base 4.4 + sysfs_get_freq_available_governors@Base 4.4 + sysfs_get_freq_driver@Base 4.4 + sysfs_get_freq_hardware@Base 4.4 + sysfs_get_freq_hardware_limits@Base 4.4 + sysfs_get_freq_kernel@Base 4.4 + sysfs_get_freq_policy@Base 4.4 + sysfs_get_freq_related_cpus@Base 4.4 + sysfs_get_freq_stats@Base 4.4 + sysfs_get_freq_transition_latency@Base 4.4 + sysfs_get_freq_transitions@Base 4.4 + sysfs_modify_freq_policy_governor@Base 4.4 + sysfs_modify_freq_policy_max@Base 4.4 + sysfs_modify_freq_policy_min@Base 4.4 + sysfs_set_freq_policy@Base 4.4 + sysfs_set_frequency@Base 4.4 diff --git a/debian/linux-cpupower.install b/debian/linux-cpupower.install new file mode 100644 index 000000000..21cca7cd9 --- /dev/null +++ b/debian/linux-cpupower.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/ diff --git a/debian/patches/power-cpupower-fix-incorrect-if-statement.patch b/debian/patches/power-cpupower-fix-incorrect-if-statement.patch new file mode 100644 index 000000000..f9ea8613a --- /dev/null +++ b/debian/patches/power-cpupower-fix-incorrect-if-statement.patch @@ -0,0 +1,21 @@ +commit 2fecc6ec4961703ea2c8936f3e37154399a56a68 +Author: Mattia Dongili +Date: Sun Feb 14 11:55:43 2016 -0800 + + warning: comparison of constant ‘-1’ with boolean expression is always false + + Signed-off-by: Mattia Dongili + +diff --git a/tools/power/cpupower/utils/helpers/topology.c b/tools/power/cpupower/utils/helpers/topology.c +index 9cbb7fd..771ec60 100644 +--- a/tools/power/cpupower/utils/helpers/topology.c ++++ b/tools/power/cpupower/utils/helpers/topology.c +@@ -106,7 +106,7 @@ int get_cpu_topology(struct cpupower_topology *cpu_top) + cpu_top->pkgs++; + } + } +- if (!cpu_top->core_info[0].pkg == -1) ++ if (cpu_top->core_info[0].pkg != -1) + cpu_top->pkgs++; + + /* Intel's cores count is not consecutively numbered, there may diff --git a/debian/patches/power-cpupower-fix-manpages-NAME.patch b/debian/patches/power-cpupower-fix-manpages-NAME.patch new file mode 100644 index 000000000..491e0bce2 --- /dev/null +++ b/debian/patches/power-cpupower-fix-manpages-NAME.patch @@ -0,0 +1,63 @@ +commit 33104a54437ff182a3541d6c0089e5b8d89c25cd +Author: Mattia Dongili +Date: Fri Feb 19 07:46:32 2016 -0800 + + Fix cpupower manpages "NAME" section + + The token before "-" should be the program name, no spaces allowed. + See man(7) and lexgrog(1). + + Signed-off-by: Mattia Dongili + +diff --git a/tools/power/cpupower/man/cpupower-frequency-info.1 b/tools/power/cpupower/man/cpupower-frequency-info.1 +index 9c85a38..6aa8d23 100644 +--- a/tools/power/cpupower/man/cpupower-frequency-info.1 ++++ b/tools/power/cpupower/man/cpupower-frequency-info.1 +@@ -1,7 +1,7 @@ + .TH "CPUPOWER\-FREQUENCY\-INFO" "1" "0.1" "" "cpupower Manual" + .SH "NAME" + .LP +-cpupower frequency\-info \- Utility to retrieve cpufreq kernel information ++cpupower\-frequency\-info \- Utility to retrieve cpufreq kernel information + .SH "SYNTAX" + .LP + cpupower [ \-c cpulist ] frequency\-info [\fIoptions\fP] +diff --git a/tools/power/cpupower/man/cpupower-frequency-set.1 b/tools/power/cpupower/man/cpupower-frequency-set.1 +index 3eacc8d..b505702 100644 +--- a/tools/power/cpupower/man/cpupower-frequency-set.1 ++++ b/tools/power/cpupower/man/cpupower-frequency-set.1 +@@ -1,7 +1,7 @@ + .TH "CPUPOWER\-FREQUENCY\-SET" "1" "0.1" "" "cpupower Manual" + .SH "NAME" + .LP +-cpupower frequency\-set \- A small tool which allows to modify cpufreq settings. ++cpupower\-frequency\-set \- A small tool which allows to modify cpufreq settings. + .SH "SYNTAX" + .LP + cpupower [ \-c cpu ] frequency\-set [\fIoptions\fP] +diff --git a/tools/power/cpupower/man/cpupower-idle-info.1 b/tools/power/cpupower/man/cpupower-idle-info.1 +index 7b3646a..80a1311 100644 +--- a/tools/power/cpupower/man/cpupower-idle-info.1 ++++ b/tools/power/cpupower/man/cpupower-idle-info.1 +@@ -1,7 +1,7 @@ + .TH "CPUPOWER-IDLE-INFO" "1" "0.1" "" "cpupower Manual" + .SH "NAME" + .LP +-cpupower idle\-info \- Utility to retrieve cpu idle kernel information ++cpupower\-idle\-info \- Utility to retrieve cpu idle kernel information + .SH "SYNTAX" + .LP + cpupower [ \-c cpulist ] idle\-info [\fIoptions\fP] +diff --git a/tools/power/cpupower/man/cpupower-idle-set.1 b/tools/power/cpupower/man/cpupower-idle-set.1 +index 580c4e3..21916cf 100644 +--- a/tools/power/cpupower/man/cpupower-idle-set.1 ++++ b/tools/power/cpupower/man/cpupower-idle-set.1 +@@ -1,7 +1,7 @@ + .TH "CPUPOWER-IDLE-SET" "1" "0.1" "" "cpupower Manual" + .SH "NAME" + .LP +-cpupower idle\-set \- Utility to set cpu idle state specific kernel options ++cpupower\-idle\-set \- Utility to set cpu idle state specific kernel options + .SH "SYNTAX" + .LP + cpupower [ \-c cpulist ] idle\-info [\fIoptions\fP] diff --git a/debian/patches/series b/debian/patches/series index c1383d0b6..b1dd533e7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,3 +22,5 @@ perf-remove-wrong-semicolon-in-while-loop.patch revert-perf-tools-x86-build-perf-on-older-user-space.patch perf-tools-fix-bpf-feature-check.patch tools-build-use-fixdep-with-output-path-prefix.patch +power-cpupower-fix-incorrect-if-statement.patch +power-cpupower-fix-manpages-NAME.patch diff --git a/debian/rules.real b/debian/rules.real index ca34334c8..891c39ba1 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -3,7 +3,7 @@ export KBUILD_BUILD_TIMESTAMP := $(shell dpkg-parsechangelog | sed -ne 's,^Date: include debian/rules.defs -binary-arch: install-kbuild install-usbip install-liblockdep +binary-arch: install-kbuild install-usbip install-liblockdep install-cpupower ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),) binary-arch: install-perf endif @@ -43,6 +43,27 @@ install-kbuild: $(STAMPS_DIR)/build dh_md5sums dh_builddeb + +install-cpupower: DH_OPTIONS = -plinux-cpupower -plibcpupower0 -plibcpupower-dev +install-cpupower: DIR = $(CURDIR)/debian/cpupower-tmp +install-cpupower: $(STAMPS_DIR)/build + dh_testdir + dh_testroot + dh_prep + $(MAKE) -C $(BUILD_DIR)/tools/power/cpupower install top_srcdir=$(CURDIR) DESTDIR=$(DIR) + dh_install --sourcedir=$(DIR) + dh_installchangelogs + dh_installdocs + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + install-perf: PACKAGE_NAME = linux-perf-$(VERSION) install-perf: DH_OPTIONS = -p$(PACKAGE_NAME) install-perf: DIR = $(CURDIR)/debian/$(PACKAGE_NAME) diff --git a/debian/templates/control.main.in b/debian/templates/control.main.in index 9da6d26ef..a64794b27 100644 --- a/debian/templates/control.main.in +++ b/debian/templates/control.main.in @@ -5,6 +5,35 @@ Multi-Arch: foreign Description: Kbuild infrastructure for Linux @version@ This package provides the kbuild infrastructure for the headers packages for Linux kernel version @version@. +Package: linux-cpupower +Section: admin +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: CPU frequency and voltage scaling tools for Linux + This package contains the 'power/cpupower' tools for Linux. + . + This set of userspace tools allow inspection and control of cpufreq and + cpuidle tunables for hardware that support these features. + The "cpupower" command replaces "cpufreq-info" and "cpufreq-set" in + cpufrequtils. + +Package: libcpupower0 +Section: libs +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: CPU frequency and voltage scaling tools for Linux (libraries) + This package contains the shared library. + +Package: libcpupower-dev +Section: libdevel +Architecture: linux-any +Depends: ${shlibs:Depends} +Provides: libcpufreq-dev +Conflicts: libcpufreq-dev +Replaces: libcpufreq-dev +Description: CPU frequency and voltage scaling tools for Linux (development files) + This package contains the 'power/cpupower' headers and library shared objects. + Package: linux-perf-@version@ Section: devel Architecture: alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64 diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in index 761bf9b6a..109be7b49 100644 --- a/debian/templates/control.source.in +++ b/debian/templates/control.source.in @@ -7,7 +7,7 @@ Standards-Version: 3.9.6 Build-Depends: debhelper (>> 7), python3, asciidoc, bison, flex, gcc-multilib [amd64 ppc64 s390x sparc64], libaudit-dev, libdw-dev, libelf-dev, libiberty-dev | binutils-dev (<< 2.23.91.20131123-1), libnewt-dev, libnuma-dev [amd64 arm64 hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el sparc x32], libperl-dev, libunwind8-dev [amd64 armel armhf arm64 i386], python-dev, xmlto, - autoconf, automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, + autoconf, automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libpci-dev, dh-systemd Vcs-Git: https://anonscm.debian.org/git/kernel/linux-tools.git Vcs-Browser: https://anonscm.debian.org/cgit/kernel/linux-tools.git