Rename flag -> flags 98/278598/1 accepted/tizen/unified/20220726.132011 submit/tizen/20220725.093537
authorUnsung Lee <unsung.lee@samsung.com>
Fri, 22 Jul 2022 07:56:12 +0000 (16:56 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Fri, 22 Jul 2022 07:59:18 +0000 (16:59 +0900)
Change-Id: Idab6d543d82099a0d55629db2878af54da89d458
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
include/private/cpu-boosting-private.h
src/cpu-boosting.c
src/plugin/plugin.c
tests/main.c

index a4b68eb893b041482074cc267824a3c4801e0ce7..f6096e68492e3c6ce332998aeffcdffa2a172a86 100644 (file)
@@ -40,7 +40,7 @@ typedef struct resource_cpu_boosting_input {
        int command;
        int timeout_msec;
        cpu_boosting_level_e level;
-       cpu_boosting_flag_e flag;
+       cpu_boosting_flag_e flags;
        int body_size;
        resource_pid_t pid;
 } cpu_boosting_input_t;
index 0b49db6bc78b64804cab823c593de2c74f1b15c9..daf5826ad19f7e05d8c717659e6d41a5978bf882 100644 (file)
@@ -51,10 +51,10 @@ static int open_cpu_boosting_plugin(void)
 }
 
 API int resource_set_cpu_boosting (resource_pid_t pid,
-               cpu_boosting_level_e level, cpu_boosting_flag_e flag, int timeout_msec)
+               cpu_boosting_level_e level, cpu_boosting_flag_e flags, int timeout_msec)
 {
        int ret;
-       int (*func)(resource_pid_t pid, cpu_boosting_level_e level, cpu_boosting_flag_e flag, int timeout_msec) = NULL;
+       int (*func)(resource_pid_t pid, cpu_boosting_level_e level, cpu_boosting_flag_e flags, int timeout_msec) = NULL;
 
        ret = open_cpu_boosting_plugin();
        if (ret != RESOURCE_ERROR_NONE)
@@ -66,7 +66,7 @@ API int resource_set_cpu_boosting (resource_pid_t pid,
                return RESOURCE_ERROR_NOT_SUPPORTED;
        }
 
-       ret = func(pid, level, flag, timeout_msec);
+       ret = func(pid, level, flags, timeout_msec);
        if (ret != RESOURCE_ERROR_NONE)
                _E("[CPU-BOOSTING] Failed to set CPU boosting");
        else
index a7793c81b61f8d117f1cc454d9ad80c4b6ee2cb5..7dcaac7dffa9d9b804c866eb7d60bc7caeff59ee 100644 (file)
@@ -149,7 +149,7 @@ static int resource_cpu_boosting_send_command (cpu_boosting_input_t input, int s
 }
 
 API int resource_set_cpu_boosting (resource_pid_t pid,
-               cpu_boosting_level_e level, cpu_boosting_flag_e flag, int timeout_msec)
+               cpu_boosting_level_e level, cpu_boosting_flag_e flags, int timeout_msec)
 {
        int ret;
        int sock;
@@ -167,7 +167,7 @@ API int resource_set_cpu_boosting (resource_pid_t pid,
        input.command = CPU_BOOSTING_COMMAND_SET;
        input.pid = pid;
        input.level = level;
-       input.flag = flag;
+       input.flags = flags;
        input.timeout_msec = timeout_msec;
 
        ret = resource_cpu_boosting_send_command(input, sock);
index 06fb85cde9592a5755616a61e8041c812284018b..e00e571fee7f407ba99dfddf065085fb117c310a 100644 (file)
@@ -69,11 +69,11 @@ static void *thread_attr_check(void *arg)
        pthread_exit(NULL);
 }
 
-static void test_set_cpu_boosting(resource_pid_t pid, cpu_boosting_level_e level, cpu_boosting_flag_e flag, int timeout_msec)
+static void test_set_cpu_boosting(resource_pid_t pid, cpu_boosting_level_e level, cpu_boosting_flag_e flags, int timeout_msec)
 {
        int ret;
 
-       ret = resource_set_cpu_boosting(pid, level, flag, timeout_msec);
+       ret = resource_set_cpu_boosting(pid, level, flags, timeout_msec);
        if (ret) {
                _E("[CPU-BOOSTING-TEST] error = %d", ret);
        }
@@ -110,14 +110,14 @@ static void test_get_cpu_boosting(resource_pid_t pid, cpu_boosting_level_info_t
        }
 }
 
-static void test_cpu_boosting(resource_pid_t pid, cpu_boosting_flag_e flag)
+static void test_cpu_boosting(resource_pid_t pid, cpu_boosting_flag_e flags)
 {
        cpu_boosting_level_info_t cur_level;
 
        for (int level = CPU_BOOSTING_LEVEL_WEAK; level > CPU_BOOSTING_LEVEL_NONE; level--)
-               test_set_cpu_boosting(pid, level, flag, 3000);
+               test_set_cpu_boosting(pid, level, flags, 3000);
 
-       if (flag & CPU_BOOSTING_RESET_ON_FORK) {
+       if (flags & CPU_BOOSTING_RESET_ON_FORK) {
                pthread_t thread;
                int ret = pthread_create(&thread, NULL, thread_attr_check, NULL);
                if (ret == 0) {
@@ -134,7 +134,7 @@ static void test_cpu_boosting(resource_pid_t pid, cpu_boosting_flag_e flag)
        test_get_cpu_boosting(pid, &cur_level, false);  /* Expect CPU_BOOSTING_LEVEL_NONE */
 }
 
-static void one_process_one_thread_test(cpu_boosting_flag_e flag)
+static void one_process_one_thread_test(cpu_boosting_flag_e flags)
 {
        resource_pid_t pid;
 
@@ -142,7 +142,7 @@ static void one_process_one_thread_test(cpu_boosting_flag_e flag)
        pid.tid = NULL;
        pid.tid_count = 0;
 
-       test_cpu_boosting(pid, flag);
+       test_cpu_boosting(pid, flags);
 }
 
 static void multi_process_one_thread_test(int pid_count)