From 742e735d7f6c4ee9ca5a4d290c59d7d6ec1f7635 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 14 Feb 2025 13:53:06 +0000 Subject: [PATCH] 8349858: Print compilation task before blocking compiler thread for shutdown Reviewed-by: kvn, chagedorn --- src/hotspot/share/compiler/compileBroker.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index c2e2e2d607f..c34d9eb785e 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -2074,7 +2074,21 @@ void CompileBroker::maybe_block() { if (PrintCompilation && (Verbose || WizardMode)) tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current())); #endif + // If we are executing a task during the request to block, report the task + // before disappearing. + CompilerThread* thread = CompilerThread::current(); + if (thread != nullptr) { + CompileTask* task = thread->task(); + if (task != nullptr) { + if (PrintCompilation) { + task->print(tty, "blocked"); + } + task->print_ul("blocked"); + } + } + // Go to VM state and block for final VM shutdown safepoint. ThreadInVMfromNative tivfn(JavaThread::current()); + assert(false, "Should never unblock from TIVNM entry"); } }