int ret;
+ bm_cpu_st *usage_head = NULL;
bm_cpu_st *usage = NULL;
struct timeval tv;
return BM_PLUGIN_ERROR_NO_DATA;
}
+ /* Make usage_head data structure */
+ usage_head = (bm_cpu_st *)calloc(1, sizeof(bm_cpu_st));
+ if (!usage_head) {
+ _E("calloc failed");
+
+ EXIT;
+ return BM_PLUGIN_ERROR_OUT_OF_MEMORY;
+ }
+
/* Make usage data structure */
usage = (bm_cpu_st *)calloc(1, sizeof(bm_cpu_st));
if (!usage) {
last_requested_time.tv_usec = tv.tv_usec;
/* Return result */
- *handle = usage;
+ usage_head->cpu_data_list = g_slist_append(usage_head->cpu_data_list, usage);
+ *handle = usage_head;
_I("Succeed to get CPU usage");
ret = BM_PLUGIN_ERROR_NONE;