summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonbum Ko <joonbum.ko@samsung.com>2021-08-24 14:47:04 +0900
committerJoonbum Ko <joonbum.ko@samsung.com>2021-08-24 15:09:32 +0900
commitf4b39afde43752e437d10d96623701ddb88423c7 (patch)
tree835da8aa3d96eb57b78260098e3b9f80b6b26f6d
parent36582c23f62b229b4d25a3afa6a84adfe0f9f917 (diff)
downloadlibtbm-linux_yocto.tar.gz
libtbm-linux_yocto.tar.bz2
libtbm-linux_yocto.zip
Exclude dlog dependency when dlog disabled.linux_yocto
Change-Id: I89e63e372ea77d12c77eae2cbf555421adc2ed9d Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
-rw-r--r--src/tbm_bufmgr.c6
-rw-r--r--src/tbm_bufmgr_int.h2
-rw-r--r--src/tbm_log.c11
3 files changed, 11 insertions, 8 deletions
diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c
index 282bc8f..c478cde 100644
--- a/src/tbm_bufmgr.c
+++ b/src/tbm_bufmgr.c
@@ -40,10 +40,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int trace_mask = 0;
-#ifdef HAVE_DLOG
-int bDlog;
-#endif
-
tbm_bufmgr gBufMgr;
int b_dump_queue;
@@ -229,8 +225,6 @@ _tbm_bufmgr_init(int fd, int server)
gettimeofday(&start_tv, NULL);
#endif
- bDlog = 1;
-
/* LCOV_EXCL_START */
#ifdef TRACE
env = getenv("TBM_TRACE");
diff --git a/src/tbm_bufmgr_int.h b/src/tbm_bufmgr_int.h
index 91f411e..07e86a4 100644
--- a/src/tbm_bufmgr_int.h
+++ b/src/tbm_bufmgr_int.h
@@ -48,7 +48,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <errno.h>
#include <assert.h>
#include <pthread.h>
+#if ENABLE_DLOG
#include <dlog.h>
+#endif
#include <tbm_bufmgr.h>
#include <tbm_bo.h>
#include <tbm_surface.h>
diff --git a/src/tbm_log.c b/src/tbm_log.c
index 599d883..7b104e3 100644
--- a/src/tbm_log.c
+++ b/src/tbm_log.c
@@ -35,7 +35,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tbm_bufmgr_int.h"
#include "tbm_log.h"
-#include <dlog.h>
#define TBM_PATH_LEN 1024
@@ -48,8 +47,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LOG_TAG "TBM"
#if ENABLE_DLOG
+#include <dlog.h>
static unsigned int dlog_enable = 1;
#else
+#include <stdarg.h>
static unsigned int dlog_enable = 0;
#endif
static unsigned int color_enable = 1;
@@ -165,6 +166,7 @@ tbm_log_print_stdout(int level, const char *fmt, ...)
va_end(arg);
}
+#if ENABLE_DLOG
static void
_tbm_log_dlog_print(int level, const char *fmt, va_list arg)
{
@@ -188,6 +190,7 @@ _tbm_log_dlog_print(int level, const char *fmt, va_list arg)
}
__dlog_vprint(LOG_ID_SYSTEM, dlog_prio, LOG_TAG, fmt, arg);
}
+#endif
void
tbm_log_print(int level, const char *fmt, ...)
@@ -202,11 +205,15 @@ tbm_log_print(int level, const char *fmt, ...)
if (level > tbm_log_debug_level)
return;
+#if ENABLE_DLOG
if (dlog_enable) {
va_start(arg, fmt);
_tbm_log_dlog_print(level, fmt, arg);
va_end(arg);
- } else {
+ }
+ else
+#endif
+ {
va_start(arg, fmt);
_tbm_log_vprint_stdout(level, fmt, arg);
va_end(arg);