From 8122466fbb8e3f3450131895551ec5b832845938 Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Mon, 23 May 2022 15:12:21 +0000 Subject: [PATCH] 8287113: JFR: Periodic task thread uses period for method sampling events Reviewed-by: jbachorik --- .../share/classes/jdk/jfr/internal/MetadataRepository.java | 2 +- .../share/classes/jdk/jfr/internal/PlatformEventType.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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; + } }