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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Provide the correct number of parameters to the '_set_readahead' method.
This fixes a traceback when setting the 'readahead_multiply' option.
I assume the 'sim' parameter to '_set_readahead' means 'simulated' (it
is handled in that sense), so we should set the value to False, because
we are actually enabling/disabling the tunning here.
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Now it supports the following extended syntax:
parent profile:
[bootloader]
cmdline=opt1 opt2
child profile:
[bootloader]
cmdline1=+opt3
cmdline2=opt4
cmdline3=-opt2
Resulting cmdline:
opt1 opt3 opt4
It recognizes "cmdline*" and postprocess it to extend the inheritance.
It recognizes '+' and '-' on the very beginning of the option and adds
or removes the string from the command line. When using
'+' or '-' it takes the string after the sign till end of the line. To
add option starting with e.g. '+' you need to use '++opt'. If '+' is
omitted in succesive command lines, it's taken implicitly (e.g. opt4).
If you need to replace the whole command line in child profile, use:
[bootloader]
replace=true
cmdline=opt1 opt2
This will drop all 'cmdline*' setting from the parent profile(s).
Resolves: rhbz#1274464
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Otherwise, a process running on isolated CPUs will be
interrupted by timers or unwanted VM exists.
Resolves: rhbz#1395855
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit introduces functions to create and delete the
kvm modprobe file used by the realtime profiles.
This is needed because the cpu-partitioning profile wants
the same modprobe file for kvm.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
As the cpu-partitioning profile does not use isolcpus=,
the kernel can end up creating long living timers on
nohz_full CPUs during early boot. Those timers will
fire later, causing jitter.
However, recent Linux kernel will always try to migrate
unpinned timers away from nohz_full CPUs when timer
migration is enabled which is what we want.
NOTE: Older kernels would migrate unpinned timers from
idle CPUs to busy CPUs without regard if the
CPU is nohz_full. This would certainly cause
trouble to applications that takes 100% of the
CPU in user-space (eg. DPDK). So, enabling
timer migration is only safe on recent kernels.
Resolves: rhbz#1408308
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>