From 1b1a09ae426ce3ba5a972a2944f8a3ef25f53a06 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 24 Jan 2017 03:03:17 +0000 Subject: [PATCH] [x86] linux-cpupower: Add turbostat and x86_energy_perf_policy commands Closes: #778249 --- debian/changelog | 2 ++ debian/linux-cpupower.install | 1 + debian/rules.d/tools/Makefile | 2 +- debian/rules.d/tools/power/Makefile | 8 ++++++++ debian/rules.d/tools/power/x86/Makefile | 5 +++++ debian/rules.d/tools/power/x86/turbostat/Makefile | 7 +++++++ .../power/x86/x86_energy_perf_policy/Makefile | 5 +++++ debian/rules.real | 15 +++++++++++++++ debian/templates/control.tools.in | 11 +++++------ 9 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 debian/rules.d/tools/power/Makefile create mode 100644 debian/rules.d/tools/power/x86/Makefile create mode 100644 debian/rules.d/tools/power/x86/turbostat/Makefile create mode 100644 debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile diff --git a/debian/changelog b/debian/changelog index 203ed9cfe..eac9504b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -350,6 +350,8 @@ linux (4.9.5-1) UNRELEASED; urgency=medium * cfg80211,memcg,power: Avoid ABI changes * cpuhp,orinoco,xhci: Ignore ABI changes * linux-image: Increase minimum version of initramfs-tools (Closes: #808038) + * [x86] linux-cpupower: Add turbostat and x86_energy_perf_policy commands + (Closes: #778249) [ Salvatore Bonaccorso ] * tmpfs: clear S_ISGID when setting posix ACLs (CVE-2017-5551) diff --git a/debian/linux-cpupower.install b/debian/linux-cpupower.install index 21cca7cd9..e79f8d192 100644 --- a/debian/linux-cpupower.install +++ b/debian/linux-cpupower.install @@ -1,2 +1,3 @@ usr/bin +usr/sbin usr/share/ diff --git a/debian/rules.d/tools/Makefile b/debian/rules.d/tools/Makefile index e529f6b2b..787959c33 100644 --- a/debian/rules.d/tools/Makefile +++ b/debian/rules.d/tools/Makefile @@ -1,7 +1,7 @@ SUBDIRS = \ hv \ perf \ - power/cpupower \ + power \ usb/usbip #SUBDIRS += lib/lockdep diff --git a/debian/rules.d/tools/power/Makefile b/debian/rules.d/tools/power/Makefile new file mode 100644 index 000000000..c3fcc4288 --- /dev/null +++ b/debian/rules.d/tools/power/Makefile @@ -0,0 +1,8 @@ +SUBDIRS = \ + cpupower + +ifneq ($(filter i386 amd64 x32,$(DEB_HOST_ARCH)),) +SUBDIRS += x86 +endif + +include $(top_rulesdir)/Makefile.inc diff --git a/debian/rules.d/tools/power/x86/Makefile b/debian/rules.d/tools/power/x86/Makefile new file mode 100644 index 000000000..2b9d7735c --- /dev/null +++ b/debian/rules.d/tools/power/x86/Makefile @@ -0,0 +1,5 @@ +SUBDIRS = \ + turbostat \ + x86_energy_perf_policy + +include $(top_rulesdir)/Makefile.inc diff --git a/debian/rules.d/tools/power/x86/turbostat/Makefile b/debian/rules.d/tools/power/x86/turbostat/Makefile new file mode 100644 index 000000000..2cf6365aa --- /dev/null +++ b/debian/rules.d/tools/power/x86/turbostat/Makefile @@ -0,0 +1,7 @@ +PROGS = turbostat + +installdir = /usr/sbin + +include $(top_rulesdir)/Makefile.inc + +CPPFLAGS += -DMSRHEADER='' diff --git a/debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile b/debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile new file mode 100644 index 000000000..6abb9188a --- /dev/null +++ b/debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile @@ -0,0 +1,5 @@ +PROGS = x86_energy_perf_policy + +installdir = /usr/sbin + +include $(top_rulesdir)/Makefile.inc diff --git a/debian/rules.real b/debian/rules.real index cecbac49e..868efa3a2 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -564,10 +564,25 @@ install-cpupower: $(STAMPS_DIR)/build-tools dh_testroot dh_prep $(call make-tools,tools/power/cpupower) install DESTDIR=$(DIR) +ifneq ($(filter i386 amd64 x32,$(DEB_HOST_ARCH)),) + $(call make-tools,tools/power/x86) install DESTDIR=$(DIR) + echo >> debian/linux-cpupower.substvars 'cpupower:Arch-Description='\ +'The turbostat command reports topology, frequency, idle power-state$${Newline}'\ +'statistics, temperature and power consumption information as provided$${Newline}'\ +'by the CPU.$${Newline}'\ +'$${Newline}'\ +'The x86_energy_perf_policy command sets a general policy on some Intel$${Newline}'\ +'CPU models for the relative importance of performance versus energy$${Newline}'\ +'savings.' +endif dh_install --sourcedir=$(DIR) dh_installchangelogs ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) dh_installdocs +ifneq ($(filter i386 amd64 x32,$(DEB_HOST_ARCH)),) + dh_installman tools/power/x86/turbostat/turbostat.8 \ + tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.8 +endif endif dh_strip dh_compress diff --git a/debian/templates/control.tools.in b/debian/templates/control.tools.in index 2dbf58a42..735c88c82 100644 --- a/debian/templates/control.tools.in +++ b/debian/templates/control.tools.in @@ -11,13 +11,12 @@ Build-Profiles: 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. +Description: CPU power management tools for Linux + The cpupower command allows inspection and control of cpufreq and + cpuidle tunables for hardware that support these features. It + replaces "cpufreq-info" and "cpufreq-set" in cpufrequtils. . - 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. + ${cpupower:Arch-Description} Package: libcpupower1 Build-Profiles: