JMC-5703: HighGcRule should report extra needed event types
Mario Torre
neugens at redhat.com
Thu Nov 15 15:42:17 UTC 2018
The patch looks good now.
I'll commit it in a minute.
Cheers,
Mario
On Fri, Nov 9, 2018 at 6:07 PM Ken Dobson <kdobson at redhat.com> wrote:
>
> Sorry about that, this is a new patch adding the fix for the test.
>
> diff -r 4629e44fd8ea core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
> --- a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java Thu Nov 08 12:45:05 2018 +0100
> +++ b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java Fri Nov 09 11:23:30 2018 -0500
> @@ -86,7 +86,8 @@
> String longMessage = message + " " + Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG); //$NON-NLS-1$
> if (!RulesToolkit.isEventsEnabled(items, JdkTypeIDs.ALLOC_INSIDE_TLAB, JdkTypeIDs.ALLOC_OUTSIDE_TLAB)) {
> longMessage = longMessage + "<p>" //$NON-NLS-1$
> - + Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED);
> + + RulesToolkit.getEnabledEventTypesRecommendation(items,
> + JdkTypeIDs.ALLOC_INSIDE_TLAB, JdkTypeIDs.ALLOC_OUTSIDE_TLAB);
> }
> return new Result(this, score, message, longMessage, JdkQueries.GC_PAUSE);
> }
> diff -r 4629e44fd8ea core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
> --- a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java Thu Nov 08 12:45:05 2018 +0100
> +++ b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java Fri Nov 09 11:23:30 2018 -0500
> @@ -302,7 +302,6 @@
> public static final String HighGcRuleFactory_RULE_NAME = "HighGcRuleFactory_RULE_NAME"; //$NON-NLS-1$
> public static final String HighGcRuleFactory_TEXT_INFO = "HighGcRuleFactory_TEXT_INFO"; //$NON-NLS-1$
> public static final String HighGcRuleFactory_TEXT_INFO_LONG = "HighGcRuleFactory_TEXT_INFO_LONG"; //$NON-NLS-1$
> - public static final String HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED = "HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED"; //$NON-NLS-1$
> public static final String HighGcRuleFactory_TEXT_OK = "HighGcRuleFactory_TEXT_OK"; //$NON-NLS-1$
> public static final String HighJvmCpuRule_AGGR_MAX_ENDTIME = "HighJvmCpuRule_AGGR_MAX_ENDTIME"; //$NON-NLS-1$
> public static final String HighJvmCpuRule_AGGR_MIN_ENDTIME = "HighJvmCpuRule_AGGR_MIN_ENDTIME"; //$NON-NLS-1$
> diff -r 4629e44fd8ea core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties
> --- a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties Thu Nov 08 12:45:05 2018 +0100
> +++ b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties Fri Nov 09 11:23:30 2018 -0500
> @@ -325,7 +325,6 @@
> # {0} is a time period, {1} is a time stamp, {2} is a percentage
> HighGcRuleFactory_TEXT_INFO=The JVM was paused for {2} of the time during {0} starting at {1}.
> HighGcRuleFactory_TEXT_INFO_LONG=The time spent performing garbage collection may be reduced by increasing the heap size or by trying to reduce allocation.
> -HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED=Some allocation events were disabled in this recording. Enable them to help with troubleshooting this problem.
> HighGcRuleFactory_TEXT_OK=The runtime did not spend much time performing garbage collections.
> HighJvmCpuRule_AGGR_MAX_ENDTIME=Max End Time
> HighJvmCpuRule_AGGR_MIN_ENDTIME=Min End Time
> diff -r 4629e44fd8ea core/tests/org.openjdk.jmc.flightrecorder.rules.jdk.test/src/test/resources/baseline/JfrRuleBaseline.xml
> --- a/core/tests/org.openjdk.jmc.flightrecorder.rules.jdk.test/src/test/resources/baseline/JfrRuleBaseline.xml Thu Nov 08 12:45:05 2018 +0100
> +++ b/core/tests/org.openjdk.jmc.flightrecorder.rules.jdk.test/src/test/resources/baseline/JfrRuleBaseline.xml Fri Nov 09 11:23:30 2018 -0500
> @@ -2619,7 +2619,7 @@
> <severity>OK</severity>
> <score>2.054924803137792</score>
> <shortDescription>The JVM was paused for 100 % of the time during 9.017 ms starting at 4/24/18 10:08:53 AM.</shortDescription>
> -<longDescription>The JVM was paused for 100 % of the time during 9.017 ms starting at 4/24/18 10:08:53 AM. The time spent performing garbage collection may be reduced by increasing the heap size or by trying to reduce allocation.<p>Some allocation events were disabled in this recording. Enable them to help with troubleshooting this problem.</longDescription>
> +<longDescription>The JVM was paused for 100 % of the time during 9.017 ms starting at 4/24/18 10:08:53 AM. The time spent performing garbage collection may be reduced by increasing the heap size or by trying to reduce allocation.<p>To improve rule accuracy and/or get more details for further investigation, it is recommended to enable the following event types: 'Allocation in new TLAB', 'Allocation outside TLAB'.</longDescription>
> </rule>
> <rule>
> <id>HighJvmCpu</id>
>
> On Fri, Nov 9, 2018 at 10:25 AM Mario Torre <neugens at redhat.com> wrote:
>>
>> On Tue, 2018-11-06 at 17:57 +0100, Marcus Hirt wrote:
>> > Excellent! Please work with Mario to sponsor it!
>>
>> I applied this patch but I get this wehn building:
>>
>>
>> flightrecorder.rules.jdk.test ... FAILURE [ 8.283 s]
>> BUILD FAILURE
>>
>> Test set:
>> org.openjdk.jmc.flightrecorder.test.rules.jdk.TestRulesWithJfr
>> ---------------------------------------------------------------------
>> ----------
>> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.66 s
>> <<< FAILURE! - in
>> org.openjdk.jmc.flightrecorder.test.rules.jdk.TestRulesWithJfr
>> verifyAllResults(org.openjdk.jmc.flightrecorder.test.rules.jdk.TestRule
>> sWithJfr) Time elapsed: 6.5 s <<< FAILURE!
>> java.lang.AssertionError:
>>
>>
>> Report: "stringdedup_enabled_jdk9.jfr",
>> Rule: "HighGc".
>> Description mismatch: "The JVM was paused for 100 % of the time
>> during 9.017 ms starting at 4/24/18 10:08:53 AM. The time spent
>> performing garbage collection may be reduced by increasing the heap
>> size or by trying to reduce allocation.<p>To improve rule accuracy
>> and/or get more details for further investigation, it is recommended to
>> enable the following event types: 'Allocation in new TLAB', 'Allocation
>> outside TLAB'." was not equal to "The JVM was paused for 100 % of the
>> time during 9.017 ms starting at 4/24/18 10:08:53 AM. The time spent
>> performing garbage collection may be reduced by increasing the heap
>> size or by trying to reduce allocation.<p>Some allocation events were
>> disabled in this recording. Enable them to help with troubleshooting
>> this problem.".
>> at
>> org.openjdk.jmc.flightrecorder.test.rules.jdk.TestRulesWithJfr.verifyRu
>> leResults(TestRulesWithJfr.java:159)
>> at
>> org.openjdk.jmc.flightrecorder.test.rules.jdk.TestRulesWithJfr.verifyAl
>> lResults(TestRulesWithJfr.java:132)
>>
>> Cheers,
>> Mario
>>
>> >
>> > Kind regards,
>> >
>> > Marcus
>> >
>> >
>> >
>> > From: Ken Dobson <kdobson at redhat.com>
>> > Date: Tuesday, 6 November 2018 at 17:55
>> > To: Marcus Hirt <marcus.hirt at oracle.com>
>> > Cc: <jmc-dev at openjdk.java.net>
>> > Subject: Re: JMC-5703: HighGcRule should report extra needed event
>> > types
>> >
>> >
>> >
>> > Here's the updated patch, there doesn't appear to be any translations
>> > for it.
>> >
>> >
>> >
>> > Ken
>> >
>> >
>> >
>> > diff -r b3a23786ef23
>> > core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openj
>> > dk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>> > ---
>> > a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/ope
>> > njdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java Wed Oct
>> > 10 16:43:35 2018 -0400
>> > +++
>> > b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/ope
>> > njdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java Tue Nov
>> > 06 11:49:43 2018 -0500
>> > @@ -86,7 +86,8 @@
>> > String longMessage = message + " " +
>> > Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG);
>> > //$NON-NLS-1$
>> > if (!RulesToolkit.isEventsEnabled(items,
>> > JdkTypeIDs.ALLOC_INSIDE_TLAB, JdkTypeIDs.ALLOC_OUTSIDE_TLAB)) {
>> > longMessage = longMessage + "<p>" //$NON-NLS-1$
>> > - +
>> > Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DI
>> > SABLED);
>> > + +
>> > RulesToolkit.getEnabledEventTypesRecommendation(items,
>> > + JdkTypeIDs.ALLOC_INSIDE_TLAB,
>> > JdkTypeIDs.ALLOC_OUTSIDE_TLAB);
>> > }
>> > return new Result(this, score, message, longMessage,
>> > JdkQueries.GC_PAUSE);
>> > }
>> > diff -r b3a23786ef23
>> > core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openj
>> > dk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
>> > ---
>> > a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/ope
>> > njdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
>> > Wed Oct 10 16:43:35 2018 -0400
>> > +++
>> > b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/ope
>> > njdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
>> > Tue Nov 06 11:49:43 2018 -0500
>> > @@ -298,7 +298,6 @@
>> > public static final String HighGcRuleFactory_RULE_NAME =
>> > "HighGcRuleFactory_RULE_NAME"; //$NON-NLS-1$
>> > public static final String HighGcRuleFactory_TEXT_INFO =
>> > "HighGcRuleFactory_TEXT_INFO"; //$NON-NLS-1$
>> > public static final String HighGcRuleFactory_TEXT_INFO_LONG =
>> > "HighGcRuleFactory_TEXT_INFO_LONG"; //$NON-NLS-1$
>> > - public static final String
>> > HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED =
>> > "HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED"; //$NON-NLS-1$
>> > public static final String HighGcRuleFactory_TEXT_OK =
>> > "HighGcRuleFactory_TEXT_OK"; //$NON-NLS-1$
>> > public static final String HighJvmCpuRule_AGGR_MAX_ENDTIME =
>> > "HighJvmCpuRule_AGGR_MAX_ENDTIME"; //$NON-NLS-1$
>> > public static final String HighJvmCpuRule_AGGR_MIN_ENDTIME =
>> > "HighJvmCpuRule_AGGR_MIN_ENDTIME"; //$NON-NLS-1$
>> > diff -r b3a23786ef23
>> > core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/
>> > openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.prope
>> > rties
>> > ---
>> > a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/or
>> > g/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.pro
>> > perties Wed Oct 10 16:43:35 2018 -0400
>> > +++
>> > b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/or
>> > g/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.pro
>> > perties Tue Nov 06 11:49:43 2018 -0500
>> > @@ -321,7 +321,6 @@
>> > # {0} is a time period, {1} is a time stamp, {2} is a percentage
>> > HighGcRuleFactory_TEXT_INFO=The JVM was paused for {2} of the time
>> > during {0} starting at {1}.
>> > HighGcRuleFactory_TEXT_INFO_LONG=The time spent performing garbage
>> > collection may be reduced by increasing the heap size or by trying to
>> > reduce allocation.
>> > -HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED=Some allocation
>> > events were disabled in this recording. Enable them to help with
>> > troubleshooting this problem.
>> > HighGcRuleFactory_TEXT_OK=The runtime did not spend much time
>> > performing garbage collections.
>> > HighJvmCpuRule_AGGR_MAX_ENDTIME=Max End Time
>> > HighJvmCpuRule_AGGR_MIN_ENDTIME=Min End Time
>> >
>> >
>> >
>> > On Tue, Nov 6, 2018 at 11:43 AM Marcus Hirt <marcus.hirt at oracle.com>
>> > wrote:
>> >
>> > Hi Ken,
>> >
>> > Yes, if it is no longer used, please go ahead and remove both the
>> > constant and
>> > the entry in the associated properties files (might as well remove it
>> > from the
>> > translated files too).
>> >
>> > Kind regards,
>> > Marcus
>> >
>> > On 2018-11-06, 17:08, "jmc-dev on behalf of Ken Dobson" <
>> > jmc-dev-bounces at openjdk.java.net on behalf of kdobson at redhat.com>
>> > wrote:
>> >
>> > Hi all,
>> >
>> > This is a small patch to make the highGcRule consistent with the
>> > GcFreedRatioRule when reporting extra needed event types.
>> > Should I remove HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED
>> > from
>> > Messages.java given it is no longer used?
>> >
>> > Thanks,
>> >
>> > Ken Dobson
>> >
>> > diff -r b3a23786ef23
>> > core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/o
>> > penjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>> > ---
>> > a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org
>> > /openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>> > Wed Oct 10 16:43:35 2018 -0400
>> > +++
>> > b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org
>> > /openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>> > Tue Nov 06 10:33:20 2018 -0500
>> > @@ -84,9 +84,11 @@
>> > String message =
>> > MessageFormat.format(Messages.getString(Messages.HighGcRuleFactor
>> > y_TEXT_INFO),
>> > duration,
>> > startTime,
>> > pausePercent.displayUsing(IDisplayable.AUTO));
>> > String longMessage = message + " " +
>> > Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG);
>> > //$NON-NLS-1$
>> > if (!RulesToolkit.isEventsEnabled(items,
>> > JdkTypeIDs.ALLOC_INSIDE_TLAB, JdkTypeIDs.ALLOC_OUTSIDE_TLAB)) {
>> > longMessage = longMessage + "<p>" //$NON-NLS-1$
>> > - +
>> > Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG_ALLO
>> > C_DISABLED);
>> > + +
>> > RulesToolkit.getEnabledEventTypesRecommendation(items,
>> > + JdkTypeIDs.ALLOC_INSIDE_TLAB,
>> > JdkTypeIDs.ALLOC_OUTSIDE_TLAB);
>> > }
>> > return new Result(this, score, message, longMessage,
>> > JdkQueries.GC_PAUSE);
>> > }
>> >
>> >
>> >
>> >
>> --
>> Mario Torre
>> Associate Manager, Software Engineering
>> Red Hat GmbH <https://www.redhat.com>
>> 9704 A60C B4BE A8B8 0F30 9205 5D7E 4952 3F65 7898
>>
--
Mario Torre
Associate Manager, Software Engineering
Red Hat GmbH <https://www.redhat.com>
9704 A60C B4BE A8B8 0F30 9205 5D7E 4952 3F65 7898
More information about the jmc-dev
mailing list