From f4273c4f864334eac80c17593d6d71856e5ff814d2770dbb3dbbe02ae7a89b07 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Fri, 10 Jul 2015 20:35:28 +0000
Subject: [PATCH 1/2] Accepting request 315866 from
home:bmwiedemann:branches:Base:System
fix syntax (bnc#937647)
OBS-URL: https://build.opensuse.org/request/show/315866
OBS-URL: https://build.opensuse.org/package/show/Base:System/tuned?expand=0&rev=32
---
....4.0-use_cpupower_for_intel_perf_bias.patch | 18 +++++++++---------
tuned.changes | 5 +++++
tuned.spec | 2 +-
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch b/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
index cd544a8..78600c1 100644
--- a/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
+++ b/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
@@ -1,8 +1,8 @@
-Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
+Index: tuned-2.4.1/tuned/plugins/plugin_cpu.py
===================================================================
---- tuned-2.3.0.orig/tuned/plugins/plugin_cpu.py
-+++ tuned-2.3.0/tuned/plugins/plugin_cpu.py
-@@ -91,7 +91,8 @@
+--- tuned-2.4.1.orig/tuned/plugins/plugin_cpu.py
++++ tuned-2.4.1/tuned/plugins/plugin_cpu.py
+@@ -91,7 +91,8 @@ class CPULatencyPlugin(base.Plugin):
# Check for cpupower, use workaround if not available
self._check_cpupower()
# Check for x86_energy_perf_policy, ignore if not available / supported
@@ -12,7 +12,7 @@ Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
# Check for intel_pstate
self._check_intel_pstate()
else:
-@@ -207,7 +208,17 @@
+@@ -207,7 +208,17 @@ class CPULatencyPlugin(base.Plugin):
@command_set("energy_perf_bias", per_device=True)
def _set_energy_perf_bias(self, energy_perf_bias, device):
@@ -26,19 +26,19 @@ Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
+ elif bias_str == "normal":
+ bias_str = "6"
+ cpu_id = device.lstrip("cpu")
-+ tuned.utils.commands.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
++ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
+ elif self._has_energy_perf_bias:
log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
cpu_id = device.lstrip("cpu")
self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, str(energy_perf_bias)])
-@@ -215,14 +226,21 @@
+@@ -215,14 +226,21 @@ class CPULatencyPlugin(base.Plugin):
@command_get("energy_perf_bias")
def _get_energy_perf_bias(self, device):
energy_perf_bias = None
- if self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ cpu_id = device.lstrip("cpu")
-+ retcode, lines = tuned.utils.commands.execute(["cpupower", "-c", cpu_id, "info", "-b"])
++ retcode, lines = self._cmd.execute(["cpupower", "-c", cpu_id, "info", "-b"])
+ elif self._has_energy_perf_bias:
cpu_id = device.lstrip("cpu")
retcode, lines = self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, "-r"])
@@ -48,7 +48,7 @@ Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
- if len(l) == 2:
- energy_perf_bias = l[1]
- break
-+ else:
++ else:
+ return None
+ if retcode == 0:
+ for line in lines.splitlines():
diff --git a/tuned.changes b/tuned.changes
index 1d0c7dc..896b48f 100644
--- a/tuned.changes
+++ b/tuned.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Fri Jul 10 12:08:42 UTC 2015 - bwiedemann@suse.com
+
+- fix syntax (bnc#937647)
+
-------------------------------------------------------------------
Mon Jan 5 15:07:22 UTC 2015 - p.drouand@gmail.com
diff --git a/tuned.spec b/tuned.spec
index a9d81a0..af2255f 100644
--- a/tuned.spec
+++ b/tuned.spec
@@ -1,7 +1,7 @@
#
# spec file for package tuned
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
From 11670d30c60f642ed1f7e777bb991c9f31ea96f127c3b4848a3e10a861aee44c Mon Sep 17 00:00:00 2001
From: Thomas Renninger
Date: Mon, 13 Jul 2015 11:59:01 +0000
Subject: [PATCH 2/2] Accepting request 316254 from
home:pluskalm:branches:Base:System
- Update to 2.5.0
- Rebase patch:
* tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
- Drop patch included in upstream
* tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch
OBS-URL: https://build.opensuse.org/request/show/316254
OBS-URL: https://build.opensuse.org/package/show/Base:System/tuned?expand=0&rev=33
---
fix-allow-receive_sender-default.patch | 8 +-
...4.0-use_cpupower_for_intel_perf_bias.patch | 82 +++++++++---------
tuned-2.4.1.tar.bz2 | 3 -
tuned-2.5.0.tar.bz2 | 3 +
...p2tuned-fix-KeyError-on-id-attribute.patch | 11 ---
tuned.changes | 38 +++++++++
tuned.spec | 84 +++++++++++++++----
7 files changed, 153 insertions(+), 76 deletions(-)
delete mode 100644 tuned-2.4.1.tar.bz2
create mode 100644 tuned-2.5.0.tar.bz2
delete mode 100644 tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch
diff --git a/fix-allow-receive_sender-default.patch b/fix-allow-receive_sender-default.patch
index b329270..e638642 100644
--- a/fix-allow-receive_sender-default.patch
+++ b/fix-allow-receive_sender-default.patch
@@ -1,5 +1,7 @@
---- a/dbus.conf 2012-08-16 17:42:23.000000000 +0200
-+++ b/dbus.conf 2012-10-04 17:26:18.164945059 +0200
+Index: tuned-2.5.0/dbus.conf
+===================================================================
+--- tuned-2.5.0.orig/dbus.conf
++++ tuned-2.5.0/dbus.conf
@@ -9,7 +9,6 @@
@@ -7,4 +9,4 @@
-
-
\ No newline at end of file
+
diff --git a/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch b/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
index 78600c1..a34c4d5 100644
--- a/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
+++ b/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
@@ -1,8 +1,8 @@
-Index: tuned-2.4.1/tuned/plugins/plugin_cpu.py
+Index: tuned-2.5.0/tuned/plugins/plugin_cpu.py
===================================================================
---- tuned-2.4.1.orig/tuned/plugins/plugin_cpu.py
-+++ tuned-2.4.1/tuned/plugins/plugin_cpu.py
-@@ -91,7 +91,8 @@ class CPULatencyPlugin(base.Plugin):
+--- tuned-2.5.0.orig/tuned/plugins/plugin_cpu.py
++++ tuned-2.5.0/tuned/plugins/plugin_cpu.py
+@@ -108,7 +108,8 @@ class CPULatencyPlugin(base.Plugin):
# Check for cpupower, use workaround if not available
self._check_cpupower()
# Check for x86_energy_perf_policy, ignore if not available / supported
@@ -12,51 +12,51 @@ Index: tuned-2.4.1/tuned/plugins/plugin_cpu.py
# Check for intel_pstate
self._check_intel_pstate()
else:
-@@ -207,7 +208,17 @@ class CPULatencyPlugin(base.Plugin):
-
- @command_set("energy_perf_bias", per_device=True)
- def _set_energy_perf_bias(self, energy_perf_bias, device):
+@@ -234,7 +235,17 @@ class CPULatencyPlugin(base.Plugin):
+ if not self._is_cpu_online(device):
+ log.debug("%s is not online, skipping" % device)
+ return None
- if self._has_energy_perf_bias:
-+ if self._has_cpupower is True:
-+ bias_str = str(energy_perf_bias)
-+ if bias_str == "performance":
-+ bias_str = "0"
-+ elif bias_str == "powersave":
-+ bias_str = "15"
-+ elif bias_str == "normal":
-+ bias_str = "6"
-+ cpu_id = device.lstrip("cpu")
-+ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
-+ elif self._has_energy_perf_bias:
- log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
- cpu_id = device.lstrip("cpu")
- self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, str(energy_perf_bias)])
-@@ -215,14 +226,21 @@ class CPULatencyPlugin(base.Plugin):
- @command_get("energy_perf_bias")
- def _get_energy_perf_bias(self, device):
- energy_perf_bias = None
++ if self._has_cpupower is True:
++ bias_str = str(energy_perf_bias)
++ if bias_str == "performance":
++ bias_str = "0"
++ elif bias_str == "powersave":
++ bias_str = "15"
++ elif bias_str == "normal":
++ bias_str = "6"
++ cpu_id = device.lstrip("cpu")
++ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
++ elif self._has_energy_perf_bias:
+ if not sim:
+ cpu_id = device.lstrip("cpu")
+ log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
+@@ -262,14 +273,21 @@ class CPULatencyPlugin(base.Plugin):
+ if not self._is_cpu_online(device):
+ log.debug("%s is not online, skipping" % device)
+ return None
- if self._has_energy_perf_bias:
-+ if self._has_cpupower is True:
-+ cpu_id = device.lstrip("cpu")
-+ retcode, lines = self._cmd.execute(["cpupower", "-c", cpu_id, "info", "-b"])
-+ elif self._has_energy_perf_bias:
++ if self._has_cpupower is True:
++ cpu_id = device.lstrip("cpu")
++ retcode, lines = self._cmd.execute(["cpupower", "-c", cpu_id, "info", "-b"])
++ elif self._has_energy_perf_bias:
cpu_id = device.lstrip("cpu")
retcode, lines = self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, "-r"])
- if retcode == 0:
- for line in lines.splitlines():
- l = line.split()
- if len(l) == 2:
-- energy_perf_bias = l[1]
+- energy_perf_bias = self._energy_perf_policy_to_human(l[1])
- break
-+ else:
-+ return None
-+ if retcode == 0:
-+ for line in lines.splitlines():
-+ if line.startswith("analyzing CPU"):
-+ continue
-+ l = line.split()
-+ if len(l) == 2:
-+ energy_perf_bias = l[1]
-+ break
++ else:
++ return None
++ if retcode == 0:
++ for line in lines.splitlines():
++ if line.startswith("analyzing CPU"):
++ continue
++ l = line.split()
++ if len(l) == 2:
++ energy_perf_bias = l[1]
++ break
return energy_perf_bias
diff --git a/tuned-2.4.1.tar.bz2 b/tuned-2.4.1.tar.bz2
deleted file mode 100644
index 2346c6b..0000000
--- a/tuned-2.4.1.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fd2514ec269387c7c555b5d12534ce258ecdb021cd66f64c5678eea7dcbda54f
-size 81052
diff --git a/tuned-2.5.0.tar.bz2 b/tuned-2.5.0.tar.bz2
new file mode 100644
index 0000000..3d4e039
--- /dev/null
+++ b/tuned-2.5.0.tar.bz2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2d7fe44626d236b158b0259938d757846d2455f5a91ab6412a134e6ac2db7feb
+size 95651
diff --git a/tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch b/tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch
deleted file mode 100644
index d7dd0cc..0000000
--- a/tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/experiments/powertop2tuned.py.orig 2014-10-15 09:15:23.000000000 -0400
-+++ b/experiments/powertop2tuned.py 2014-12-21 01:27:40.875480511 -0500
-@@ -83,7 +83,7 @@
-
- def handle_starttag(self, tag, attrs):
- self.lastStartTag = tag
-- if self.lastStartTag == "div" and dict(attrs)["id"] == "tuning":
-+ if self.lastStartTag == "div" and dict(attrs).get("id") == "tuning":
- self.inProperTable = True
- if self.inProperTable and tag == "td":
- self.tdCounter += 1
diff --git a/tuned.changes b/tuned.changes
index 896b48f..9e6bdf4 100644
--- a/tuned.changes
+++ b/tuned.changes
@@ -1,3 +1,41 @@
+-------------------------------------------------------------------
+Sun Jul 12 12:48:16 UTC 2015 - mpluskal@suse.com
+
+- Update to 2.5.0
+ * add tuned-adm verify command for verification if all settings
+ from profile was applied (rhbz#1212836)
+ * add variables support to profiles / scripts (rhbz#1225124)
+ * add support for calling built-in functions when expanding
+ variables, built-in functions can be provided by function
+ plugins, add some built-in functions for unit conversion
+ (rhbz#1225135)
+ * add support for no daemon mode (rhbz#1068663)
+ * add oracle tuned profile (rhbz#1196298)
+ * add tuned profile for RHEL-RT (rhbz#1228801)
+ * add tuned profiles for RHEL-NFV (rhbz#1228803)
+ * plugin_scheduler: added support for runtime tuning of
+ processes using perf (rhbz#1148546)
+ * plugin_sysfs: add glob support (rhbz#1212831)
+ * plugin_net: add support for ethtool -C (rhbz#1152539)
+ * plugin_net: add support for ethtool -K (rhbz#1152541)
+ * plugin_bootloader: add support for calculation of values for
+ the kernel command line (rhbz#1191595)
+ * tuned-adm: fix bash completions (rhbz#1207668)
+ * plugin_bootloader: do not install tuned kernel command line to
+ rescue kernels (rhbz#1223864)
+ * add support for changing elevators on xvd* devices
+ (Amazon EC2) (rhbz#1170152)
+ * do not change settings of transparent hugepages if set in
+ kernel cmdline (rhbz#1189868
+- Rebase patch:
+ * tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
+- Drop patch included in upstream
+ * tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch
+- Fix some rpmlint warnings
+ * ghost rundif
+ * create tpmfiles in post using proper macro
+- Small cleanups using spec-cleaner
+
-------------------------------------------------------------------
Fri Jul 10 12:08:42 UTC 2015 - bwiedemann@suse.com
diff --git a/tuned.spec b/tuned.spec
index af2255f..6b16b47 100644
--- a/tuned.spec
+++ b/tuned.spec
@@ -16,28 +16,25 @@
#
-%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d}
-
+%{!?_tmpfilesdir:%global _tmpfilesdir %{_libexecdir}/tmpfiles.d}
Name: tuned
-Version: 2.4.1
+Version: 2.5.0
Release: 0
Summary: A dynamic adaptive system tuning daemon
License: GPL-2.0+
Group: System/Base
Url: https://fedorahosted.org/tuned/
Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2
-# PATCH-FIX-OPENSUSE fix-allow-receive_sender-default.patch allow receive_* is normally
+# PATCH-FIX-OPENSUSE fix-allow-receive_sender-default.patch allow receive_* is normally
# not needed as that is the default --
Patch0: fix-allow-receive_sender-default.patch
# PATCH-FIX-OPENSUSE tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch --use cpupower instead of energy class
Patch2: tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
-# PATCH-FIX-UPSTREAM tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch --use get function when define id attribute bnc#888599
-Patch3: tuned-powertop2tuned-fix-KeyError-on-id-attribute.patch
-BuildRequires: python
-BuildRequires: systemd
# Do not own standard directories
BuildRequires: bash-completion
-Requires: /usr/bin/cpupower
+BuildRequires: python
+BuildRequires: systemd
+Requires: %{_bindir}/cpupower
Requires: dbus-1-python
Requires: ethtool
Requires: gawk
@@ -47,9 +44,9 @@ Requires: python-decorator
Requires: python-gobject
Requires: python-pyudev
Requires: util-linux
-%{?systemd_requires}
-BuildArch: noarch
Obsoletes: pm-profiler
+BuildArch: noarch
+%{?systemd_requires}
%description
The tuned package contains a daemon that tunes system settings dynamically.
@@ -92,6 +89,30 @@ Requires: %{name} = %{version}
%description profiles-atomic
Additional tuned profiles targeted to Atomic host and guest.
+%package profiles-realtime
+Summary: Additional tuned profiles targeted to realtime
+Group: System/Base
+Requires: %{name} = %{version}
+
+%description profiles-realtime
+Additional tuned profiles targeted to realtime.
+
+%package profiles-oracle
+Summary: Additional tuned profiles targeted to Oracle loads
+Group: System/Base
+Requires: %{name} = %{version}
+
+%description profiles-oracle
+Additional tuned profiles targeted to Oracle loads.
+
+%package profiles-nfv
+Summary: Additional tuned profiles targeted to Network Function Virtualization (NFV)
+Group: System/Base
+Requires: %{name} = %{version}
+
+%description profiles-nfv
+Additional tuned profiles targeted to Network Function Virtualization (NFV).
+
%package utils
Summary: Disk and net statistic monitoring systemtap scripts
Group: System/Base
@@ -119,7 +140,6 @@ instead of fewer large ones).
%setup -q
%patch0 -p1
%patch2 -p1
-%patch3 -p1
%build
#The tuned daemon is written in pure Python. Nothing requires to be built.
@@ -127,18 +147,19 @@ instead of fewer large ones).
sed -i 's|usr/libexec/tuned|%{_libexecdir}/%{name}|' Makefile
%install
-make install DESTDIR=%{buildroot}
+make DESTDIR=%{buildroot} install %{?_smp_mflags}
%py_compile %{buildroot}
rm -rf %{buildroot}/%{_datadir}/doc
# Remove unwanted stuffs instead of exclude them in files list
rm -rf %{buildroot}%{_libexecdir}/%{name}/{default,desktop-powersave,laptop-ac-powersave,server-powersave,laptop-battery-powersave,enterprise-storage,spindown-disk}
rm %{buildroot}%{_mandir}/man7/tuned-profiles-compat.7
-ln -sf service $RPM_BUILD_ROOT/usr/sbin/rctuned
+ln -sf service %{buildroot}%{_sbindir}/rctuned
%post
%service_add_post %{name}.service
+%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
# convert active_profile from full path to name (if needed)
-sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
+sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' %{_sysconfdir}/tuned/active_profile
%pre
%service_add_pre %{name}.service
@@ -152,20 +173,26 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
-%{_datadir}/bash-completion/completions/tuned
+%{_datadir}/bash-completion/completions/tuned-adm
%exclude %{python_sitelib}/tuned/gtk
%{python_sitelib}/tuned
%{_sbindir}/tuned
%{_sbindir}/tuned-adm
%{_sbindir}/rctuned
+%exclude %{_sysconfdir}/tuned/realtime-variables.conf
%exclude %{_libexecdir}/tuned/sap-netweaver
%exclude %{_libexecdir}/tuned/sap-hana
%exclude %{_libexecdir}/tuned/sap-hana-vmware
%exclude %{_libexecdir}/tuned/atomic-host
%exclude %{_libexecdir}/tuned/atomic-guest
+%exclude %{_libexecdir}/tuned/realtime-virtual-guest
+%exclude %{_libexecdir}/tuned/realtime-virtual-host
+%exclude %{_libexecdir}/tuned/oracle
+%exclude %{_libexecdir}/tuned/realtime
+%exclude %{_libexecdir}/tuned/defirqaffinity*
%{_libexecdir}/tuned
# active_profile might be empty when built via build service, but typically
-# not on a real install -> better do not mark it %ghost
+# not on a real install -> better do not mark it %%ghost
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/active_profile
%config(noreplace) %{_sysconfdir}/tuned/tuned-main.conf
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/bootcmdline
@@ -174,11 +201,12 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
%{_tmpfilesdir}/tuned.conf
%{_unitdir}/tuned.service
%dir %{_localstatedir}/log/tuned
-%dir /etc/tuned
+%dir %{_sysconfdir}/tuned
%{_mandir}/man5/tuned*
%{_mandir}/man7/tuned-profiles.7*
%{_mandir}/man8/tuned*
%dir %{_datadir}/tuned
+%ghost %dir /run/tuned
%files gtk
%defattr(-,root,root,-)
@@ -204,6 +232,26 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
%{_libexecdir}/tuned/atomic-guest
%{_mandir}/man7/tuned-profiles-atomic.7*
+%files profiles-realtime
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/tuned/realtime-variables.conf
+%{_libexecdir}/tuned/realtime
+%{_mandir}/man7/tuned-profiles-realtime.7*
+
+%files profiles-oracle
+%defattr(-,root,root,-)
+%{_libexecdir}/tuned/oracle
+%{_mandir}/man7/tuned-profiles-oracle.7*
+
+%files profiles-nfv
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/tuned/realtime-virtual-guest-variables.conf
+%config(noreplace) %{_sysconfdir}/tuned/realtime-virtual-host-variables.conf
+%{_libexecdir}/tuned/realtime-virtual-guest
+%{_libexecdir}/tuned/realtime-virtual-host
+%{_libexecdir}/tuned/defirqaffinity*
+%{_mandir}/man7/tuned-profiles-nfv.7*
+
%files utils
%defattr(-,root,root,-)
%doc COPYING