config: Allow renice configuration

This commit adds configuration support for the renice value and amends
documentation and examples. This commit by itself does nothing, the
following commit is needed to actually apply the new settings.

Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
Kai Krakow
2018-06-10 09:33:02 +02:00
parent addfe1fbc0
commit 57c6bbb444
5 changed files with 25 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ struct GameModeConfig {
char desiredgov[CONFIG_VALUE_MAX];
char softrealtime[CONFIG_VALUE_MAX];
long renice;
long reaper_frequency;
};
@@ -161,6 +162,8 @@ static int inih_handler(void *user, const char *section, const char *name, const
valid = get_string_value(value, self->desiredgov);
} else if (strcmp(name, "softrealtime") == 0) {
valid = get_string_value(value, self->softrealtime);
} else if (strcmp(name, "renice") == 0) {
valid = get_long_value(name, value, &self->renice);
}
} else if (strcmp(section, "custom") == 0) {
/* Custom subsection */
@@ -413,3 +416,11 @@ void config_get_soft_realtime(GameModeConfig *self, char softrealtime[CONFIG_VAL
{
memcpy_locked_config(self, softrealtime, self->softrealtime, sizeof(self->softrealtime));
}
/*
* Get the renice value
*/
void config_get_renice_value(GameModeConfig *self, long *value)
{
memcpy_locked_config(self, value, &self->renice, sizeof(long));
}

View File

@@ -108,3 +108,8 @@ void config_get_desired_governor(GameModeConfig *self, char governor[CONFIG_VALU
* Get the chosen soft realtime behavior
*/
void config_get_soft_realtime(GameModeConfig *self, char softrealtime[CONFIG_VALUE_MAX]);
/*
* Get the renice value
*/
void config_get_renice_value(GameModeConfig *self, long *value);