}
#endif
if (error) {
- _E("[CPU-SCHED] Failed to set policy and priority with error = %m");
+ switch (errno) {
+ case EINVAL:
+ _E("[CPU-SCHED] Failed to set policy and priority by invalid input");
+ break;
+ case EPERM:
+ _E("[CPU-SCHED] Failed to set policy and priority by permission");
+ break;
+ default:
+ _E("[CPU-SCHED] Failed to set policy and priority by no pid (%d)", pid);
+ break;
+ }
+
return RESOURCED_ERROR_FAIL;
}
static gboolean cpu_boosting_timeout(gpointer data)
{
- int ret;
+ int fail_cnt = 0;
+ int success_cnt = 0;
struct syscommon_resourced_cpu_boosting_input *input =
(struct syscommon_resourced_cpu_boosting_input *)data;
if (tid_list[i] <= 0) {
_W("[CPU-BOOSTING] Thread (id = %d) should be larger than 0", tid_list[i]);
+ fail_cnt++;
continue;
}
assert(0);
}
- ret = sched_setattr(tid_list[i], &cpu_boosting_attr[CPU_BOOSTING_LEVEL_NONE], 0);
- if (ret != RESOURCED_ERROR_NONE)
- _E("[CPU-BOOSTING] Failed to clear boost cpu of (tid = %d)", tid_list[i]);
+ if (sched_setattr(tid_list[i],
+ &cpu_boosting_attr[CPU_BOOSTING_LEVEL_NONE], 0) < 0) {
+ fail_cnt++;
+ continue;
+ }
+
+ success_cnt++;
}
+ if (fail_cnt > 0)
+ _E("[CPU-BOOSTING] Boosting success ratio = %d/%d", success_cnt, fail_cnt + success_cnt);
+
if (input->remove_input)
cpu_boosting_destroy_request(input);
}
if (sched_setattr(tid_list[i], &attr, 0) < 0) {
- _W("[CPU-BOOSTING] Failed to boost cpu of (tid = %d) with (level = %d)",
- tid_list[i], cpu_boosting_level);
tid_list[i] = 0;
fail_cnt++;
continue;
ret = sched_setattr(tid_list[i],
&cpu_boosting_attr[CPU_BOOSTING_LEVEL_NONE], 0);
if (ret != RESOURCED_ERROR_NONE) {
- _E("[CPU-BOOSTING] Failed to clear boost cpu of (tid = %d)", tid_list[i]);
fail_cnt++;
continue;
}