diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java index cda69b32bfa67..2ebbf1c4c8ab0 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java @@ -85,7 +85,7 @@ private void initializeJVMEventTypes() { // annotations, such as Period and Threshold. if (pEventType.hasPeriod()) { pEventType.setEventHook(true); - if (!(Type.EVENT_NAME_PREFIX + "ExecutionSample").equals(type.getName())) { + if (!pEventType.isMethodSampling()) { requestHooks.add(new RequestHook(pEventType)); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java index 30f668bfd63b4..c0f1770b5eb71 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java @@ -327,4 +327,8 @@ public boolean isLargeSize() { public void setLargeSize() { largeSize = true; } + + public boolean isMethodSampling() { + return isMethodSampling; + } }