cpu-sched: Check name and cpu_info for app with cpu affinity 07/303607/1
authorUnsung Lee <unsung.lee@samsung.com>
Sun, 26 Nov 2023 10:28:53 +0000 (19:28 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 2 Jan 2024 08:46:42 +0000 (17:46 +0900)
App with cpu affinity has non Null name and cpu_info, but
app without cpu affinity has Null name and cpu_info. Therefore,
name and cpu_info must be checked to judge whehter cpu affinity is
statically fixed at app.

Change-Id: I53693fe769c6a0ffe033fd49b700e44a6f0d3d92
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-optimizer/cpu/cpu-sched.c

index 82b11c6..c69abf6 100644 (file)
@@ -31,12 +31,18 @@ static struct cpu_sched cs;
 
 static int cpu_sched_cpu_on(void *data);
 
-struct cpuset_info *cpu_sched_find_coreset(const char *name)
+static struct cpuset_info *cpu_sched_find_coreset(const char *name)
 {
        struct proc_conf_info *pci = fixed_app_and_service_exist_check(name, APP_TYPE);
        if (pci == NULL)
                return NULL;
 
+       if (pci->cpuset_info.name == NULL)
+               return NULL;
+
+       if (pci->cpuset_info.cpu_info == NULL)
+               return NULL;
+
        return &pci->cpuset_info;
 }