1
0
Fork 0
Commit graph

793 commits

Author SHA1 Message Date
Ondřej Lysoněk
0fb2933fd4 Perform command cleanup in reversed order
Clean up device and non-device commands it reversed order, compared to
the order in which they were applied. It makes more sense that way to me.

Related: rhbz#1246176

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-08 15:37:33 +01:00
Jaroslav Škarvada
5e9c3d264f
cpu-partitioning: minor indentation fix
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-07 17:37:25 +01:00
Jaroslav Škarvada
6906738603
cpu-partitioning: kernel cmdline parameter changed to tuned.non_isolcpus
It's more descriptive to use 'tuned.non_isolcpus' kernel boot command line
parameter for dracut preudev scripts provided by Tuned than the
previously used 'tuned.cpumask'.

Related: rhbz#1395899

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-07 15:30:56 +01:00
Jaroslav Škarvada
6350862bbd
scsi_host: fixed probing of ALPM, missing ALPM logged as info
Resolves: rhbz#1416712

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-06 10:46:02 +01:00
Jaroslav Škarvada
64decfe756 cpu-partitioning: set workqueue affinity early
This adds 00-tuned-pre-udev.sh script into initrd image which is getting
tuned.cpumask kernel command line parameter and sets workqueue affinity
accordingly.

Resolves: rhbz#1395899

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 19:01:48 +01:00
Jaroslav Škarvada
843dc8cf5f cpu-partitioning: set CPUAffinity early in initrd image
Resolves: rhbz#1394965

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 18:28:32 +01:00
Jaroslav Škarvada
4eadc691fc bootloader: added option initrd_remove_dir
To remove the source directory from which the initrd image is build, the
following can be used:

[bootloader]
initrd_remove_dir = True
initrd_add_dir = /tmp/tuned-initrd.img

This will create initrd image from the /tmp/tuned-initrd.img directory and
and then it removes the tuned-initrd.img directory from the /tmp.

Related: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 18:11:22 +01:00
Jaroslav Škarvada
d89ab6731b bootloader: remove initrd image during cleanup
Related: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-03 14:58:24 +01:00
Jaroslav Škarvada
00746dc674 Makefile: fixed nightly target to delete old files from the nightly repo
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-02 15:07:02 +01:00
Jaroslav Škarvada
8cef7cdb21 bootloader: fixed workdir autodetection
Also updated the core Tuned engine to support instance.workdir to get
the directory name the profile was loaded from.

Related: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-02 14:59:47 +01:00
Jaroslav Škarvada
a77119aff0 tuned: fixed exception if there is an option without section in profile
e.g. the following caused an exception:
include=profile

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-02 11:41:35 +01:00
Jaroslav Škarvada
1ba523b1f3 Merge branch 'master' of github.com:redhat-performance/tuned 2017-03-01 16:08:21 +01:00
Jaroslav Škarvada
047a7335b0 bootloader: add support for initrd overlays
The bootloader plugin now supports the following options:
  initrd_add_img=IMAGE
  initrd_add_dir=DIR
  initrd_dst_img=PATHNAME

The 'initrd_add_img' adds initrd overlay named IMAGE. The IMAGE is
added from the current profile directory. If IMAGE begins with '/' it's
taken as absolute path (e.g. initrd_add_img="/root/overlay.img").

The 'initrd_add_dir' creates initrd image from the DIR at first and then
adds the image as a overlay. The DIR is taken from the current profile
directory. If DIR begins with '/' it's taken as absolute path.

The 'initrd_dst_img' sets the name and location of the resulting initrd
image. Usually it is not needed to set it. By default the location of
initrd images is /boot and the name of the image is taken as a basename
of IMAGE or DIR. This can be overridden by 'initrd_dst_img'

Currently grub2-mkconfig doesn't support initrd overlays, so the initrd
settings are lost after 'grub2-mkconfig -o /boot/grub2/grub.cfg' is
issued. There is grub2 RFE bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1427899

Resolves: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-01 15:56:17 +01:00
Jaroslav Škarvada
e5df1728af Merge pull request #22 from olysonek/udev_pr
Assign hotplugged devices based on udev matching too
2017-03-01 15:54:37 +01:00
Jaroslav Škarvada
47c1bf24c7 Merge pull request #21 from olysonek/plugin_cleanup
Fix plugin cleanup
2017-03-01 15:52:09 +01:00
Ondřej Lysoněk
4a452dd157 Fix plugin cleanup
The plugins were not getting cleaned up properly, so e.g. after
a profile switch instances of the Plugin class would get piled up.

This fixes commit 363d74815a.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-01 10:36:29 +01:00
Jaroslav Škarvada
f775a3cab0 Merge pull request #20 from olysonek/udev_pr
Implement udev-based device matching
2017-03-01 10:09:41 +01:00
Ondřej Lysoněk
2a092a2739 Assign hotplugged devices based on udev matching too
Resolves: rhbz#1251240
This fixes commit f14ae65bd2.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-03-01 09:03:06 +01:00
Ondřej Lysoněk
f14ae65bd2 Implement udev-based device matching
A new option 'devices_udev_regex' can be used in profile
configuration to specify devices to which a plugin instance
should be applied.

The option can contain a python regular expression, as specified
in https://docs.python.org/2/library/re.html#regular-expression-syntax.
The expression is effectively matched against the output of
udevadm info --query=property -n <device_path>

If the option 'devices_udev_regex' is specified, the 'devices' option
is ignored. If it is not specified, then the matching is done the same
way as previously, i.e. against 'devices'.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-28 17:39:07 +01:00
Jaroslav Škarvada
4c1ed69f4a Merge pull request #19 from olysonek/pr
Remove the '_devices' attribute in plugins
2017-02-28 13:19:48 +01:00
Ondřej Lysoněk
a38b6eee99 Remove the '_devices' attribute in plugins
The _device attribute should always be the same as the union of
_assigned_devices and _free_devices, therefore it's redundant.
Its existence in my opinion brings only confusion and a potential
source of inconsistencies.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-27 14:54:46 +01:00
Jaroslav Škarvada
4b66f79290 Merge pull request #18 from olysonek/pr
Assign hotplugged devices in priority order too
2017-02-27 14:30:46 +01:00
Ondřej Lysoněk
bd3749fddd Assign hotplugged devices in priority order too
Resolves: rhbz#1246172

This fixes commit 363d74815a.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-27 14:14:04 +01:00
Jaroslav Škarvada
82f1a9a19d plugins: renamed instance_priority to priority
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-02-22 01:16:23 +01:00
Jaroslav Škarvada
5b1316a361 plugins: log instance name together with the plugin if it differs
I.e.

[myaudio]
type=audio

Will show in log as:
myaudio (audio)

and:
[audio]

Will show in log as:
audio

I.e. if the instance name and the plugin name is the same it will
not log the plugin name in braces.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-02-17 18:22:34 +01:00
Jaroslav Škarvada
9cf6c3f45c Merge pull request #16 from olysonek/instance_priority_pr
Implement instance priority
2017-02-17 16:45:02 +01:00
Ondřej Lysoněk
363d74815a Implement instance priority
Resolves: rhbz#1246172

Allow specifying order in which individual plugin instances are to be
executed.

Each instance can be given the 'instance_priority' option
in the profile configuration. The value must be an integer (it can be
negative). If no priority is specified, it is inherited from the parent
profile, or set to the default instance priority, if no parent profile
specifies the priority for that instance.

The default instance priority is by default zero, but it can be set to
a different value using the 'default_instance_priority' option in the
global configuration file.

Creating plugin instances, assigning devices to instances, initializing
instances, applying, updating and verifying tuning are all done in order
from lowest numerical instance priority to highest. Unapplying tuning and
destroying instances is done in reversed order.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-17 15:56:11 +01:00
Jaroslav Škarvada
82546e3027 Merge pull request #15 from olysonek/make_lint
Print path to affected files on 'make lint'
2017-02-17 12:46:17 +01:00
Jaroslav Škarvada
9e99925a9f Merge pull request #14 from olysonek/log_to_file
Fix logging to file in the current directory
2017-02-16 15:13:05 +01:00
Ondřej Lysoněk
233cf61a34 Print path to affected files on 'make lint'
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-16 14:41:04 +01:00
Jaroslav Škarvada
78c0319e4f Merge pull request #13 from olysonek/make_lint
Add 'lint' target to Makefile
2017-02-16 10:08:20 +01:00
Ondřej Lysoněk
abb5a104d9 Fix logging to file in the current directory
Previously if you ran 'tuned -l log', it would crash with:
OSError: [Errno 2] No such file or directory: ''
This patch fixes the bug.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-16 09:38:42 +01:00
Ondřej Lysoněk
0f22a5e12c Simplify the 'lint' target in Makefile
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-16 09:17:19 +01:00
Jaroslav Škarvada
16654bfa3e Merge pull request #12 from olysonek/remove_gtk_manager
Remove tuned.gtk.manager
2017-02-14 17:44:33 +01:00
Jaroslav Škarvada
035eabd286 Merge pull request #11 from olysonek/pylint_fixes
Pylint fixes
2017-02-14 17:43:12 +01:00
Jaroslav Škarvada
6ea51e3d91 Merge pull request #10 from olysonek/plugin_selinux
plugin_selinux: Import exceptions
2017-02-14 17:38:32 +01:00
Jaroslav Škarvada
ee22e87e60 Merge pull request #6 from olysonek/NotImplementedError
Raise NotImplementedError instead of NotImplemented
2017-02-14 17:22:13 +01:00
Jaroslav Škarvada
d9101ada39 Merge pull request #5 from olysonek/remove_unreachable
Remove an unreachable return statement
2017-02-14 17:19:52 +01:00
Ondřej Lysoněk
4488b3a0e4 Add 'lint' target to Makefile
The target executes pylint on all *.py files, except for those
in the ./tests and ./experiments subdirectories.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-14 16:49:27 +01:00
Ondřej Lysoněk
53325ff3cd Remove tuned.gtk.manager
Remove the tuned.gtk.manager module. It doesn't seem to have been used
anywhere _ever_, it's broken (the only class it contains calls
a constructor with incorrect number of parameters) and it seems to be
completely useless anyway.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-14 15:46:08 +01:00
Ondřej Lysoněk
8e6827c898 GUI: Fix some pylint errors
This fixes the following pylint errors:
************* Module tuned.gtk.gui_plugin_loader
E:145,18: TunedException is not callable (not-callable)
E: 45,11: Undefined variable name 'GTKPluginLoader' in __all__ (undefined-all-variable)

************* Module tuned.gtk.managerException
E: 44, 4: method already defined line 41 (function-redefined)

************* Module tuned.gtk.gui_profile_loader
E:126, 4: method already defined line 95 (function-redefined)

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-14 15:32:01 +01:00
Ondřej Lysoněk
e1632568c6 Fix some pylint errors
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-14 12:51:11 +01:00
Ondřej Lysoněk
316f9b5bc3 plugin_loader: Pylint fix
Initialize some attributes of PluginLoader to avoid the following
pylint errors:
E: 21,14: Instance of 'PluginLoader' has no '_namespace' member (no-member)
E: 22,14: Instance of 'PluginLoader' has no '_prefix' member (no-member)
E: 23,14: Instance of 'PluginLoader' has no '_interface' member (no-member)

The attributes were initialized only in subclasses.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-14 12:45:00 +01:00
Ondřej Lysoněk
43a8b706b1 plugin_bootloader: Rename _grub2_cfg_file attribute
Rename the _grub2_cfg_file attribute to _grub2_cfg_file_name. This is to
avoid the following pylint error message:
An attribute defined in tuned.plugins.plugin_bootloader line 30 hides this method.

The fact that the method was hidden didn't present itself in any way
during execution, because the method had been saved in a collection
(and accessed only from the collection after that) prior to becoming
hidden.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-14 12:44:00 +01:00
Jaroslav Škarvada
e9a352e16f Merge pull request #9 from olysonek/plugin_scsi_host
plugin_scsi_host: Mark _device_is_supported as a classmethod
2017-02-13 22:11:04 +01:00
Jaroslav Škarvada
df5a43ee36 Merge pull request #8 from olysonek/_device_is_supported
plugin_disk: Mark _device_is_supported as a classmethod
2017-02-13 22:09:59 +01:00
Jaroslav Škarvada
c256075c82 Merge pull request #7 from olysonek/readahead_multiply
plugin_disk: Fix setting 'readahead_multiply'
2017-02-13 22:04:02 +01:00
Ondřej Lysoněk
fe889fd1e5 plugin_selinux: Import exceptions
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-13 17:50:40 +01:00
Ondřej Lysoněk
571910e750 plugin_scsi_host: Mark _device_is_supported as a classmethod
This fixes a pylint error.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-13 17:44:34 +01:00
Ondřej Lysoněk
ad6d18bb62 plugin_disk: Mark _device_is_supported as a classmethod
This fixes a pylint error.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-02-13 17:36:10 +01:00