[linux-tools] 02/07: Build tools from power/cpupower

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun Mar 20 19:18:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch sid
in repository linux-tools.

commit 96559e9c4c52d4c36de89c5a18ea8bbbaead2352
Author: Mattia Dongili <malattia at linux.it>
Date:   Fri Mar 11 06:55:41 2016 -0800

    Build tools from power/cpupower
    
    They'll eventually replace cpufrequtils and libcpufreq{0,-dev} so the
    structure of the packages is the same.
---
 debian/build/tools/Makefile                        |  1 +
 debian/build/tools/power/cpupower/Makefile         | 20 +++++++
 debian/changelog                                   |  3 ++
 debian/libcpupower-dev.install                     |  2 +
 debian/libcpupower0.install                        |  1 +
 debian/libcpupower0.symbols                        | 44 +++++++++++++++
 debian/linux-cpupower.install                      |  2 +
 ...power-cpupower-fix-incorrect-if-statement.patch | 21 ++++++++
 .../patches/power-cpupower-fix-manpages-NAME.patch | 63 ++++++++++++++++++++++
 debian/patches/series                              |  2 +
 debian/rules.real                                  | 23 +++++++-
 debian/templates/control.main.in                   | 29 ++++++++++
 debian/templates/control.source.in                 |  2 +-
 13 files changed, 211 insertions(+), 2 deletions(-)

diff --git a/debian/build/tools/Makefile b/debian/build/tools/Makefile
index a3cdd87..1ea9cf3 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 0000000..66e2c75
--- /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 726613e..a6b12f4 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 <ben at decadent.org.uk>  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 0000000..b341905
--- /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 0000000..d0dbfd1
--- /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 0000000..a356760
--- /dev/null
+++ b/debian/libcpupower0.symbols
@@ -0,0 +1,44 @@
+libcpupower.so.0 libcpupower0 #MINVER#
+ cpufreq_cpu_exists at Base 4.4
+ cpufreq_get_affected_cpus at Base 4.4
+ cpufreq_get_available_frequencies at Base 4.4
+ cpufreq_get_available_governors at Base 4.4
+ cpufreq_get_driver at Base 4.4
+ cpufreq_get_freq_hardware at Base 4.4
+ cpufreq_get_freq_kernel at Base 4.4
+ cpufreq_get_hardware_limits at Base 4.4
+ cpufreq_get_policy at Base 4.4
+ cpufreq_get_related_cpus at Base 4.4
+ cpufreq_get_stats at Base 4.4
+ cpufreq_get_transition_latency at Base 4.4
+ cpufreq_get_transitions at Base 4.4
+ cpufreq_modify_policy_governor at Base 4.4
+ cpufreq_modify_policy_max at Base 4.4
+ cpufreq_modify_policy_min at Base 4.4
+ cpufreq_put_affected_cpus at Base 4.4
+ cpufreq_put_available_frequencies at Base 4.4
+ cpufreq_put_available_governors at Base 4.4
+ cpufreq_put_driver at Base 4.4
+ cpufreq_put_policy at Base 4.4
+ cpufreq_put_related_cpus at Base 4.4
+ cpufreq_put_stats at Base 4.4
+ cpufreq_set_frequency at Base 4.4
+ cpufreq_set_policy at Base 4.4
+ sysfs_cpu_exists at Base 4.4
+ sysfs_get_available_frequencies at Base 4.4
+ sysfs_get_freq_affected_cpus at Base 4.4
+ sysfs_get_freq_available_governors at Base 4.4
+ sysfs_get_freq_driver at Base 4.4
+ sysfs_get_freq_hardware at Base 4.4
+ sysfs_get_freq_hardware_limits at Base 4.4
+ sysfs_get_freq_kernel at Base 4.4
+ sysfs_get_freq_policy at Base 4.4
+ sysfs_get_freq_related_cpus at Base 4.4
+ sysfs_get_freq_stats at Base 4.4
+ sysfs_get_freq_transition_latency at Base 4.4
+ sysfs_get_freq_transitions at Base 4.4
+ sysfs_modify_freq_policy_governor at Base 4.4
+ sysfs_modify_freq_policy_max at Base 4.4
+ sysfs_modify_freq_policy_min at Base 4.4
+ sysfs_set_freq_policy at Base 4.4
+ sysfs_set_frequency at Base 4.4
diff --git a/debian/linux-cpupower.install b/debian/linux-cpupower.install
new file mode 100644
index 0000000..21cca7c
--- /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 0000000..f9ea861
--- /dev/null
+++ b/debian/patches/power-cpupower-fix-incorrect-if-statement.patch
@@ -0,0 +1,21 @@
+commit 2fecc6ec4961703ea2c8936f3e37154399a56a68
+Author: Mattia Dongili <malattia at linux.it>
+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 <malattia at linux.it>
+
+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 0000000..491e0bc
--- /dev/null
+++ b/debian/patches/power-cpupower-fix-manpages-NAME.patch
@@ -0,0 +1,63 @@
+commit 33104a54437ff182a3541d6c0089e5b8d89c25cd
+Author: Mattia Dongili <malattia at linux.it>
+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 <malattia at linux.it>
+
+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 c1383d0..b1dd533 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 ca34334..891c39b 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 9da6d26..a64794b 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 at .
 
+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- at 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 761bf9b..109be7b 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux-tools.git



More information about the Kernel-svn-changes mailing list