]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
uek-rpm: config: add turbostat into kernel pakackage for OL6 and OL7
authorEthan Zhao <ethan.zhao@oracle.com>
Fri, 11 Sep 2015 15:51:49 +0000 (08:51 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 11 Sep 2015 15:51:49 +0000 (08:51 -0700)
Orabug: 21613769

Create shell wrapper for turbostat and add turbosat tool into kernel
package.

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
uek-rpm/ol6/kernel-uek.spec
uek-rpm/ol6/turbostat [new file with mode: 0644]
uek-rpm/ol7/kernel-uek.spec
uek-rpm/ol7/turbostat [new file with mode: 0644]

index 3f914c4263fb92de31cdc6e803fc459e7b6ab688..ba6e82a540bd22db43f84a88b33ea42e2cb7598c 100644 (file)
@@ -447,6 +447,7 @@ Provides: kernel%{?variant}-uname-r = %{KVERREL}%{?1:.%{1}}\
 Provides: oracleasm = 2.0.5\
 %ifnarch sparc64\
 Provides: x86_energy_perf_policy = %{KVERREL}%{?1:.%{1}}\
+Provides: turbostat = %{KVERREL}%{?1:.%{1}}\
 %endif\
 Provides: perf = %{KVERREL}%{?1:.%{1}}\
 #Provides: libperf.a = %{KVERREL}%{?1:.%{1}}\
@@ -534,6 +535,7 @@ Source16: perf
 Source17: kabitool
 Source18: check-kabi
 Source20: x86_energy_perf_policy
+Source21: turbostat
 
 Source1000: config-x86_64
 Source1001: config-x86_64-debug
@@ -1139,6 +1141,16 @@ hwcap 0 nosegneg"
        install -m 755 x86_energy_perf_policy $RPM_BUILD_ROOT/usr/libexec/x86_energy_perf_policy.$KernelVer
        cd ../../../../
     fi
+
+# build tools/power/x86/turbostat:
+    if [ -d tools/power/x86/turbostat ]; then
+       cd tools/power/x86/turbostat
+       make
+# and install it:
+       mkdir -p $RPM_BUILD_ROOT/usr/libexec/
+       install -m 755 turbostat $RPM_BUILD_ROOT/usr/libexec/turbostat.$KernelVer
+       cd ../../../../
+    fi
 %endif
 %endif
 
@@ -1453,6 +1465,10 @@ chmod 0755 $RPM_BUILD_ROOT/usr/sbin/perf
 mkdir -p $RPM_BUILD_ROOT/usr/sbin/
 cp $RPM_SOURCE_DIR/x86_energy_perf_policy $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
 chmod 0755 $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
+# turbostat shell wrapper
+mkdir -p $RPM_BUILD_ROOT/usr/sbin/
+cp $RPM_SOURCE_DIR/turbostat $RPM_BUILD_ROOT/usr/sbin/turbostat
+chmod 0755 $RPM_BUILD_ROOT/usr/sbin/turbostat
 %endif
 
 
@@ -1724,6 +1740,8 @@ fi
 %ifnarch sparc64\
 /usr/libexec/x86_energy_perf_policy.%{KVERREL}%{?2:.%{2}}\
 /usr/sbin/x86_energy_perf_policy\
+/usr/libexec/turbostat.%{KVERREL}%{?2:.%{2}}\
+/usr/sbin/turbostat\
 %endif\
 %ghost /boot/initramfs-%{KVERREL}%{?2:.%{2}}.img\
 %{expand:%%files %{?2:%{2}-}devel}\
diff --git a/uek-rpm/ol6/turbostat b/uek-rpm/ol6/turbostat
new file mode 100644 (file)
index 0000000..97230e0
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# In pathological situations, this will print some error about uname.
+kverrel="`uname -r`" || exit
+
+exec "/usr/libexec/turbostat.$kverrel" ${1+"$@"}
+rc=$?
+
+# We're still here, so the exec failed.
+echo >&2 "Sorry, your kernel ($kverrel) doesn't support turbostat."
+
+exit $rc
index 0be844f48ead43a3c97f282dabf75a7b78692d88..48aefcc4e8a235e6276155d848101c20d39b2e31 100644 (file)
@@ -447,6 +447,7 @@ Provides: kernel%{?variant}-uname-r = %{KVERREL}%{?1:.%{1}}\
 Provides: oracleasm = 2.0.5\
 %ifnarch sparc64\
 Provides: x86_energy_perf_policy = %{KVERREL}%{?1:.%{1}}\
+Provides: turbostat = %{KVERREL}%{?1:.%{1}}\
 %endif\
 Provides: perf = %{KVERREL}%{?1:.%{1}}\
 #Provides: libperf.a = %{KVERREL}%{?1:.%{1}}\
@@ -536,6 +537,7 @@ Source18: check-kabi
 Source20: x86_energy_perf_policy
 Source21: securebootca.cer
 Source22: secureboot.cer
+Source23: turbostat
 
 Source1000: config-x86_64
 Source1001: config-x86_64-debug
@@ -1126,6 +1128,15 @@ hwcap 0 nosegneg"
        install -m 755 x86_energy_perf_policy $RPM_BUILD_ROOT/usr/libexec/x86_energy_perf_policy.$KernelVer
        cd ../../../../
     fi
+# build tools/power/x86/turbostat:
+    if [ -d tools/power/x86/turbostat ]; then
+       cd tools/power/x86/turbostat
+       make
+# and install it:
+       mkdir -p $RPM_BUILD_ROOT/usr/libexec/
+       install -m 755 turbostat $RPM_BUILD_ROOT/usr/libexec/turbostat.$KernelVer
+       cd ../../../../
+    fi
 %endif
 %endif
 
@@ -1440,6 +1451,10 @@ chmod 0755 $RPM_BUILD_ROOT/usr/sbin/perf
 mkdir -p $RPM_BUILD_ROOT/usr/sbin/
 cp $RPM_SOURCE_DIR/x86_energy_perf_policy $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
 chmod 0755 $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
+# turbostat shell wrapper
+mkdir -p $RPM_BUILD_ROOT/usr/sbin/
+cp $RPM_SOURCE_DIR/turbostat $RPM_BUILD_ROOT/usr/sbin/turbostat
+chmod 0755 $RPM_BUILD_ROOT/usr/sbin/turbostat
 %endif
 
 
@@ -1711,6 +1726,8 @@ fi
 %ifnarch sparc64\
 /usr/libexec/x86_energy_perf_policy.%{KVERREL}%{?2:.%{2}}\
 /usr/sbin/x86_energy_perf_policy\
+/usr/libexec/turbostat.%{KVERREL}%{?2:.%{2}}\
+/usr/sbin/turbostat\
 %endif\
 %ghost /boot/initramfs-%{KVERREL}%{?2:.%{2}}.img\
 %{expand:%%files %{?2:%{2}-}devel}\
diff --git a/uek-rpm/ol7/turbostat b/uek-rpm/ol7/turbostat
new file mode 100644 (file)
index 0000000..97230e0
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# In pathological situations, this will print some error about uname.
+kverrel="`uname -r`" || exit
+
+exec "/usr/libexec/turbostat.$kverrel" ${1+"$@"}
+rc=$?
+
+# We're still here, so the exec failed.
+echo >&2 "Sorry, your kernel ($kverrel) doesn't support turbostat."
+
+exit $rc