mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-25 08:53:06 +02:00
Apply clang-format to CPU pinning and parking code
The original PR #416 failed the format check, but this wasn't apparent until after merging.
This commit is contained in:
parent
775c93001c
commit
fad889db45
@ -29,10 +29,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sched.h>
|
||||
#include "common-cpu.h"
|
||||
#include "common-logging.h"
|
||||
#include <sched.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
char *parse_cpulist(char *cpulist, long *from, long *to)
|
||||
{
|
||||
|
@ -44,4 +44,3 @@ struct GameModeCPUInfo {
|
||||
|
||||
/* parses a list of cpu cores in the format "a,b-c,d-e,f" */
|
||||
char *parse_cpulist(char *cpulist, long *from, long *to);
|
||||
|
||||
|
@ -124,7 +124,6 @@ void config_get_amd_performance_level(GameModeConfig *self, char value[CONFIG_VA
|
||||
void config_get_cpu_park_cores(GameModeConfig *self, char value[CONFIG_VALUE_MAX]);
|
||||
void config_get_cpu_pin_cores(GameModeConfig *self, char value[CONFIG_VALUE_MAX]);
|
||||
|
||||
|
||||
/**
|
||||
* Functions to get supervisor config permissions
|
||||
*/
|
||||
|
@ -32,9 +32,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <sched.h>
|
||||
#include <linux/limits.h>
|
||||
#include <dirent.h>
|
||||
#include <linux/limits.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "common-cpu.h"
|
||||
#include "common-external.h"
|
||||
@ -434,7 +434,8 @@ int game_mode_unpark_cpu(const GameModeCPUInfo *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void apply_affinity_mask (pid_t pid, size_t cpusetsize, const cpu_set_t *mask, const bool be_silent)
|
||||
static void apply_affinity_mask(pid_t pid, size_t cpusetsize, const cpu_set_t *mask,
|
||||
const bool be_silent)
|
||||
{
|
||||
char buffer[PATH_MAX];
|
||||
char *proc_path = NULL;
|
||||
@ -442,20 +443,14 @@ static void apply_affinity_mask (pid_t pid, size_t cpusetsize, const cpu_set_t *
|
||||
|
||||
if (!(proc_path = buffered_snprintf(buffer, "/proc/%d/task", pid))) {
|
||||
if (!be_silent) {
|
||||
LOG_ERROR(
|
||||
"Unable to find executable for PID %d: %s\n",
|
||||
pid,
|
||||
strerror(errno));
|
||||
LOG_ERROR("Unable to find executable for PID %d: %s\n", pid, strerror(errno));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(proc_dir = opendir(proc_path))) {
|
||||
if (!be_silent) {
|
||||
LOG_ERROR(
|
||||
"Unable to find executable for PID %d: %s\n",
|
||||
pid,
|
||||
strerror(errno));
|
||||
LOG_ERROR("Unable to find executable for PID %d: %s\n", pid, strerror(errno));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -474,7 +469,8 @@ static void apply_affinity_mask (pid_t pid, size_t cpusetsize, const cpu_set_t *
|
||||
closedir(proc_dir);
|
||||
}
|
||||
|
||||
void game_mode_apply_core_pinning(const GameModeCPUInfo *info, const pid_t client, const bool be_silent)
|
||||
void game_mode_apply_core_pinning(const GameModeCPUInfo *info, const pid_t client,
|
||||
const bool be_silent)
|
||||
{
|
||||
if (!info || info->park_or_pin == IS_CPU_PARK)
|
||||
return;
|
||||
|
@ -212,7 +212,8 @@ void game_mode_free_cpu(GameModeCPUInfo **info);
|
||||
void game_mode_reconfig_cpu(GameModeConfig *config, GameModeCPUInfo **info);
|
||||
int game_mode_park_cpu(const GameModeCPUInfo *info);
|
||||
int game_mode_unpark_cpu(const GameModeCPUInfo *info);
|
||||
void game_mode_apply_core_pinning(const GameModeCPUInfo *info, const pid_t client, const bool be_silent);
|
||||
void game_mode_apply_core_pinning(const GameModeCPUInfo *info, const pid_t client,
|
||||
const bool be_silent);
|
||||
void game_mode_undo_core_pinning(const GameModeCPUInfo *info, const pid_t client);
|
||||
|
||||
/** gamemode-dbus.c
|
||||
|
@ -31,9 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/limits.h>
|
||||
|
||||
#include "common-cpu.h"
|
||||
#include "common-logging.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user