diff --git a/jdk/src/share/classes/jdk/jfr/internal/MetadataRepository.java b/jdk/src/share/classes/jdk/jfr/internal/MetadataRepository.java index b0b0db71ddb..fbdd2180dd7 100644 --- a/jdk/src/share/classes/jdk/jfr/internal/MetadataRepository.java +++ b/jdk/src/share/classes/jdk/jfr/internal/MetadataRepository.java @@ -78,7 +78,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/jdk/src/share/classes/jdk/jfr/internal/PlatformEventType.java b/jdk/src/share/classes/jdk/jfr/internal/PlatformEventType.java index e6f98eb0e31..b6aae10dd91 100644 --- a/jdk/src/share/classes/jdk/jfr/internal/PlatformEventType.java +++ b/jdk/src/share/classes/jdk/jfr/internal/PlatformEventType.java @@ -278,4 +278,8 @@ public boolean isCommitable() { public int getStackTraceOffset() { return stackTraceOffset; } + + public boolean isMethodSampling() { + return isMethodSampling; + } }