+
+ _tbm_bufmgr_mutex_unlock();
+}
+
+int
+tbm_bufmgr_debug_queue_dump(char *path, int count, int onoff)
+{
+ pthread_mutex_lock(&gLock);
+
+ if (onoff == 0) {
+ TBM_LOG_D("count=%d onoff=%d\n", count, onoff);
+ b_dump_queue = 0;
+ tbm_surface_internal_dump_end();
+ } else {
+ int w, h;
+
+ if (path == NULL) {
+ TBM_LOG_E("path is null");
+ pthread_mutex_unlock(&gLock);
+ return 0;
+ }
+ TBM_LOG_D("path=%s count=%d onoff=%d\n", path, count, onoff);
+
+ if (_tbm_util_get_max_surface_size(&w, &h) == 0) {
+ TBM_LOG_E("Fail to get tbm_surface size.\n");
+ pthread_mutex_unlock(&gLock);
+ return 0;
+ }
+
+ tbm_surface_internal_dump_start(path, w, h, count);
+ b_dump_queue = 1;
+ }
+
+ pthread_mutex_unlock(&gLock);
+ return 1;
+}
+
+int
+tbm_bufmgr_debug_dump_all(char *path)
+{
+ int w, h, count = 0;
+ tbm_surface_h surface = NULL;
+
+ TBM_RETURN_VAL_IF_FAIL(path != NULL, 0);
+ TBM_LOG_D("path=%s\n", path);
+
+ pthread_mutex_lock(&gLock);
+
+ count = _tbm_util_get_max_surface_size(&w, &h);
+ if (count == 0) {
+ TBM_LOG_E("No tbm_surface.\n");
+ pthread_mutex_unlock(&gLock);
+ return 1;
+ }
+
+ tbm_surface_internal_dump_start(path, w, h, count);
+
+ LIST_FOR_EACH_ENTRY(surface, &gBufMgr->surf_list, item_link)
+ tbm_surface_internal_dump_buffer(surface, "dump_all");
+
+ tbm_surface_internal_dump_end();
+
+ pthread_mutex_unlock(&gLock);
+
+ return 1;