GHashTable *app_map = NULL;
static long int lst_charge = -1;
+static long long min_idle_check_time;
+
static int bd_print_pool_entry(int fd, int idx, int pc, history_tag_s *pool_info)
{
ENTER;
g_string_append_printf(dump_p, "%s", usage_map[i]);
g_string_append(dump_p, "=");
g_string_append_printf(dump_p, "%d", new_state.usage);
+ g_string_append(dump_p, ",");
+ g_string_append_printf(dump_p, "%lld", new_state.time_current);
+ g_string_append(dump_p, ",");
+ g_string_append_printf(dump_p, "%lld", (new_state.time_s - min_idle_check_time) / 1000);
g_string_append(dump_p, "\n");
_DBG("value %d", new_state.usage);
}
}
if (nrec->cmd_s == CM_CRR_TIME || nrec->cmd_s == CM_RST)
history_data[h_count].time_current = ((long long)tv.tv_sec * 1000) + ((long long)tv.tv_usec / 1000);
+ else if (nrec->cmd_s == CM_USAGE)
+ history_data[h_count].time_current = nrec->time_current;
history_data[h_count].state_1 = nrec->state_1;
history_data[h_count].state_2 = nrec->state_2;
return 0;
}
+void bd_get_idle_check_time()
+{
+ ENTER;
+
+ int ret;
+ int not_used_int;
+ int data_collection_try_period;
+ int data_collection_accept_count;
+
+ ret = bm_get_job_scheduler_params(¬_used_int, &data_collection_try_period, &data_collection_accept_count, ¬_used_int);
+ if (ret != BATTERY_MONITOR_ERROR_NONE) {
+ min_idle_check_time = 0;
+ return;
+ }
+
+ min_idle_check_time = (long long)data_collection_try_period * data_collection_accept_count;
+
+ EXIT;
+ return;
+}
+
int bd_initialize_battery_dump()
{
ENTER;
return BATTERY_MONITOR_ERROR_NOT_INITIALIZED;
}
+ bd_get_idle_check_time();
+
_INFO("Battery Dump Init Successful");
EXIT;