[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 1/1] Build tools from power/cpupower



On Fri, Feb 19, 2016 at 07:56:18AM -0800, Mattia Dongili wrote:
> On Fri, Feb 19, 2016 at 03:37:50PM +0000, Ben Hutchings wrote:
...
> > Is there any reason not to add cpupower on the sid branch rather than
> > master (which means it will stay in experimental for the next ~2
> > months)?
> 
> The sid branch is fine, I'll rebase on that for the next revision.

Below is another round, on top of the sid branch and lintian-clean.
I decided to not ship cpufreq-bench and the plotting script, aside
from the gnuplot dependency, I don't see them as particularly useful for
general use.
I didn't touch anything outside power/cpupower.

-- 
mattia
:wq!

- - 8< - - 8< - - 

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                                   |  8 +++
 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, 216 insertions(+), 2 deletions(-)
 create mode 100644 debian/build/tools/power/cpupower/Makefile
 create mode 100644 debian/libcpupower-dev.install
 create mode 100644 debian/libcpupower0.install
 create mode 100644 debian/libcpupower0.symbols
 create mode 100644 debian/linux-cpupower.install
 create mode 100644 debian/patches/power-cpupower-fix-incorrect-if-statement.patch
 create mode 100644 debian/patches/power-cpupower-fix-manpages-NAME.patch

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 3a35e50..9060b55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+linux-tools (4.4-5~exp1.1) experimental; urgency=medium
+
+  * Non-maintainer upload.
+  * Build linux-cpupower.
+
+ -- Mattia Dongili <malattia@debian.org>  Sun, 21 Feb 2016 19:36:29 -0800
+
 linux-tools (4.4-4) unstable; urgency=medium
 
   * hyperv-daemons: Only build the progarams on x86 (fixes FTBFS)
@@ -12,6 +19,7 @@ linux-tools (4.4-3) unstable; urgency=medium
 
 linux-tools (4.4-2) unstable; urgency=medium
 
+  [ Ben Hutchings ]
   * linux-perf: Include version number in strace groups installation directory
     (Closes: #813080)
   * [alpha,sh4] Attempt to fix build failures
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@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 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@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@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@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@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 1f4f8c5..de1d8ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -23,3 +23,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@.
 
+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 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
-- 
2.7.0

Attachment: signature.asc
Description: PGP signature


Reply to: