Skip to content

Commit b7e5f71

Browse files
rgithubliVictor Rudometov
authored andcommitted
8347434: Richer VM operations events logging
Backport-of: 85fdd2cc12660bef0d4334ef96afe1865ddd0c38
1 parent 9a8a68d commit b7e5f71

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
@@ -409,17 +409,17 @@ void VMThread::inner_execute(VM_Operation* op) {
409409
HandleMark hm(VMThread::vm_thread());
410410

411411
const char* const cause = op->cause();
412-
EventMarkVMOperation em("Executing %sVM operation: %s%s%s%s",
413-
prev_vm_operation != nullptr ? "nested " : "",
414-
op->name(),
415-
cause != nullptr ? " (" : "",
416-
cause != nullptr ? cause : "",
417-
cause != nullptr ? ")" : "");
418-
419-
log_debug(vmthread)("Evaluating %s %s VM operation: %s",
420-
prev_vm_operation != nullptr ? "nested" : "",
421-
_cur_vm_operation->evaluate_at_safepoint() ? "safepoint" : "non-safepoint",
422-
_cur_vm_operation->name());
412+
stringStream ss;
413+
ss.print("Executing%s%s VM operation: %s",
414+
prev_vm_operation != nullptr ? " nested" : "",
415+
op->evaluate_at_safepoint() ? " safepoint" : " non-safepoint",
416+
op->name());
417+
if (cause != nullptr) {
418+
ss.print(" (%s)", cause);
419+
}
420+
421+
EventMarkVMOperation em("%s", ss.freeze());
422+
log_debug(vmthread)("%s", ss.freeze());
423423

424424
bool end_safepoint = false;
425425
bool has_timeout_task = (_timeout_task != nullptr);

0 commit comments

Comments
 (0)