"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
GHashTable *app_map = NULL;
static long int lst_charge = -1;
-static int front = -1, end = -1, is_full = 0;
+static int front = -1, end = -1;
static int bd_dump_data_item_reset(dump_data_s* old_state)
{
if ((front == 0 && end == HISTORY_SIZE_MAX - 1) || (front == end + 1)) {
_DBG("buffer is full");
- is_full = 1;
bd_clean_circ_buffer_front(front);
front = (front + 1) % HISTORY_SIZE_MAX;
/* Prepare TIME Node */
return end;
}
-static int bd_print_pool_entry(int fd, int idx, int pc, history_tag_s *pool_info)
+static int bd_print_pool_entry(int fd, int idx, history_tag_s *pool_info)
{
ENTER;
BM_CHECK_INPUT_PARAM(pool_info);
_DBG("Value from history data %d", idx);
- _DBG("Value from history data %d", pool_info->sp_idx);
GString *dump_p = g_string_sized_new(30);
BM_CHECK_MEM_ALLOC(dump_p, {});
g_string_append_c(dump_p, ',');
g_string_append(dump_p, DUMP_DATA_TAG_1);
g_string_append_c(dump_p, ',');
-
- if (is_full)
- g_string_append_printf(dump_p, "%d,", pool_info->sp_idx);
- else
- g_string_append_printf(dump_p, "%d,", pc);
+ g_string_append_printf(dump_p, "%d,", pool_info->sp_idx);
g_string_append_printf(dump_p, "%d,", pool_info->uid);
g_string_append(dump_p, "\"");
g_string_free(dump_p, TRUE);
int ret = BATTERY_MONITOR_ERROR_NONE;
- int pool_count = 0, index_s = front, index_e = end, i = 0;
+ int index_s = front, index_e = end, i = 0;
if (index_s > index_e)
index_e = HISTORY_SIZE_MAX + index_e;
history_tag_s *pool_info = NULL;
if (history_data[i].event_tag != NULL && (history_data[i].event_code & ET_FLAG_START)) {
pool_info = history_data[i].event_tag;
- ret = bd_print_pool_entry(fd, i, pool_count, pool_info);
- pool_count++;
+ ret = bd_print_pool_entry(fd, i, pool_info);
if (ret != BATTERY_MONITOR_ERROR_NONE)
return BATTERY_MONITOR_ERROR_INTERNAL;
}
if (history_data[i].wakelock_tag != NULL) {
pool_info = history_data[i].wakelock_tag;
- ret = bd_print_pool_entry(fd, i, pool_count, pool_info);
- pool_count++;
+ ret = bd_print_pool_entry(fd, i, pool_info);
if (ret != BATTERY_MONITOR_ERROR_NONE)
return BATTERY_MONITOR_ERROR_INTERNAL;
}
if (history_data[i].wakereason_tag != NULL) {
pool_info = history_data[i].wakereason_tag;
- ret = bd_print_pool_entry(fd, i, pool_count, pool_info);
- pool_count++;
+ ret = bd_print_pool_entry(fd, i, pool_info);
if (ret != BATTERY_MONITOR_ERROR_NONE)
return BATTERY_MONITOR_ERROR_INTERNAL;
}
_ERR("Internal error %d while freeing at idx %d", ret , i);
}
- front = -1; end = -1; is_full = 0;
+ front = -1; end = -1;
h_flag = true;
EXIT;
int ret = BATTERY_MONITOR_ERROR_NONE;
- front = -1; end = -1; h_flag = true; is_full = 0;
+ front = -1; end = -1; h_flag = true;
lst_charge = -1;
#ifdef DUMP_DUMMY
bd_dummy_test_fn();