enhance the name of the dump buffers 17/78517/1 accepted/tizen/common/20160707.171219 accepted/tizen/ivi/20160706.082955 accepted/tizen/mobile/20160706.082923 accepted/tizen/tv/20160706.082904 accepted/tizen/wearable/20160706.082915 submit/tizen/20160706.051650
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 5 Jul 2016 12:51:21 +0000 (21:51 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 5 Jul 2016 13:01:10 +0000 (22:01 +0900)
Change-Id: I137a66f5129cd6723cc5a4864e31c01bb15a1423

src/tbm_surface_internal.c

index 47e54b4..5f3c4b5 100644 (file)
@@ -30,6 +30,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 **************************************************************************/
 
 #include "config.h"
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
 #include "tbm_bufmgr.h"
 #include "tbm_bufmgr_int.h"
 #include "tbm_surface_internal.h"
@@ -46,6 +49,17 @@ static tbm_bufmgr g_surface_bufmgr;
 static pthread_mutex_t tbm_surface_lock;
 
 /* LCOV_EXCL_START */
+
+static unsigned long
+_get_time_in_millis(void)
+{
+       struct timeval tv;
+
+       gettimeofday(&tv, NULL);
+
+       return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+}
+
 char *
 _tbm_surface_internal_format_to_str(tbm_format format)
 {
@@ -1496,7 +1510,7 @@ tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type)
        switch (info.format) {
        case TBM_FORMAT_ARGB8888:
        case TBM_FORMAT_XRGB8888:
-               snprintf(buf_info->name, sizeof(buf_info->name), "%03d-%s.%s", g_dump_info->count++, type, postfix);
+               snprintf(buf_info->name, sizeof(buf_info->name), "[%.3f](%03d:%p)-%s.%s", _get_time_in_millis() / 1000.0, g_dump_info->count++, surface, type, postfix);
                memcpy(bo_handle.ptr, info.planes[0].ptr, info.size);
                break;
        case TBM_FORMAT_YVU420: