}
void
-tbm_bufmgr_debug_show(tbm_bufmgr bufmgr)
+tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr, char *str, int *len)
{
char app_name[255] = {0,}, title[512] = {0,};
tbm_surface_debug_data *debug_old_data = NULL;
return;
}
- TBM_DEBUG("\n");
+ TBM_SNPRINTF(str, len, "\n");
_tbm_util_get_appname_from_pid(getpid(), app_name);
_tbm_util_get_appname_brief(app_name);
- TBM_DEBUG("============TBM DEBUG: %s(%d)===========================\n",
+ TBM_SNPRINTF(str, len, "============TBM DEBUG: %s(%d)===========================\n",
app_name, getpid());
snprintf(title, 255, "%s", "no surface refcnt width height bpp size n_b n_p flags format app_name ");
}
}
- TBM_DEBUG("[tbm_surface information]\n");
- TBM_DEBUG("%s\n", title);
+ TBM_SNPRINTF(str, len, "[tbm_surface information]\n");
+ TBM_SNPRINTF(str, len, "%s\n", title);
/* show the tbm_surface information in surf_list */
if (!LIST_IS_EMPTY(&bufmgr->surf_list)) {
strncat(data, "none", 5);
}
}
- TBM_DEBUG("%s\n", data);
+ TBM_SNPRINTF(str, len, "%s\n", data);
for (i = 0; i < surf->num_bos; i++) {
- TBM_DEBUG(" bo:%-12p %-26d%-10d\n",
+ TBM_SNPRINTF(str, len, " bo:%-12p %-26d%-10d\n",
surf->bos[i],
surf->bos[i]->ref_cnt,
bufmgr->backend->bo_size(surf->bos[i]) / 1024);
}
}
} else
- TBM_DEBUG("no tbm_surfaces.\n");
- TBM_DEBUG("\n");
+ TBM_SNPRINTF(str, len, " no tbm_surfaces.\n");
+ TBM_SNPRINTF(str, len, "\n");
- TBM_DEBUG("[tbm_bo information]\n");
- TBM_DEBUG("no bo refcnt size lock_cnt map_cnt flags surface\n");
+ TBM_SNPRINTF(str, len, "[tbm_bo information]\n");
+ TBM_SNPRINTF(str, len, "no bo refcnt size lock_cnt map_cnt flags surface\n");
/* show the tbm_bo information in bo_list */
if (!LIST_IS_EMPTY(&bufmgr->bo_list)) {
tbm_bo bo = NULL;
LIST_FOR_EACH_ENTRY(bo, &bufmgr->bo_list, item_link) {
- TBM_DEBUG("%-4d%-11p %-4d %-6d %-5d %-4u %-3d %-11p\n",
+ TBM_SNPRINTF(str, len, "%-4d%-11p %-4d %-6d %-5d %-4u %-3d %-11p\n",
++bo_cnt,
bo,
bo->ref_cnt,
bo->surface);
}
} else
- TBM_DEBUG("no tbm_bos.\n");
- TBM_DEBUG("\n");
+ TBM_SNPRINTF(str, len, "no tbm_bos.\n");
+ TBM_SNPRINTF(str, len, "\n");
- TBM_DEBUG("===============================================================\n");
+ TBM_SNPRINTF(str, len, "===============================================================\n");
pthread_mutex_unlock(&gLock);
}
void
+tbm_bufmgr_debug_show(tbm_bufmgr bufmgr)
+{
+ char str[1024*4];
+ int len = sizeof(str);
+ tbm_bufmgr_debug_tbm_info_get(bufmgr, str, &len);
+ TBM_DEBUG(" %s", str);
+}
+
+void
tbm_bufmgr_debug_trace(tbm_bufmgr bufmgr, int onoff)
{
_tbm_bufmgr_mutex_lock();