From 86054e8d59da977da2dba6ecc4c5e78a261ce08f Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Fri, 21 Feb 2025 11:46:07 +0100 Subject: [PATCH 1/2] IBM J9 8u361 corresponds to OpenJDK 8u362 --- ddprof-lib/src/main/cpp/j9Ext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ddprof-lib/src/main/cpp/j9Ext.h b/ddprof-lib/src/main/cpp/j9Ext.h index 028d0aa7a..ef4efa88a 100644 --- a/ddprof-lib/src/main/cpp/j9Ext.h +++ b/ddprof-lib/src/main/cpp/j9Ext.h @@ -1,6 +1,6 @@ /* * Copyright 2022 Andrei Pangin - * Copyright 2024 Datadog, Inc + * Copyright 2024, 2025 Datadog, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ class J9Ext { static bool can_use_ASGCT() { // as of 21.0.6 the use of ASGCT will lead to almost immediate crash // or livelock on J9 - return (VM::java_version() == 8 && VM::java_update_version() >= 362) || + return (VM::java_version() == 8 && VM::java_update_version() >= 361) || (VM::java_version() == 11 && VM::java_update_version() >= 18) || (VM::java_version() == 17 && VM::java_update_version() >= 6) || (VM::java_version() >= 18 && VM::java_version() < 21); From f92ece688c6d123e9fcdd9980c2c49d4139ab05a Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Fri, 21 Feb 2025 13:10:13 +0100 Subject: [PATCH 2/2] Try avoiding flakyness in ObjectSampleDumpSmokeTest --- .../test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java | 6 +++++- .../datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java index 7fe223c82..210842afe 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java @@ -16,10 +16,14 @@ public void runTest(String eventName) throws Exception { } public void runTest(String eventName, String ... patterns) throws Exception { + runTest(eventName, 10, patterns); + } + + public void runTest(String eventName, int dumpCnt, String ... patterns) throws Exception { Assumptions.assumeTrue(Platform.isJavaVersionAtLeast(11)); Assumptions.assumeFalse(Platform.isJ9()); - for (int j = 0; j < 10; j++) { + for (int j = 0; j < dumpCnt; j++) { Path recording = Files.createTempFile("dump-", ".jfr"); try { for (int i = 0; i < 50; i++) { diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java index 9cc1df596..8582783ac 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java @@ -21,6 +21,6 @@ protected String getProfilerCommand() { @RetryingTest(5) @Timeout(value = 300) public void test() throws Exception { - runTest("datadog.ObjectSample", "method3"); + runTest("datadog.ObjectSample", 3, "method3"); } }