diff options
author | SooChan Lim <sc1.lim@samsung.com> | 2015-12-11 12:00:55 +0900 |
---|---|---|
committer | SooChan Lim <sc1.lim@samsung.com> | 2015-12-11 12:00:55 +0900 |
commit | 31742a4e8a9f4a73d18588be20b8b046665e0060 (patch) | |
tree | ccddd77368edd024317c8ee7b3d990ba844c8c07 | |
parent | ebb15b1d6276ee22d733b9bedc34b080d2355367 (diff) | |
download | libtbm-31742a4e8a9f4a73d18588be20b8b046665e0060.tar.gz libtbm-31742a4e8a9f4a73d18588be20b8b046665e0060.tar.bz2 libtbm-31742a4e8a9f4a73d18588be20b8b046665e0060.zip |
add tbm_bufmgr_debug_show and tbm_bufmgr_debug_trace
tbm_bufmgr_debug_show shows the information of
the tbm_bos and the tbm_surfaces.
tbm_bufmgr_debug_trace shows the change trace log of
the tbm_bos and the tbm_surface.(not implemented yet).
Change-Id: I545c645a814f99f256261f59e005d2bd524dece0
-rwxr-xr-x[-rw-r--r--] | src/tbm_bufmgr.c | 76 | ||||
-rw-r--r-- | src/tbm_bufmgr.h | 17 |
2 files changed, 93 insertions, 0 deletions
diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index d427f44..5c247a4 100644..100755 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -1697,3 +1697,79 @@ tbm_bo_get_flags (tbm_bo bo) return bo->flags; } + +void +tbm_bufmgr_debug_show (tbm_bufmgr bufmgr) +{ + TBM_RETURN_IF_FAIL(bufmgr != NULL); + tbm_bo bo = NULL, tmp_bo = NULL; + int bo_cnt = 0; + + tbm_surface_h surf = NULL, tmp_surf = NULL; + int surf_cnt = 0; + + pthread_mutex_lock (&gLock); + + TBM_DEBUG("============TBM DEBUG: PID(%d)===========================\n", getpid()); + + TBM_DEBUG(" [tbm_bo information]\n"); + /* show the tbm_bo information in bo_list */ + if(!LIST_IS_EMPTY (&bufmgr->bo_list)) + { + LIST_FOR_EACH_ENTRY_SAFE (bo, tmp_bo, &bufmgr->bo_list, item_link) + { + TBM_DEBUG("no bo ref_cnt tgl_key lock_cnt map_cnt cache_state flags\n"); + TBM_DEBUG("%-4d%-10p%-8d%-8d%-9d%-8d%-12d%-5d\n", + ++bo_cnt, + bo, + bo->ref_cnt, + bo->tgl_key, + bo->lock_cnt, + bo->map_cnt, + bo->cache_state.val, + bo->flags); + } + } + else + { + TBM_DEBUG("no tbm_bos.\n"); + } + + TBM_DEBUG(" [tbm_surface information]\n"); + /* show the tbm_surface information in surf_list */ + if(!LIST_IS_EMPTY (&bufmgr->surf_list)) + { + LIST_FOR_EACH_ENTRY_SAFE (surf, tmp_surf, &bufmgr->surf_list, item_link) + { + TBM_DEBUG("no surface width height format bpp size num_bos num_planes flags\n"); + TBM_DEBUG("%-4d%-10p%-6d%-7d%-7d%-4d%-5d%-8d%-8d%-11d%-5d\\n", + ++surf_cnt, + surf, + surf->refcnt, + surf->info.width, + surf->info.height, + surf->info.format, + surf->info.bpp, + surf->info.size, + surf->num_bos, + surf->num_planes, + surf->flags); + } + } + else + { + TBM_DEBUG("no tbm_surfaces.\n"); + } + TBM_DEBUG("===============================================================\n"); + + pthread_mutex_unlock (&gLock); + +} + +void +tbm_bufmgr_debug_trace (tbm_bufmgr bufmgr, int onoff) +{ + TBM_LOG("bufmgr=%p onoff=%d\n", bufmgr, onoff); + TBM_LOG("Not implemented yet.\n"); +} + diff --git a/src/tbm_bufmgr.h b/src/tbm_bufmgr.h index 5b276ee..2d364f0 100644 --- a/src/tbm_bufmgr.h +++ b/src/tbm_bufmgr.h @@ -1038,6 +1038,23 @@ unsigned int tbm_bufmgr_get_capability (tbm_bufmgr bufmgr); */ int tbm_bo_get_flags (tbm_bo bo); +/** + * @brief Print out the information of tbm_bos. + * @since_tizen 3.0 + * @param[in] bufmgr : the buffer manager + */ +void tbm_bufmgr_debug_show (tbm_bufmgr bufmgr); + +/** + * @brief Print out the trace of tbm_bos. + * @since_tizen 3.0 + * @param[in] bufmgr : the buffer manager + * @param[in] onoff : 1 is on, and 0 is off + */ +void tbm_bufmgr_debug_trace (tbm_bufmgr bufmgr, int onoff); + + + #ifdef __cplusplus } #endif |