:_module-type: CONCEPT
[id="built-in-functions-in-tuned-profiles_{context}"]
= Built-in functions in TuneD profiles

[role="_abstract"]
Built-in functions expand at run time when a *TuneD* profile is activated.

You can:

* Use various built-in functions together with *TuneD* variables
* Create custom functions in Python and add them to *TuneD* in the form of plug-ins

To call a function, use the following syntax:

[subs=+quotes]
----
${f:[replaceable]__function_name__:[replaceable]__argument_1__:[replaceable]__argument_2__}
----

To expand the directory path where the profile and the `tuned.conf` file are located, use the `PROFILE_DIR` function, which requires special syntax:

----
${i:PROFILE_DIR}
----



.Isolating CPU cores using variables and built-in functions
====
In the following example, the `${non_isolated_cores}` variable expands to `0,3-5`, and the `cpulist_invert` built-in function is called with the `0,3-5` argument:

----
[variables]
non_isolated_cores=0,3-5

[bootloader]
cmdline=isolcpus=${f:cpulist_invert:${non_isolated_cores}}
----

The `cpulist_invert` function inverts the list of CPUs. For a 6-CPU machine, the inversion is `1,2`, and the kernel boots with the [option]`isolcpus=1,2` command-line option.

====

[role="_additional-resources"]
.Additional resources
* `tuned.conf(5)` man page
