eina_debug: add env to turn off the eina cpu debug
authorJiyoun Park <jy0703.park@samsung.com>
Tue, 11 Sep 2018 08:25:40 +0000 (17:25 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Thu, 13 Sep 2018 02:13:09 +0000 (11:13 +0900)
sometimes eina_debug_cpu causes deadlock.
and some app has limitation the number of thread, bug this cpu increase thread number.
so add method to turn on/off eina cpu debug.

Change-Id: I25a0cf61765eaa0deebeabeffa0825116eacf4f4

src/lib/eina/eina_debug.c

index 4d003bf..a042102 100644 (file)
@@ -112,6 +112,9 @@ extern Eina_Spinlock _eina_debug_thread_lock;
 static Eina_List *sessions;
 
 static Eina_Bool _debug_disabled = EINA_FALSE;
+//TIZEN_ONLY(20180910): disable cpu debug
+static Eina_Bool _debug_cpu_disabled = EINA_FALSE;
+//
 
 /* Local session */
 /* __thread here to allow debuggers to be master and slave by using two different threads */
@@ -713,6 +716,14 @@ eina_debug_init(void)
    self = pthread_self();
    _eina_debug_thread_mainloop_set(&self);
    _eina_debug_thread_add(&self);
+
+//TIZEN_ONLY(20180910): disable cpu debug
+   if (!getenv("EFL_NO_CPU_DEBUG"))
+     {
+        _debug_disabled = EINA_TRUE;
+     }
+   if (!_debug_disabled)
+//
    _eina_debug_cpu_init();
    _eina_debug_bt_init();
    _eina_debug_timer_init();
@@ -741,6 +752,9 @@ eina_debug_shutdown(void)
 
    _eina_debug_timer_shutdown();
    _eina_debug_bt_shutdown();
+//TIZEN_ONLY(20180910): disable cpu debug
+   if (!_debug_disabled)
+//
    _eina_debug_cpu_shutdown();
    _eina_debug_thread_del(&self);
    eina_spinlock_free(&_eina_debug_lock);