Skip to content

Commit 8052b91

Browse files
Enable --trace-compile during SIGUSR1/SIGINFO1 profiling (#59424)
1 parent 3396562 commit 8052b91

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/signal-handling.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,11 @@ static void jl_check_profile_autostop(void)
428428
if (profile_show_peek_cond_loc != NULL && profile_autostop_time != -1.0 && jl_hrtime() > profile_autostop_time) {
429429
profile_autostop_time = -1.0;
430430
jl_profile_stop_timer();
431+
// Disable trace compilation when profile collection ends
432+
jl_force_trace_compile_timing_disable();
431433
jl_safe_printf("\n==============================================================\n");
432-
jl_safe_printf("Profile collected. A report will print at the next yield point\n");
434+
jl_safe_printf("Profile collected. A report will print at the next yield point.\n");
435+
jl_safe_printf("Disabling --trace-compile\n");
433436
jl_safe_printf("==============================================================\n\n");
434437
JL_LOCK_NOGC(&profile_show_peek_cond_lock);
435438
if (profile_show_peek_cond_loc != NULL)

src/signals-unix.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,8 @@ static void kqueue_signal(int *sigqueue, struct kevent *ev, int sig)
823823
void trigger_profile_peek(void)
824824
{
825825
jl_safe_printf("\n======================================================================================\n");
826-
jl_safe_printf("Information request received. A stacktrace will print followed by a %.1f second profile\n", profile_peek_duration);
826+
jl_safe_printf("Information request received. A stacktrace will print followed by a %.1f second profile.\n", profile_peek_duration);
827+
jl_safe_printf("--trace-compile is enabled during profile collection.\n");
827828
jl_safe_printf("======================================================================================\n");
828829
if (profile_bt_size_max == 0) {
829830
// If the buffer hasn't been initialized, initialize with default size
@@ -1113,6 +1114,9 @@ static void *signal_listener(void *arg)
11131114
for (i = 0; i < signal_bt_size; i += jl_bt_entry_size(signal_bt_data + i)) {
11141115
jl_print_bt_entry_codeloc(signal_bt_data + i);
11151116
}
1117+
jl_safe_printf("\n");
1118+
// Enable trace compilation to stderr with timing during profile collection
1119+
jl_force_trace_compile_timing_enable();
11161120
}
11171121
}
11181122
return NULL;

0 commit comments

Comments
 (0)