jdk.jfr.internal.settings.CutoffSetting Java Examples

The following examples show how to use jdk.jfr.internal.settings.CutoffSetting. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OldObjectSample.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void emit(List<PlatformRecording> recordings, Boolean pathToGcRoots) {
    boolean enabled = false;
    long cutoffNanos = Boolean.TRUE.equals(pathToGcRoots) ? Long.MAX_VALUE : 0L;
    for (PlatformRecording r : recordings) {
        if (r.getState() == RecordingState.RUNNING) {
            if (isEnabled(r)) {
                enabled = true;
                long c = CutoffSetting.parseValueSafe(r.getSettings().get(OLD_OBJECT_CUTOFF));
                cutoffNanos = Math.max(c, cutoffNanos);
            }
        }
    }
    if (enabled) {
        long ticks = Utils.nanosToTicks(cutoffNanos);
        JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples());
    }
}
 
Example #2
Source File: OldObjectSample.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static void emit(List<PlatformRecording> recordings, Boolean pathToGcRoots) {
    boolean enabled = false;
    long cutoffNanos = Boolean.TRUE.equals(pathToGcRoots) ? Long.MAX_VALUE : 0L;
    for (PlatformRecording r : recordings) {
        if (r.getState() == RecordingState.RUNNING) {
            if (isEnabled(r)) {
                enabled = true;
                long c = CutoffSetting.parseValueSafe(r.getSettings().get(OLD_OBJECT_CUTOFF));
                cutoffNanos = Math.max(c, cutoffNanos);
            }
        }
    }
    if (enabled) {
        long ticks = Utils.nanosToTicks(cutoffNanos);
        JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples());
    }
}
 
Example #3
Source File: EventControl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Control defineCutoff(PlatformEventType type) {
    Cutoff cutoff = type.getAnnotation(Cutoff.class);
    String def = Cutoff.INIFITY;
    if (cutoff != null) {
        def = cutoff.value();
    }
    type.add(PrivateAccess.getInstance().newSettingDescriptor(TYPE_CUTOFF, Cutoff.NAME, def, Collections.emptyList()));
    return new CutoffSetting(type, def);
}
 
Example #4
Source File: PlatformRecorder.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void emitOldObjectSamples(PlatformRecording recording) {
    Map<String, String> settings = recording.getSettings();
    String s = settings.get("com.oracle.jdk.OldObjectSample#" + Enabled.NAME);
    if ("true".equals(s)) {
        long nanos = CutoffSetting.parseValueSafe(settings.get("com.oracle.jdk.OldObjectSample#" + Cutoff.NAME));
        long ticks = Utils.nanosToTicks(nanos);
        JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples());
    }
}
 
Example #5
Source File: OldObjectSample.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void emit(PlatformRecording recording) {
    if (isEnabled(recording)) {
        long nanos = CutoffSetting.parseValueSafe(recording.getSettings().get(OLD_OBJECT_CUTOFF));
        long ticks = Utils.nanosToTicks(nanos);
        JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples());
    }
}
 
Example #6
Source File: EventControl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Control defineCutoff(PlatformEventType type) {
    Cutoff cutoff = type.getAnnotation(Cutoff.class);
    String def = Cutoff.INIFITY;
    if (cutoff != null) {
        def = cutoff.value();
    }
    type.add(PrivateAccess.getInstance().newSettingDescriptor(TYPE_CUTOFF, Cutoff.NAME, def, Collections.emptyList()));
    return new CutoffSetting(type, def);
}
 
Example #7
Source File: OldObjectSample.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void emit(PlatformRecording recording) {
    if (isEnabled(recording)) {
        long nanos = CutoffSetting.parseValueSafe(recording.getSettings().get(OLD_OBJECT_CUTOFF));
        long ticks = Utils.nanosToTicks(nanos);
        JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples());
    }
}
 
Example #8
Source File: EventControl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static Control defineCutoff(PlatformEventType type) {
    Cutoff cutoff = type.getAnnotation(Cutoff.class);
    String def = Cutoff.INIFITY;
    if (cutoff != null) {
        def = cutoff.value();
    }
    type.add(PrivateAccess.getInstance().newSettingDescriptor(TYPE_CUTOFF, Cutoff.NAME, def, Collections.emptyList()));
    return new CutoffSetting(type, def);
}