Include its current affinity, cmdline, and cgroup. This may help
identify issues with tuning, e.g., in cases when the process
disappears soon after affining it fails.
Resolves: RHEL-69933
On some Thinkpad laptops, it is possible to change the ACPI
platform profile using function keys (e.g., Fn+L). This can
now trigger a complete profile change if the functionality
is enabled.
Resolves#710.
To be consistent and make sure tuned-ppd works well with
its users no matter the configuration, the balanced profile
must be required in the configuration file, similarly to
the power-saver and performance profiles.
If no default profile is specified in the configuration,
this also sets the default profile to balanced, not raising
any exceptions like before.
This makes tuned-ppd fully API-compatible with
the latest power-profiles-daemon. The property
will signify the level of API compatibility with
power-profiles-daemon.
Instead of querying TuneD each time we want to determine the active
TuneD profile, remember its value. Also watch for signals from TuneD,
updating the value when the TuneD profile changes (resolves#689).
The daemon now also keeps track of the "base" PPD profile, which is
restored when all profile holds are released or when tuned-ppd is
restarted. For the latter purpose, this profile is also saved in a file.
Direct access via two dictionaries (one for AC, one for DC)
was clumsy, this commit replaces it with a new class - ProfileMap.
Make sure that we only initialize the UPower signal
handler only if such a handler is not already running.
This also reorders the order of operations in the initialization
procedure, skipping redundant initial TuneD profile changes.
The bootloader plugin needs patched BLS entries with the TuneD variables.
It seems variables in the BLS entries is grub extension which is not
described in the BLS specification. It can cause boot problems with e.g.
systemd-boot, thus add variables to BLS entries only if the BLS entries
were generated by grub.
Resolves: rhbz#2323514
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
- improved conditionals for better readability
- fixed tuned-ppd not to run install twice
- used macro for profiles path
- consolidated names of related variables
- updated Makefile to update the current profile paths during
installation
- fixed tests to use correct profile directory on RHEL/CentOS
- consolidated whitespaces and variable names in fixed tests
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The perf.evlist.read_on_cpu function may return instances of
classes that do not have the type attribute, e.g. perf.lost_event.
Make sure we do not read the type attribute if we are not sure
that it exists.
Resolves: RHEL-60898
1. In the raise statement of the check_positive() function, the error message conflicts with the if condition.
2. If the value of val is 0, it passes the if condition but raises an error message stating [0 has to be >= 0].
3. This PR removes the = from the raise statement, so when val is 0,
it will correctly prompt that the value of val [has to be > 0].
Signed-off-by: dufuhang <dufuhang@kylinos.cn>
Need to expand variables before calling the @command function. This is
actually done for _execute_all[_non]_device_commands and
_verify_all_non_device_commands, but not in _verify_all_device_commands.
This adds the missing expansion.
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Systemd reads all conf files from a service drop-in directory and merges
them.
This change enables the following use case:
Tuning unrelated but local changes can be put into - say:
/etc/systemd/system/sfptpd.service.d/local.conf
while a simple tuning such as the process affinity mask is rolled out
via a tuned profile, like this:
`tuned.conf` snippet:
```
[service]
service.sfptpd=,file:${i:PROFILE_DIR}/tuned-sfptpd.conf
```
`tuned-sfptpd.conf`:
```
[Service]
CPUAffinity=32
```
---
Arguably, this is a natural change, i.e. it establishes symmetry in
`cfg_install()` to `cfg_uninstall()`, because `cfg_uninstall()` already
allows for the service drop-in directory not being empty.
The no_turbo knob only recognizes 0 or 1, so we have to
convert the option value defined in the profile to an
integer if necessary.
Related: #630
Resolves: RHEL-51760
Since 6ef5b58e , switch_profile expects self._on_battery to be
set, but when it's called in Controller.initialize, it is
called before we do self._on_battery = False , and will crash
with
AttributeError: 'Controller' object has no attribute '_on_battery'
if the requested profile is not the currently active one.
This fixes that by moving the call to switch_profile after
self._on_battery is set.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
Not clearing it before a profile switch would
result in never deleting the original plugin
objects - those would accumulate in memory with
each profile switch.
Relates: RHEL-36442
Before the `scheduler` plugin, `tuna` was used for CPU isolation.
There is a leftover use in the verification of the `realtime` profile.
Removing that, the dependency on the `tuna` package, and now-empty
scripts from the realtime profiles.
closes#594
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
The shell functions in profiles/functions related to irqbalance configuration
have been unused since 462df2610c. Remove them.
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
The option IRQBALANCE_BANNED_CPUS we're currently using has been deprecated [1],
so switch to IRQBALANCE_BANNED_CPULIST instead.
closes#656
[1] c995237885
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>