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();