}
#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 cpu_boosting_input *input = (struct cpu_boosting_input *)data;
if (input == NULL) {
continue;
g_hash_table_remove(tid_table, &tid_list[i]);
- 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++;
}
else
_E("[CPU-BOOSTING] Thread (id = %d) should be larger than 0", tid_list[i]);
}
+ 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);
for (int i = 0; i < tid_count; i++) {
if (tid_list[i] > 0) {
if (sched_setattr(tid_list[i], &attr, 0) < 0) {
- _E("[CPU-BOOSTING] Failed to boost cpu of (tid = %d) with (level = %d)",
- tid_list[i], cpu_boosting_level);
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;
}