New version
- Systemtap scripts moved to utils-systemtap subpackage
This commit is contained in:
parent
e96c0492d6
commit
ae8dc2e100
2
sources
2
sources
@ -1 +1 @@
|
||||
5e32b756bfd54aec549f7a31432d4bf2 tuned-2.0.1.tar.bz2
|
||||
1eb5d48524c1db7dacc35896f95c2a32 tuned-2.0.2.tar.bz2
|
||||
|
@ -1,87 +0,0 @@
|
||||
diff -up tuned-2.0.1/experiments/powertop2tuned.py.orig tuned-2.0.1/experiments/powertop2tuned.py
|
||||
--- tuned-2.0.1/experiments/powertop2tuned.py.orig 2012-04-03 19:25:37.000000000 +0200
|
||||
+++ tuned-2.0.1/experiments/powertop2tuned.py 2012-06-12 17:19:30.548102052 +0200
|
||||
@@ -44,12 +44,14 @@ stop() {
|
||||
process $@
|
||||
"""
|
||||
|
||||
-TUNED_CONF_PROLOG = "# Automatically generated by powertop2tuned tool"
|
||||
+TUNED_CONF_PROLOG = "# Automatically generated by powertop2tuned tool\n\n"
|
||||
TUNED_CONF_INCLUDE = """[main]
|
||||
%s
|
||||
+
|
||||
"""
|
||||
TUNED_CONF_EPILOG="""[powertop_script]
|
||||
type=script
|
||||
+replace=1
|
||||
script=script.sh
|
||||
"""
|
||||
|
||||
@@ -74,6 +76,8 @@ class PowertopHTMLParser(HTMLParser):
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
self.lastStartTag = tag
|
||||
+ if self.lastStartTag == "div" and dict(attrs)["id"] == "tuning":
|
||||
+ self.inProperTable = True
|
||||
if self.inProperTable and tag == "td":
|
||||
self.tdCounter += 1
|
||||
|
||||
@@ -92,8 +96,6 @@ class PowertopHTMLParser(HTMLParser):
|
||||
|
||||
def handle_data(self, data):
|
||||
prefix = self.prefix
|
||||
- if self.lastStartTag == "h2" and data == "Software settings in need of tuning":
|
||||
- self.inProperTable = True
|
||||
if self.inProperTable and self.tdCounter == 1:
|
||||
self.lastDesc = data
|
||||
if self.lastDesc.lower().find("autosuspend") != -1 and (self.lastDesc.lower().find("keyboard") != -1 or self.lastDesc.lower().find("mouse") != -1):
|
||||
@@ -103,10 +105,10 @@ class PowertopHTMLParser(HTMLParser):
|
||||
self.tdCounter = 0
|
||||
if not self.inScript:
|
||||
self.data += "\t# " + self.lastDesc + "\n"
|
||||
- self.data += "\t" + prefix + data
|
||||
+ self.data += "\t" + prefix + data.strip()
|
||||
self.inScript = True
|
||||
else:
|
||||
- self.data += data
|
||||
+ self.data += data.strip()
|
||||
|
||||
class PowertopProfile:
|
||||
BAD_PRIVS = 100
|
||||
@@ -132,16 +134,18 @@ class PowertopProfile:
|
||||
return True
|
||||
|
||||
def generateHTML(self):
|
||||
- f = tempfile.NamedTemporaryFile()
|
||||
- name = unicode(f.name)
|
||||
- f.close()
|
||||
-
|
||||
- ret = os.system('powertop --html="%s"' % (name))
|
||||
- if ret != 0:
|
||||
- os.unlink(name)
|
||||
- return ret
|
||||
+ proc = Popen(["powertop", "--html=/tmp/powertop"], stdout=PIPE)
|
||||
+ output = proc.communicate()[0]
|
||||
+ if proc.returncode != 0:
|
||||
+ return ret
|
||||
|
||||
- return name;
|
||||
+ prefix = "PowerTOP outputing using base filename "
|
||||
+ if output.find(prefix) == -1:
|
||||
+ return -1
|
||||
+
|
||||
+ name = output[output.find(prefix)+len(prefix):-1]
|
||||
+ #print "Parsed filename=", [name]
|
||||
+ return name
|
||||
|
||||
def parseHTML(self, enable_tunings):
|
||||
f = open(self.name)
|
||||
@@ -163,7 +167,7 @@ class PowertopProfile:
|
||||
print "Generating Tuned config file", os.path.join(self.output, "tuned.conf")
|
||||
f = open(os.path.join(self.output, "tuned.conf"), "w")
|
||||
f.write(TUNED_CONF_PROLOG)
|
||||
- if (new_profile):
|
||||
+ if (not new_profile):
|
||||
f.write(TUNED_CONF_INCLUDE % ("include=" + profile))
|
||||
f.write(TUNED_CONF_EPILOG)
|
||||
f.close()
|
34
tuned.spec
34
tuned.spec
@ -1,7 +1,7 @@
|
||||
Summary: A dynamic adaptive system tuning daemon
|
||||
Name: tuned
|
||||
Version: 2.0.1
|
||||
Release: 4%{?dist}
|
||||
Version: 2.0.2
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2
|
||||
# The source for this package was pulled from upstream git. Use the
|
||||
# following commands to get the corresponding tarball:
|
||||
@ -10,13 +10,13 @@ License: GPLv2
|
||||
# git checkout v%%{version}
|
||||
# make archive
|
||||
Source: tuned-%{version}.tar.bz2
|
||||
Patch0: tuned-powertop2.patch
|
||||
URL: https://fedorahosted.org/tuned/
|
||||
BuildArch: noarch
|
||||
BuildRequires: python, systemd-units
|
||||
Requires(post): systemd-units
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
Requires: python-decorator, dbus-python, pygobject2
|
||||
|
||||
%description
|
||||
The tuned package contains a daemon that tunes system settings dynamically.
|
||||
@ -26,11 +26,20 @@ power saving modes to adapt to the current usage. Currently only ethernet
|
||||
network and ATA harddisk devices are implemented.
|
||||
|
||||
%package utils
|
||||
Summary: Disk and net statistic monitoring systemtap scripts
|
||||
Requires: systemtap
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Summary: Various tuned utilities
|
||||
|
||||
%description utils
|
||||
The tuned-utils package contains several systemtap scripts to allow detailed
|
||||
This package contains utilities that can help you to fine tune your
|
||||
system and manage tuned profiles.
|
||||
|
||||
%package utils-systemtap
|
||||
Summary: Disk and net statistic monitoring systemtap scripts
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: systemtap
|
||||
|
||||
%description utils-systemtap
|
||||
This package contains several systemtap scripts to allow detailed
|
||||
manual monitoring of the system. Instead of the typical IO/sec it collects
|
||||
minimal, maximal and average time between operations to be able to
|
||||
identify applications that behave power inefficient (many small operations
|
||||
@ -46,7 +55,7 @@ It can be also used to fine tune your system for specific scenarios.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .powertop2
|
||||
|
||||
|
||||
%build
|
||||
|
||||
@ -103,6 +112,7 @@ fi
|
||||
%{_prefix}/lib/tuned
|
||||
%config(noreplace) %{_sysconfdir}/tuned/active_profile
|
||||
%{_sysconfdir}/tmpfiles.d
|
||||
%{_sysconfdir}/dbus-1/system.d/com.redhat.tuned.conf
|
||||
%{_unitdir}/tuned.service
|
||||
%dir %{_localstatedir}/log/tuned
|
||||
%dir %{_localstatedir}/run/tuned
|
||||
@ -111,6 +121,11 @@ fi
|
||||
|
||||
%files utils
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING
|
||||
%{_bindir}/powertop2tuned
|
||||
|
||||
%files utils-systemtap
|
||||
%defattr(-,root,root,-)
|
||||
%doc doc/README.utils
|
||||
%doc doc/README.scomes
|
||||
%doc COPYING
|
||||
@ -118,7 +133,6 @@ fi
|
||||
%{_sbindir}/netdevstat
|
||||
%{_sbindir}/diskdevstat
|
||||
%{_sbindir}/scomes
|
||||
%{_bindir}/powertop2tuned
|
||||
%{_mandir}/man8/varnetload.*
|
||||
%{_mandir}/man8/netdevstat.*
|
||||
%{_mandir}/man8/diskdevstat.*
|
||||
@ -135,6 +149,10 @@ fi
|
||||
%{_prefix}/lib/tuned/spindown-disk
|
||||
|
||||
%changelog
|
||||
* Mon Oct 08 2012 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.2-1
|
||||
- New version
|
||||
- Systemtap scripts moved to utils-systemtap subpackage
|
||||
|
||||
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user