1
0
Fork 0
Commit graph

613 commits

Author SHA1 Message Date
Jaroslav Škarvada
8ec878cb50 realtime: fixed / simplified profile according to comments
tuna now do isolation of cores (-i)

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-23 09:15:57 +02:00
Jaroslav Škarvada
740fab40ec realtime: moved variables to /etc/tuned/realtime-variables.conf
And some minor tweaks.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-22 17:32:35 +02:00
Jaroslav Škarvada
46f1968bce profiles: added realtime
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-18 17:21:09 +02:00
Jaroslav Škarvada
287c4ad19d cpulist_invert: fixed function name
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-18 14:29:47 +02:00
Jaroslav Škarvada
0574393350 verify: support long patterns with leading zeroes, e.g.: 00000000,00000001
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-18 12:22:23 +02:00
Jaroslav Škarvada
e2837a5dfa plugin_disk: improved handling of cases there is no hdparm command
If there is no hdparm command it now outputs warning to the log, disables
all hdparm related commands and no hdparm execution error is output.

Related: rhbz#1191775

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-18 09:46:40 +02:00
Jaroslav Škarvada
f4a7d1c71f plugin_script: CWD to the script directory
This allows runnig helper scripts from the main script by just using
the current directory './' path, e.g. to run helper_script from main script:

  ./helper_script

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-17 23:41:00 +02:00
Jaroslav Škarvada
3987d03137 plugin_bootloader: improved RE in find & replace to better match WS
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-17 22:22:01 +02:00
Jaroslav Škarvada
468c12502e plugin_disk: disabled both set_apm, set_spindown if there is no hdparm
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-16 16:54:43 +02:00
Jaroslav Škarvada
f35bdee22e plugin_disk: ignore set_apm, set_spindown if there is no hdparm command
Related: rhbz#1193682

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-16 16:15:54 +02:00
Jaroslav Škarvada
6c155396ee hotplug: do not apply dynamic tuning if dynamic tuning is disabled
Resolves: rhbz#1193682

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-16 15:04:15 +02:00
Jaroslav Škarvada
446596ebdc profiles: added oracle profile
Resolves: rhbz#1196298

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-16 11:14:51 +02:00
Jaroslav Škarvada
63e58502a7 man: fixed 'tuned-adm off' description
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-15 18:46:20 +02:00
Jaroslav Škarvada
6a258aed9d plugin_scheduler: added support for variables
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-12 16:21:09 +02:00
Jaroslav Škarvada
bdee52b7a5 Makefile: added support for scratch build
There is continuous integration Jenkins bind to the scratch builds.
By running scratch build during the nightly build all tests will be
run by Jenkins.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-11 14:46:08 +02:00
Jaroslav Škarvada
df25bb8775 recommend: added generic file check
Example of recommend.conf content:

[powersave]
/etc/machine.conf=.*laptop.*

This will recommend powersave profile if there is /etc/machine.conf containing
string 'laptop'. The check will not match if the file doesn't exist.

To just check for file existence:

[powersave]
/etc/machine.conf=.*

This will match if there is /etc/machine.conf file.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 17:11:49 +02:00
Jaroslav Škarvada
c73bc90ae8 recommend: add global config option to disable 'recommend' functionality
On some platforms the 'recommend' functionality doens't make sense
as there is only one product variant. On such platforms the recommend
functionality can be disabled by adding/changing the following in
the global config (/etc/tuned/tuned-main.conf):

recommend_command = 0

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 16:26:36 +02:00
Jaroslav Škarvada
d2043dfaf3 Makefile: fixed rsync to sync nightlies to correct directory
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 14:41:42 +02:00
Jaroslav Škarvada
b882627a07 plugin_cpu: added check whether CPU has scaling governor/driver
If there is no scaling governor/driver, the CPU is silently skipped when setting
governor.

Related: rhbz#1212836

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 14:29:43 +02:00
Jaroslav Škarvada
36370c4802 functions: added 'cpulist2hex_invert' built-in function
It converts CPU list to hexadecimal CPU mask and inverts it.

Example:

[variables]
cpus = ${f:cpulist2hex_invert:1-2}

On machine with four CPUs it returns 00000009.

Related: rhbz#1225135

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 13:53:36 +02:00
Jaroslav Škarvada
873679270a functions: added support for hexmasks with commas
It's possible to combine CPU lists with hexmasks, but hexmask needs to be
prefixed by "0x". Hexmasks can include commas. To separate hexmask from
CPU list use double comma ',,' (there can be whitespaces between commas)

Example:

[variables]
cpus = ${f:cpulist_unpack:1-2,0x8,ffffffff,,37-39}

It's also possible to separate hexmasks and CPU list by specifying
CPU list as another argument, e.g.:

[variables]
cpus = ${f:cpulist_unpack:1-2,0x8,ffffffff:37-39}

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 12:17:47 +02:00
Jaroslav Škarvada
d172b5bd8d functions: cpulist_invert code moved to utils
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 17:53:55 +02:00
Jaroslav Škarvada
dfdbd88e67 functions: added autodetection of format to cpulist_unpack
Now CPUs starting with 0x are taken as hexmask. As cpulist_unpack
is used as preprocessor of CPU list for other built-in functions
this also works with other functions (e.g. cpulist_invert).

Example:

[variables]
cpus = ${f:cpulist_invert:1-2,0x8}

On four CPU machines (CPUs 0-3) it expands to '0'.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 17:09:40 +02:00
Jaroslav Škarvada
957922d3d7 Makefile: add git short hash suffix to mock devel builds
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 16:42:10 +02:00
Jaroslav Škarvada
e27fdfdfea Makefile: used rsync instead of scp for nightlies upload
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 15:30:12 +02:00
Jaroslav Škarvada
e5a69c2bae functions: renamed built-in function cpus_online to cpulist_online
Renamed to stay consistent.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 14:31:11 +02:00
Jaroslav Škarvada
6168d5e2e6 functions: added 'cpulist_invert' built-in function
Inverts list of CPUs (makes its complement). For the complement it
gets number of present CPUs from the /sys/devices/system/cpu/present,
e.g. system with 4 CPUs (0-3), the inversion of list "0,2,3" will be "1".

Related: rhbz#1225135

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 14:21:50 +02:00
Jaroslav Škarvada
246854f524 functions: optimisation of 'cpus_online' built-in function
Now it operates over CPU sets parsed from /sys/devices/system/cpu/online
and it no more checks each CPU from the list individually for its online
status.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 14:11:31 +02:00
Jaroslav Škarvada
b7981e7b5e functions: added cpulist_unpack built-in function
Usage:

[variables]
cpus = ${f:cpulist_unpack:1,2,3-5}

The 'cpus' will be set to '1,2,3,4,5'. Also the built-in function can take
arbitrary number of arguments which will be concatenated, e.g.:

[variables]
cpus = ${f:cpulist_unpack:1-3,5:6-7,9}

This means two arguments to 'cpulist_unpack' function. The first argument:
'1-3,5' and the second '6-7,9'. The result: '1,2,3,5,6,7,9'.

Also renamed internal function 'unpack_cpulist' to 'cpulist_unpack' to be
more consistent.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-08 13:44:48 +02:00
Jaroslav Škarvada
a6f4fca71d functions: added CPU list to hex mask and vice versa conversions
Added following functions:

cpulist2hex - converts CPU list to hexadecimal mask, takes arbitrary number of
              arguments, each argument can also contain "compact values",
              e.g.: "${f:cpulist2hex:0-3,4:5-6}".

hex2cpulist - converts hexadecimal mask to CPU list, takes one argument,
              the hexadecimal mask.

cpus_online - checks whether CPUs from the list (which is formatted the same
              way as with cpulist2hex) are online, returns only those which
              are online.

Example:

[variables]
cpus = ${f:hex2cpulist:0x0000001f}
online = ${f:cpus_online:${cpus}}

Related: rhbz#1225135

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-05 19:12:52 +02:00
Jaroslav Škarvada
8968280a4f tuned: added support for built-in functions
Built-in functions are defined as plugins in tuned/profiles/functions.
Each function (plugin) is python code named function_NAME.py, where
NAME is the name of the built-in function defined. For example
how to implement own function see provided functions.

Functions are expanded in tuned profile configuration file during profile
load. Functions are expanded after variables. The syntax for function call is
${f:NAME:ARG1:ARG2...}. The function NAME will be called and it's result
substituted. It is possible to escape $ by \$ and : by \:. Functions are
loaded and executed on demand. Function which is once loaded during profile
application is not reloaded on multiple executions. Variables
in profile arguments are supported, but function calls aren't.

The following functions have been implemented so far:

exec:ARG1:...:ARGN - execute external command with arguments and subtitute
                     its output.
kb2s:ARG           - converts kbytes specified as ARG to sectors.
s2kb:ARG           - converts sectors specified as ARG to kbytes.

Example:

[variables]
cmd = date
curr_date = ${f:exec:${cmd}}

This commit also changed escaping of variables to be consistent with
functions. They can be now escaped by \, i.e. \${VAR} will not be expanded.
Escaping by double '$' is no more supported.

This commit also removes handler for all exceptions during profile loading.
This is not to mask real errors and ease development.

Resolves: rhbz#1225135

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-05 15:53:59 +02:00
Jaroslav Škarvada
8f618c92ea tuned-adm: fixed 'tuned-adm off' traceback if tuned is not running
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-04 15:36:28 +02:00
Jaroslav Škarvada
df1183bf03 daemon: added log info message notifying that static tuning has been applied
This is for simple synchronization. When the message is logged it is
guranteed that everything was applied and is set in place.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-04 14:35:51 +02:00
Jaroslav Škarvada
7349dbfa5c configobj: parse lists as strings and do not interpolate strings
Fixed in all parsers (main config, profiles, variables and recommend).

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-04 14:02:02 +02:00
Jaroslav Škarvada
7a868b6be0 plugin_audio: added check for integer
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-02 12:06:42 +02:00
Jaroslav Škarvada
5605629c35 variables: escape support and checking for valid characters in variable name
$${VAR} will be rewritten as ${VAR} and not expanded.

Only alphanumeric characters and underscores (those with matches regular
expression \w+$) are allowed in variable name.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-02 11:59:05 +02:00
Jaroslav Škarvada
330d1a4b34 variables: variables are now referenced by ${VAR}
Curl braces are mandatory and were added to solve the ambiguity.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-02 11:11:57 +02:00
Jaroslav Škarvada
3f1ab87f02 variables: added missed source file
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-02 10:59:53 +02:00
Jaroslav Škarvada
ac0f6b3b9d tuned: this is an update adding support for variables
Variables can be defined in [variables] section in profile configuration.
Variables are specified the following way:

[variables]
VARIABLE1 = VALUE1
VARIABLE2 = VALUE2

Variables are expanded on definition and assignment. Previously defined variable
is redefined by its new definition.

Variables can be referenced in plugins configuration by using '$' prefix, e.g.:

[variables]
delay = 20

[audio]
timeout = $delay

There can be also included external file with definition of variables by using
'include' directive:

[variables]
include = filename

The 'filename' is processed by ConfigObj parser. Comments are supported by '#'
character. Multiple sections are not supported and files with multiple sections
are flattened to single section configuration file.

The variables are also supported by the script plugin. It exports variables into
environment before the script is executed. The variable names are prefixed by
the 'TUNED_' string. Example:

[variables]
VARIABLE1 = VALUE1

will be exported into environment as:

TUNED_VARIABLE1 = VALUE1

If there is already TUNED_ prefix in the variable name, no other prefix is
added, i.e.:

[variables]
TUNED_VARIABLE1 = VALUE1

will be exported as:

TUNED_VARIABLE1 = VALUE1

and not TUNED_TUNED_VARIABLE1.

Resolves: rhbz#1225124

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-01 19:20:34 +02:00
Jaroslav Škarvada
04576ed018 Makefile: fixed scp command for nightly builds upload
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-29 18:15:25 +02:00
Jaroslav Škarvada
3b903d2630 Makefile: fixed scp in nightly target
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-29 17:56:49 +02:00
Jaroslav Škarvada
bbd2dd5ccf Makefile: do not clean mock-result-dir
It is good to preserve previous nightlies.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-29 17:53:31 +02:00
Jaroslav Škarvada
fa54077770 Makefile: used 'rpm' target for local build instead of 'build'
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-29 17:21:17 +02:00
Jaroslav Škarvada
b1da643ad5 Makefile: added support for nightly development builds
It is supported by 'nightly' makefile target. It creates
snapshot from the GIT HEAD, makes mockbuild,
creates repo and uploads result on the fedorapeople.

Also fixed makefile to support parallel builds, added
couple of hopefully useful targets, implemented local
RPM build target 'rpm'.

Other targets (e.g. 'srpm') can be also used to work
with snapshots. It is controlled by BUILD makefile
varible. If set to 'release' normal release is done.
If set to anything else (e.g. 'snapshot') snapshot
is done.

There is also support for GIT snapshots in the upstream
provided SPEC file. Snapshot build is done if
built with '--with snapshot', normal (release) build
is done otherwise.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-29 17:18:49 +02:00
Jaroslav Škarvada
516dc1c168 plugin_cpu: skip offline CPUs
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-28 18:44:00 +02:00
Jaroslav Škarvada
fb96ce1d44 spec: add git suffix to release number
By default build as development release with build date and git suffix
added to the release number. Build without this suffix if built
--with release

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-28 17:21:50 +02:00
Jaroslav Škarvada
bc5d7acca8 plugin_net: added support for adapter coalesce and features
Usage:

[net]
coalesce=PARAM1 VALUE1 PARAM2 VALUE2
features=PARAM1 VALUE1 PARAM2 VALUE2

It is also possible to specify it by:
coalesce=PARAM1: VALUE1; PARAM2: VALUE2

or:
coalesce=PARAM1 VALUE1, PARAM2 VALUE2

or mix all separators.

Resolves: rhbz#1152539
Resolves: rhbz#1152541

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-28 16:43:42 +02:00
Jaroslav Škarvada
af87f90a59 plugin_mounts: disable_barriers always return value
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-27 15:28:51 +02:00
Jaroslav Škarvada
01916eb2ab plugins: fixed bug eating first value character if previous value is None
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-26 18:24:17 +02:00
Jaroslav Škarvada
388cf1ead8 man: added verify command and other minor improvements
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-26 15:05:08 +02:00