tbm_bufmgr: add stdout log before and after load module 10/213010/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 29 Aug 2019 07:55:50 +0000 (16:55 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 29 Aug 2019 10:20:08 +0000 (19:20 +0900)
Change-Id: Ida6d84efa25aaf900bd469f092a1dbc461bb372f

include/tbm_log.h
src/tbm_bufmgr.c

index 2d29dd8..9f724cc 100644 (file)
@@ -95,6 +95,15 @@ void tbm_log_print_stdout(int level, const char *fmt, ...);
                                          (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args);  \
        } while (0)
 
+#define TBM_STDOUT_INFO(fmt, args...) \
+       do { \
+               struct timespec ts; \
+               clock_gettime(CLOCK_MONOTONIC, &ts); \
+               tbm_log_print_stdout(TBM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d]"fmt, \
+                                         (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
+                                         (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args);  \
+       } while (0)
+
 #define TBM_NEVER_GET_HERE() TBM_WRN("** NEVER GET HERE **")
 #define TBM_DEPRECATED(str) \
        do { \
index c92e0ea..e1be447 100644 (file)
@@ -370,6 +370,7 @@ _tbm_backend_load_module(tbm_bufmgr bufmgr, const char *file)
        bufmgr->bufmgr_data = bufmgr_data;
 
        TBM_DBG("Success to load module(%s)\n", file);
+       TBM_STDOUT_INFO("Success to load module(%s)", file);
 
        return 1;
 
@@ -557,6 +558,7 @@ _tbm_bufmgr_init(int fd, int server)
        }
 
        /* load bufmgr priv from env */
+       TBM_STDOUT_INFO("loading backend module");
        if (!_tbm_load_module(gBufMgr, gBufMgr->fd)) {
                TBM_ERR("error : Fail to load bufmgr backend\n");
                _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
@@ -566,6 +568,7 @@ _tbm_bufmgr_init(int fd, int server)
                return NULL;
 
        }
+       TBM_STDOUT_INFO("loading backend module done");
        /* LCOV_EXCL_STOP */
 
        gBufMgr->ref_count = 1;