RFR: 7262: Add rule for when the JVM version is < OpenJDK 8u302 [v4]

Marcus Hirt hirt at openjdk.java.net
Wed Jun 2 15:45:31 UTC 2021


On Wed, 2 Jun 2021 15:10:50 GMT, Oskar Jung <github.com+1101441+ojung at openjdk.org> wrote:

>> This PR contains a rule for notifying users of JVM < OpenJDK8u302 to upgrade to avoid performance issues caused by https://bugs.openjdk.java.net/browse/JDK-8266723.
>> 
>> **JFR recorded on OpenJDK 8u302 EA:**
>> ![Screen Shot 2021-06-02 at 14 45 46](https://user-images.githubusercontent.com/1101441/120482697-a9c7bf80-c3b1-11eb-83e0-7d17b23cfd99.png)
>> 
>> **JFR recorded on OpenJDK 8u292:**
>> ![Screen Shot 2021-06-02 at 15 49 14](https://user-images.githubusercontent.com/1101441/120492943-ce746500-c3ba-11eb-999c-e75bf3fba245.png)
>
> Oskar Jung has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.

Changes requested by hirt (Lead).

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/general/JfrPeriodicEventsFixRule.java line 3:

> 1: /*
> 2:  * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
> 3:  *

Should add Datadog copyright line under the Oracle one (see other such files by searching for Datadog).

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/general/JfrPeriodicEventsFixRule.java line 78:

> 76: 	private static final JavaVersion JDK_8_U_302 = new JavaVersion(8, 0, 302);
> 77: 
> 78: 	private static final Pattern OPENJDK_VM_NAME_REGEX = Pattern.compile("^OpenJDK.*$");

Isn't using a regexp here a bit of an overkill?

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/general/JfrPeriodicEventsFixRule.java line 83:

> 81: 		IItemCollection items, IPreferenceValueProvider valueProvider, IResultValueProvider resultProvider) {
> 82: 		String vmName = items.getAggregate(Aggregators.distinctAsString(JdkTypeIDs.VM_INFO, JdkAttributes.JVM_NAME));
> 83: 		boolean isOpenJdk = OPENJDK_VM_NAME_REGEX.matcher(vmName).matches();

Perhaps isOpenJDK something that could be added to org.openjdk.jmc.common.version.JavaVMVersionToolkit?

-------------

PR: https://git.openjdk.java.net/jmc/pull/256


More information about the jmc-dev mailing list