if (tid)
*tid = gettid();
- sleep(5);
+ sleep(3);
pthread_exit(NULL);
}
{
int ret;
+ level->tid_level = NULL;
ret = resource_get_cpu_boosting_level(pid, level);
- if (ret) {
+ if (ret < 0) {
_E("[CPU-BOOSTING-TEST] error = %d", ret);
}
+ else {
+ for(int i = 0; i < level->tid_count; i++)
+ _I("[CPU-BOOSTING-TEST] boosting level is %s",
+ level->tid_level[i] == CPU_BOOSTING_LEVEL_STRONG ? "strong" :
+ level->tid_level[i] == CPU_BOOSTING_LEVEL_MEDIUM ? "medium" :
+ level->tid_level[i] == CPU_BOOSTING_LEVEL_WEAK ? "weak" : "none");
+
+ if (level->tid_level)
+ free(level->tid_level);
+ }
}
static void test_cpu_boosting(resource_pid_t pid)
for (int level = CPU_BOOSTING_LEVEL_WEAK; level > CPU_BOOSTING_LEVEL_NONE; level--)
test_set_cpu_boosting(pid, level, 3000);
- test_get_cpu_boosting(pid, &cur_level); /* Expect CPU_BOOSTING_LEVEL_STRRONG */
+ test_get_cpu_boosting(pid, &cur_level); /* Expect CPU_BOOSTING_LEVEL_STRONG */
+
test_clear_cpu_boosting(pid);
test_get_cpu_boosting(pid, &cur_level); /* Expect CPU_BOOSTING_LEVEL_NONE */
+ sleep(3);
}
static void one_process_one_thread_test(void)