UBUNTU: [Config] Package x86_energy_perf_policy and turbostat
authorTim Gardner <tim.gardner@canonical.com>
Tue, 9 Aug 2011 17:00:18 +0000 (11:00 -0600)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:10:27 +0000 (13:10 -0700)
BugLink: http://bugs.launchpad.net/bugs/797556

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>

debian/rules.d/2-binary-arch.mk
debian/rules.d/3-binary-indep.mk
debian/tools/turbostat [new file with mode: 0644]
debian/tools/x86_energy_perf_policy [new file with mode: 0644]

index c16459b..29788fc 100644 (file)
@@ -366,6 +366,10 @@ endif
 $(stampdir)/stamp-build-perarch: prepare-perarch
 ifeq ($(do_tools),true)
        cd $(builddir)/tools/tools/perf && make $(CROSS_COMPILE)
+       if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
+               cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make $(CROSS_COMPILE); \
+               cd $(builddir)/tools/tools/power/x86/turbostat && make $(CROSS_COMPILE); \
+       fi
 endif
        @touch $@
 
@@ -376,6 +380,12 @@ ifeq ($(do_tools),true)
        install -d $(toolspkgdir)/usr/bin
        install -s -m755 $(builddir)/tools/tools/perf/perf \
                $(toolspkgdir)/usr/bin/perf_$(abi_release)
+       if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
+               install -s -m755 $(builddir)/tools/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \
+                       $(toolspkgdir)/usr/bin/x86_energy_perf_policy_$(abi_release); \
+               install -s -m755 $(builddir)/tools/tools/power/x86/turbostat/turbostat \
+                       $(toolspkgdir)/usr/bin/turbostat_$(abi_release); \
+       fi
 endif
 
 binary-perarch: toolspkg = $(tools_pkg_name)
index d929bd5..6f71fd7 100644 (file)
@@ -85,6 +85,10 @@ install-tools:
        install -d $(toolsman)/man1
 
        install -m755 debian/tools/perf $(toolsbin)/perf
+       if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
+               install -m755 debian/tools/x86_energy_perf_policy $(toolsbin)/x86_energy_perf_policy; \
+               install -m755 debian/tools/turbostat $(toolsbin)/turbostat; \
+       fi
 
        rm -rf $(builddir)/tools
        install -d $(builddir)/tools
@@ -95,6 +99,11 @@ install-tools:
        cd $(builddir)/tools/tools/perf && make man
        install -m644 $(builddir)/tools/tools/perf/Documentation/*.1 \
                $(toolsman)/man1
+       if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
+               install -d $(toolsman)/man8; \
+               install -m644 $(CURDIR)/tools/power/x86/x86_energy_perf_policy/*.8 $(toolsman)/man8; \
+               install -m644 $(CURDIR)/tools/power/x86/turbostat/*.8 $(toolsman)/man8; \
+       fi
 
 ifeq ($(do_common_headers_indep),true)
 install-indep-deps-$(do_flavour_header_package) += install-headers
diff --git a/debian/tools/turbostat b/debian/tools/turbostat
new file mode 100644 (file)
index 0000000..ac4af7c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+full_version=`uname -r`
+
+# Removing flavour from version i.e. generic or server.
+flavour_abi=${full_version#*-}
+flavour=${flavour_abi#*-}
+version=${full_version%-$flavour}
+turbostat="turbostat_$version"
+
+if ! which "$turbostat" > /dev/null; then
+    echo "$turbostat not found" >&2
+    echo "You may need to install linux-tools-$version" >&2
+    exit 2
+fi
+
+exec "$turbostat" "$@"
diff --git a/debian/tools/x86_energy_perf_policy b/debian/tools/x86_energy_perf_policy
new file mode 100644 (file)
index 0000000..7b97a9e
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+full_version=`uname -r`
+
+# Removing flavour from version i.e. generic or server.
+flavour_abi=${full_version#*-}
+flavour=${flavour_abi#*-}
+version=${full_version%-$flavour}
+x86_energy_perf_policy="x86_energy_perf_policy_$version"
+
+if ! which "$x86_energy_perf_policy" > /dev/null; then
+    echo "$x86_energy_perf_policy not found" >&2
+    echo "You may need to install linux-tools-$version" >&2
+    exit 2
+fi
+
+exec "$x86_energy_perf_policy" "$@"