Skip to content

Commit 85fdd2c

Browse files
committed
8347434: Richer VM operations events logging
Reviewed-by: dholmes, jsjolen
1 parent c207cc7 commit 85fdd2c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/hotspot/share/runtime/vmThread.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -401,17 +401,17 @@ void VMThread::inner_execute(VM_Operation* op) {
401401
HandleMark hm(VMThread::vm_thread());
402402

403403
const char* const cause = op->cause();
404-
EventMarkVMOperation em("Executing %sVM operation: %s%s%s%s",
405-
prev_vm_operation != nullptr ? "nested " : "",
406-
op->name(),
407-
cause != nullptr ? " (" : "",
408-
cause != nullptr ? cause : "",
409-
cause != nullptr ? ")" : "");
410-
411-
log_debug(vmthread)("Evaluating %s %s VM operation: %s",
412-
prev_vm_operation != nullptr ? "nested" : "",
413-
_cur_vm_operation->evaluate_at_safepoint() ? "safepoint" : "non-safepoint",
414-
_cur_vm_operation->name());
404+
stringStream ss;
405+
ss.print("Executing%s%s VM operation: %s",
406+
prev_vm_operation != nullptr ? " nested" : "",
407+
op->evaluate_at_safepoint() ? " safepoint" : " non-safepoint",
408+
op->name());
409+
if (cause != nullptr) {
410+
ss.print(" (%s)", cause);
411+
}
412+
413+
EventMarkVMOperation em("%s", ss.freeze());
414+
log_debug(vmthread)("%s", ss.freeze());
415415

416416
bool end_safepoint = false;
417417
bool has_timeout_task = (_timeout_task != nullptr);

0 commit comments

Comments
 (0)