From a7a0913005f9ac3c64546e194ea14176daadac5d Mon Sep 17 00:00:00 2001 From: quadhier Date: Tue, 6 Jun 2023 07:29:25 +0000 Subject: [PATCH] 8309346: Extend hs_err logging for all VM operations deriving from VM_GC_Operation Reviewed-by: tschatzl, stefank --- src/hotspot/share/gc/shared/gcVMOperations.cpp | 4 ++++ src/hotspot/share/gc/shared/gcVMOperations.hpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/hotspot/share/gc/shared/gcVMOperations.cpp b/src/hotspot/share/gc/shared/gcVMOperations.cpp index ceb4d2cc322..80358f38e2d 100644 --- a/src/hotspot/share/gc/shared/gcVMOperations.cpp +++ b/src/hotspot/share/gc/shared/gcVMOperations.cpp @@ -68,6 +68,10 @@ VM_GC_Operation::~VM_GC_Operation() { ch->soft_ref_policy()->set_all_soft_refs_clear(false); } +const char* VM_GC_Operation::cause() const { + return GCCause::to_string(_gc_cause); +} + // The same dtrace probe can't be inserted in two different files, so we // have to call it here, so it's only in one file. Can't create new probes // for the other file anymore. The dtrace probes have to remain stable. diff --git a/src/hotspot/share/gc/shared/gcVMOperations.hpp b/src/hotspot/share/gc/shared/gcVMOperations.hpp index 378ba290367..f4bc9333312 100644 --- a/src/hotspot/share/gc/shared/gcVMOperations.hpp +++ b/src/hotspot/share/gc/shared/gcVMOperations.hpp @@ -137,6 +137,8 @@ class VM_GC_Operation: public VM_GC_Sync_Operation { } ~VM_GC_Operation(); + virtual const char* cause() const; + // Acquire the Heap_lock and determine if this VM operation should be executed // (i.e. not skipped). Return this result, and also store it in _prologue_succeeded. virtual bool doit_prologue();