@@ -61,6 +61,7 @@ bt_context_t *jl_to_bt_context(void *sigctx)
6161#endif
6262}
6363
64+
6465static int thread0_exit_count = 0 ;
6566static void jl_exit_thread0 (int exitstate , jl_bt_element_t * bt_data , size_t bt_size );
6667
@@ -518,22 +519,17 @@ JL_DLLEXPORT int jl_profile_start_timer(void)
518519 sigprof .sigev_notify = SIGEV_SIGNAL ;
519520 sigprof .sigev_signo = SIGUSR1 ;
520521 sigprof .sigev_value .sival_ptr = & timerprof ;
521- // Because SIGUSR1 is multipurpose, set `running` before so that we know that the first SIGUSR1 came from the timer
522- running = 1 ;
523- if (timer_create (CLOCK_REALTIME , & sigprof , & timerprof ) == -1 ) {
524- running = 0 ;
522+ if (timer_create (CLOCK_REALTIME , & sigprof , & timerprof ) == -1 )
525523 return -2 ;
526- }
527524
528525 // Start the timer
529526 itsprof .it_interval .tv_sec = 0 ;
530527 itsprof .it_interval .tv_nsec = 0 ;
531528 itsprof .it_value .tv_sec = nsecprof / GIGA ;
532529 itsprof .it_value .tv_nsec = nsecprof % GIGA ;
533- if (timer_settime (timerprof , 0 , & itsprof , NULL ) == -1 ) {
534- running = 0 ;
530+ if (timer_settime (timerprof , 0 , & itsprof , NULL ) == -1 )
535531 return -3 ;
536- }
532+ running = 1 ;
537533 return 0 ;
538534}
539535
@@ -652,18 +648,6 @@ static void kqueue_signal(int *sigqueue, struct kevent *ev, int sig)
652648}
653649#endif
654650
655- void trigger_profile_peek (void )
656- {
657- jl_safe_printf ("\n======================================================================================\n" );
658- jl_safe_printf ("Information request received. A stacktrace will print followed by a %.1f second profile\n" , profile_peek_duration );
659- jl_safe_printf ("======================================================================================\n" );
660- bt_size_cur = 0 ; // clear profile buffer
661- if (jl_profile_start_timer () < 0 )
662- jl_safe_printf ("ERROR: Could not start profile timer\n" );
663- else
664- profile_autostop_time = jl_hrtime () + (profile_peek_duration * 1e9 );
665- }
666-
667651static void * signal_listener (void * arg )
668652{
669653 static jl_bt_element_t bt_data [JL_MAX_BT_SIZE + 1 ];
@@ -769,17 +753,11 @@ static void *signal_listener(void *arg)
769753
770754 int doexit = critical ;
771755#ifdef SIGINFO
772- if (sig == SIGINFO ) {
773- if (running != 1 )
774- trigger_profile_peek ();
756+ if (sig == SIGINFO )
775757 doexit = 0 ;
776- }
777758#else
778- if (sig == SIGUSR1 ) {
779- if (running != 1 )
780- trigger_profile_peek ();
759+ if (sig == SIGUSR1 )
781760 doexit = 0 ;
782- }
783761#endif
784762
785763 bt_size = 0 ;
@@ -857,7 +835,6 @@ static void *signal_listener(void *arg)
857835 }
858836#ifndef HAVE_MACH
859837 if (profile && running ) {
860- jl_check_profile_autostop ();
861838#if defined(HAVE_TIMER )
862839 timer_settime (timerprof , 0 , & itsprof , NULL );
863840#elif defined(HAVE_ITIMER )
0 commit comments