From d7f412736d125e0abf2ccfa28c05ae9d700fe0ef Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 29 Aug 2019 16:55:50 +0900 Subject: [PATCH] tbm_bufmgr: add stdout log before and after load module Change-Id: Ida6d84efa25aaf900bd469f092a1dbc461bb372f --- include/tbm_log.h | 9 +++++++++ src/tbm_bufmgr.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/include/tbm_log.h b/include/tbm_log.h index 2d29dd8..9f724cc 100644 --- a/include/tbm_log.h +++ b/include/tbm_log.h @@ -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 { \ diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index c92e0ea..e1be447 100644 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -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; -- 2.7.4