- Updated documentation
- Few more fixes for tuned-adm
This commit is contained in:
parent
d4e52c51dd
commit
b596ac9f1f
8 changed files with 102 additions and 99 deletions
7
Makefile
7
Makefile
|
|
@ -9,13 +9,12 @@ GITTAG = v$(VERSION)
|
|||
|
||||
DIRS = doc contrib tuningplugins monitorplugins ktune commands
|
||||
FILES = tuned tuned.spec Makefile tuned.py tuned.initscript tuned.conf tuned-adm
|
||||
FILES_doc = doc/DESIGN.txt doc/README.utils doc/TIPS.txt doc/tuned.8 doc/tuned.conf.5 doc/README.scomes
|
||||
FILES_doc = doc/DESIGN.txt doc/README.utils doc/TIPS.txt doc/tuned.8 doc/tuned.conf.5 doc/tuned-adm.1 doc/README.scomes
|
||||
FILES_contrib = contrib/diskdevstat contrib/netdevstat contrib/scomes contrib/varnetload
|
||||
FILES_tuningplugins = tuningplugins/cpu.py tuningplugins/disk.py tuningplugins/net.py tuningplugins/__init__.py
|
||||
FILES_monitorplugins = monitorplugins/cpu.py monitorplugins/disk.py monitorplugins/net.py monitorplugins/__init__.py
|
||||
FILES_ktune = ktune/ktune.init ktune/ktune.sysconfig ktune/sysctl.ktune ktune/README.ktune
|
||||
FILES_commands = commands/cmd_default_mode.py commands/cmd_off_mode.py commands/cmd_list.py \
|
||||
commands/cmd_modes.py commands/__init__.py
|
||||
FILES_commands = commands/cmd_off_mode.py commands/cmd_list.py commands/cmd_profile.py commands/__init__.py
|
||||
DOCS = AUTHORS ChangeLog COPYING INSTALL NEWS README
|
||||
|
||||
distarchive: tag archive
|
||||
|
|
@ -96,6 +95,8 @@ install:
|
|||
install -m 0644 doc/tuned.8 $(DESTDIR)/usr/share/man/man8
|
||||
mkdir -p $(DESTDIR)/usr/share/man/man5
|
||||
install -m 0644 doc/tuned.conf.5 $(DESTDIR)/usr/share/man/man5
|
||||
mkdir -p $(DESTDIR)/usr/share/man/man1
|
||||
install -m 0644 doc/tuned-adm.1 $(DESTDIR)/usr/share/man/man1
|
||||
|
||||
# Install ktune
|
||||
install -m 755 -d $(DESTDIR)/etc
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import glob
|
||||
import kobo.shortcuts
|
||||
from kobo.cli import Command
|
||||
|
||||
class Default(Command):
|
||||
"""star ktune and tuned with default settings"""
|
||||
enabled = True
|
||||
|
||||
def options(self):
|
||||
self.parser.usage = "%%prog %s" % self.normalized_name
|
||||
|
||||
self.parser.add_option(
|
||||
"--show-disabled",
|
||||
default=False,
|
||||
action="store_true",
|
||||
help="show disabled workers"
|
||||
)
|
||||
|
||||
|
||||
def run(self, *args, **kwargs):
|
||||
os.system('service ktune start')
|
||||
os.system('chkconfig --add ktune && chkconfig --level 345 ktune on')
|
||||
os.system('service tuned start')
|
||||
os.system('chkconfig --add tuned && chkconfig --level 345 tuned on')
|
||||
|
||||
# usb_devices = glob.glob('/sys/bus/usb/devices/?-?/')
|
||||
# for i in usb_devices:
|
||||
# retcode, output = kobo.shortcuts.run('echo 2 > %spower/autosuspend' % i)
|
||||
# retcode, output = kobo.shortcuts.run('echo auto > %spower/level' % i)
|
||||
|
|
@ -7,7 +7,7 @@ import kobo.shortcuts
|
|||
from kobo.cli import Command
|
||||
|
||||
class List(Command):
|
||||
"""list of modes"""
|
||||
"""list all available profiles"""
|
||||
enabled = True
|
||||
|
||||
def options(self):
|
||||
|
|
|
|||
|
|
@ -31,7 +31,3 @@ class Off(Command):
|
|||
os.system('service tuned stop')
|
||||
os.system('chkconfig --del ktune')
|
||||
os.system('chkconfig --del tuned')
|
||||
usb_devices = glob.glob('/sys/bus/usb/devices/?-?/')
|
||||
# test whether usb suspend is on
|
||||
for i in usb_devices:
|
||||
retcode, output = kobo.shortcuts.run('echo on > %spower/level' % i)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import glob
|
|||
import kobo.shortcuts
|
||||
from kobo.cli import Command
|
||||
|
||||
class Modes(Command):
|
||||
"""set mode"""
|
||||
class Profile(Command):
|
||||
"""<profile> switch to given profile"""
|
||||
enabled = True
|
||||
|
||||
def options(self):
|
||||
|
|
@ -26,6 +26,11 @@ class Modes(Command):
|
|||
enablektune = False
|
||||
enabletuned = False
|
||||
if len(args) == 0:
|
||||
print "No profile given. To list all available profiles please run:"
|
||||
print "tuned-adm list"
|
||||
return
|
||||
if not os.path.exists("/etc/tune-profiles/"+args[0]):
|
||||
print "No profile with name %s found." % args[0]
|
||||
return
|
||||
if os.path.exists("/etc/tune-profiles/"):
|
||||
os.system('service ktune stop')
|
||||
|
|
@ -34,7 +39,7 @@ class Modes(Command):
|
|||
os.system('chkconfig --add tuned && chkconfig --level 345 tuned off')
|
||||
modes = os.listdir("/etc/tune-profiles")
|
||||
if modes > 0:
|
||||
print 'Mode %s' % args[0]
|
||||
print 'Switching to profile %s' % args[0]
|
||||
if os.path.exists('/etc/ktune.d/tunedadm.sh'):
|
||||
os.remove('/etc/ktune.d/tunedadm.sh')
|
||||
if os.path.exists('/etc/ktune.d/tunedadm.conf'):
|
||||
83
doc/tuned-adm.1
Normal file
83
doc/tuned-adm.1
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
.\"/*
|
||||
.\" * All rights reserved
|
||||
.\" * Copyright (C) 2009 Red Hat, Inc.
|
||||
.\" * Authors: Marcela Mašláňová, Phil Knirsch
|
||||
.\" *
|
||||
.\" * This program is free software; you can redistribute it and/or
|
||||
.\" * modify it under the terms of the GNU General Public License
|
||||
.\" * as published by the Free Software Foundation; either version 2
|
||||
.\" * of the License, or (at your option) any later version.
|
||||
.\" *
|
||||
.\" * This program is distributed in the hope that it will be useful,
|
||||
.\" * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
.\" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
.\" * GNU General Public License for more details.
|
||||
.\" *
|
||||
.\" * You should have received a copy of the GNU General Public License
|
||||
.\" * along with this program; if not, write to the Free Software
|
||||
.\" * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
.\" */
|
||||
.\"
|
||||
.TH TUNED_ADM "1" "9 Jul 2009" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
tuned-adm \- commandline tool for switching between different tuning profiles
|
||||
.SH SYNOPSIS
|
||||
.B tuned-adm
|
||||
.B
|
||||
.BR [ " help ", " list ", " profile <profile> ", " off " ]
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
This command line utility allows user to switch between user definable tuning profiles. Several predefined profiles are already included for some of the more common cases.
|
||||
.SH "OPTIONS"
|
||||
|
||||
.SS
|
||||
.TP
|
||||
.B help
|
||||
Print out the list of commands. It's also the default if you start tuned-adm without any commands.
|
||||
|
||||
.TP
|
||||
.B list
|
||||
List all available profiles.
|
||||
|
||||
.TP
|
||||
.B profile <profile>
|
||||
Switches to the given profilename. If none is given or no valid one is given the command gracefully exits without performing any operation.
|
||||
|
||||
.TP
|
||||
.B off
|
||||
Switch off all ktune and tuned settings and remove them from services. The configuration file are
|
||||
set to previous settings.
|
||||
|
||||
.SH PREDEFINED PROFILES
|
||||
At the moment we're providing the following pre defined profiles:
|
||||
|
||||
.TP
|
||||
.BI "desktop-powersave"
|
||||
Very light powersaving profile directed at desktop systems.
|
||||
|
||||
.TP
|
||||
.BI server-powersave
|
||||
Very light powersaving profile directed at server systems.
|
||||
|
||||
.TP
|
||||
.BI laptop-ac-powersave
|
||||
Medium powersaving profile directed at laptops running on AC.
|
||||
|
||||
.TP
|
||||
.BI laptop-battery-powersave
|
||||
Strong powersaving profile directed at laptops running on battery. This profile will affect the overall performance of the system as a tradeoff for typically longer running time on battery power.
|
||||
|
||||
.TP
|
||||
.BI throughput-performance
|
||||
Sever profile for typical througput performance tuning.
|
||||
|
||||
.TP
|
||||
.BI latency-performance
|
||||
Sever profile for typical latency performance tuning.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR tuned (8)
|
||||
.SH AUTHOR
|
||||
.nf
|
||||
Marcela Mašláňová <mmaslano@redhat.com>
|
||||
Phil Knirsch <pknirsch@redhat.com>
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
.\"/*
|
||||
.\" * All rights reserved
|
||||
.\" * Copyright (C) 2009 Red Hat, Inc.
|
||||
.\" * Authors: Marcela Mašláňová
|
||||
.\" *
|
||||
.\" * This program is free software; you can redistribute it and/or
|
||||
.\" * modify it under the terms of the GNU General Public License
|
||||
.\" * as published by the Free Software Foundation; either version 2
|
||||
.\" * of the License, or (at your option) any later version.
|
||||
.\" *
|
||||
.\" * This program is distributed in the hope that it will be useful,
|
||||
.\" * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
.\" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
.\" * GNU General Public License for more details.
|
||||
.\" *
|
||||
.\" * You should have received a copy of the GNU General Public License
|
||||
.\" * along with this program; if not, write to the Free Software
|
||||
.\" * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
.\" */
|
||||
.\"
|
||||
.TH TUNED_ADM "1" "9 Jul 2009" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
tuned-adm \- commandline tool for setting the power-save options
|
||||
.SH SYNOPSIS
|
||||
.B tuned-adm
|
||||
.B
|
||||
.BR help ", " laptop ", " server ", " default ", " off "
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
This command line utility allows user to set profile for server or laptop.
|
||||
.SH "OPTIONS"
|
||||
|
||||
.SS
|
||||
.TP
|
||||
.B help
|
||||
Print out the list of commands.
|
||||
|
||||
.TP
|
||||
.B laptop
|
||||
|
||||
.TP
|
||||
.B server
|
||||
These settings are calling ktune which set up different values for better resource consumption.
|
||||
It also switch on tuned daemon and add ktune and tuned into chkconfig. Usbsuspend is set.
|
||||
|
||||
.TP
|
||||
.B off
|
||||
Switch off all ktune and tuned settings and remove them from services. The configuration file are
|
||||
set to previous settings.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR tuned (8)
|
||||
.SH AUTHOR
|
||||
.nf
|
||||
Marcela Mašláňová <mmaslano@redhat.com>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
Summary: A dynamic adaptive system tuning daemon
|
||||
Name: tuned
|
||||
Version: 0.2.2
|
||||
Version: 0.2.3
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
Group: System Environment/Daemons
|
||||
|
|
@ -78,6 +78,7 @@ fi
|
|||
%{_sbindir}/tuned-adm
|
||||
%{_sysconfdir}/tune-profiles
|
||||
%{_datadir}/tuned
|
||||
%{_mandir}/man1/*
|
||||
%{_mandir}/man5/*
|
||||
%{_mandir}/man8/*
|
||||
%attr(0755,root,root) %{_initddir}/ktune
|
||||
|
|
@ -96,6 +97,10 @@ fi
|
|||
|
||||
|
||||
%changelog
|
||||
* Tue Aug 18 2009 Phil Knirsch <pknirsch@redhat.com> 0.2.3-1
|
||||
- Updated documentation
|
||||
- Few more fixes for tuned-adm
|
||||
|
||||
* Fri Aug 14 2009 Phil Knirsch <pknirsch@redhat.com> 0.2.2-1
|
||||
- Updates to the ktune scripts
|
||||
- Added support for start/stop of the ktune scripts and ktune initscript
|
||||
|
|
|
|||
Loading…
Reference in a new issue