[PATCH] JMC-4467 : Excessive debug logging of VM options when using Flight recorder

Marcus Hirt marcus.hirt at oracle.com
Fri Nov 16 12:13:55 UTC 2018


Guru,

Never mind this for now. There will be an updated solution a bit later.

Kind regards,
Marcus

On 2018-11-16, 10:08, "jmc-dev on behalf of Miro Wengner" <jmc-dev-bounces at openjdk.java.net on behalf of miro.wengner at gmail.com> wrote:

    Hi Guru, 
      here is the patch.
      patch: JMC-4467
    
    diff -r 997060a24c42 application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java
    --- a/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java	Thu Nov 15 16:50:36 2018 +0100
    +++ b/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java	Thu Nov 15 22:04:39 2018 +0100
    @@ -104,6 +104,9 @@
     	private List<EventTypeMetadataV1> eventTypeMetas;
     	private Map<Integer, EventTypeMetadataV1> eventTypeMetaByInt;
     	private Map<EventTypeIDV1, EventTypeMetadataV1> eventTypeInfoById;
    +	// Optimization to do less JMX invocations. If, against all odds, it gets disabled,
    +	//after having been enabled, we get an exception, and will handle things there.
    +	private boolean wasEnabled;
     	private final ICommercialFeaturesService cfs;
     	private final IMBeanHelperService mbhs;
     	private final String serverId;
    @@ -444,7 +447,14 @@
     
     	@Override
     	public boolean isEnabled() {
    -		return cfs.isCommercialFeaturesEnabled();
    +		if(!wasEnabled) {
    +			final boolean isEnabled = cfs.isCommercialFeaturesEnabled();
    +			if(isEnabled) {
    +				wasEnabled = isEnabled;
    +			}
    +			return isEnabled;
    +		}
    +		return wasEnabled;
     	}
     
     	@Override
    diff -r 997060a24c42 application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java
    --- a/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java	Thu Nov 15 16:50:36 2018 +0100
    +++ b/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java	Thu Nov 15 22:04:39 2018 +0100
    @@ -90,6 +90,9 @@
     	private List<EventTypeMetadataV2> eventTypeMetas;
     	private Map<EventTypeIDV2, EventTypeMetadataV2> eventTypeInfoById;
     	private Map<org.openjdk.jmc.flightrecorder.configuration.events.EventOptionID, OptionInfo<?>> optionInfoById;
    +	// Optimization to do less JMX invocations. If, against all odds, it gets disabled,
    +	// after having been enabled, we get an exception, and will handle things there.
    +	private boolean wasEnabled;
     	private final ICommercialFeaturesService cfs;
     	private final IMBeanHelperService mbhs;
     	private final String serverId;
    @@ -477,9 +480,14 @@
     
     	@Override
     	public boolean isEnabled() {
    -		return isFlightRecorderCommercial()
    -				? cfs.isCommercialFeaturesEnabled()
    -				: isAvailable(connection);
    +		if(!wasEnabled) {
    +			final boolean isEnabled = isFlightRecorderCommercial() ? cfs.isCommercialFeaturesEnabled() : isAvailable(connection);
    +			if(isEnabled) {
    +				wasEnabled = isEnabled;
    +			}
    +			return isEnabled;
    +		}
    +		return wasEnabled;
     	}
     
     	@Override
    
    > On Nov 16, 2018, at 4:32 AM, Guru <guru.hb at oracle.com> wrote:
    > 
    > Hi Miro,
    > 
    > <Excluded jmc-de mailing list> 
    > 
    > I didn’t see the patch in the email, Please paste the same in .diff or paste the .diff content over email (if the diff is small enough). 
    > 
    > Thanks,
    > Guru
    >> On 16-Nov-2018, at 4:14 AM, Miro Wengner <miro.wengner at gmail.com> wrote:
    >> 
    >> Hi There, 
    >> here is a patch to the bug JMC-4467. 
    >> As Marcus has helped me, I think there should be another reviewer. 
    >> 
    >> Thank you Marcus, 
    >> Kind Regards, 
    >> Miro
    >> 
    >> 
    > 
    
    
    




More information about the jmc-dev mailing list