extern __thread unsigned long gSTrace;
-int is_profil_allowed = 0;
+int profil_option = 0;
volatile int profil_turned_on = 0;
volatile int profil_thread_on = 0;
u_long low_pc, high_pc;
static struct sigaction oact;
static struct itimerval otimer;
- if(is_profil_allowed != 1)
+ if(profil_thread_on != 1)
+ {
+ profil_option = mode;
return 0;
+ }
if(mode == 0)
{
{
low_pc = lowpc;
high_pc = highpc;
- is_profil_allowed = 1;
pthread_mutex_init(&profil_log_mutex, NULL);
probeBlockStart();
profil_thread_on = 1;
+ __profil(profil_option);
if(pthread_create(&profil_log_thread, NULL, &profil_log_func, NULL) < 0)
{
perror("Fail to create profil_log thread");