profil function is called only if app is built with pg option
authorwoojin <woojin2.jung@samsung.com>
Wed, 24 Apr 2013 08:32:14 +0000 (17:32 +0900)
committerwoojin <woojin2.jung@samsung.com>
Wed, 24 Apr 2013 08:32:14 +0000 (17:32 +0900)
Change-Id: I79b36df983a3e59afddb1dd08c0ad825196ef8c4

probe_userfunc/libdauserfunc.c

index 0f966cf..a856ac3 100755 (executable)
@@ -68,6 +68,7 @@ void *custom_cb_addr = (void*)-1;
 
 extern __thread unsigned long gSTrace;
 
+int is_profil_allowed = 0;
 volatile int profil_turned_on = 0;
 volatile int profil_thread_on = 0;
 u_long low_pc, high_pc;
@@ -492,6 +493,9 @@ int __profil(int mode)
        static struct sigaction oact;
        static struct itimerval otimer;
 
+       if(is_profil_allowed != 1)
+               return 0;
+
        if(mode == 0)
        {
                if(profil_turned_on == 0)
@@ -535,6 +539,7 @@ void __monstartup(u_long lowpc, u_long highpc)
 {
        low_pc = lowpc;
        high_pc = highpc;
+       is_profil_allowed = 1;
 
        pthread_mutex_init(&profil_log_mutex, NULL);
        probeBlockStart();