jdk.jfr.internal.Options Java Examples

The following examples show how to use jdk.jfr.internal.Options. 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: TestJcmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static Object getOption(String name) {
    switch (name) {
        case DUMPPATH: return Options.getDumpPath().toString();
        case STACK_DEPTH: return Options.getStackDepth();
        case GLOBAL_BUFFER_COUNT: return Options.getGlobalBufferCount();
        case GLOBAL_BUFFER_SIZE: return Options.getGlobalBufferSize();
        case THREAD_BUFFER_SIZE: return Options.getThreadBufferSize();
        case MAX_CHUNK_SIZE: return Options.getMaxChunkSize();
        case SAMPLE_THREADS: return Options.getSampleThreads();
        default: throw new RuntimeException("Unknown option " + name);
    }
}
 
Example #2
Source File: FlightRecorder.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the Flight Recorder for the platform.
 *
 * @return a Flight Recorder instance, not {@code null}
 *
 * @throws IllegalStateException if the platform Flight Recorder couldn't be
 *         created (for example, if the file repository can't be created or
 *         accessed)
 *
 * @throws SecurityException if a security manager exists and the caller does
 *         not have {@code FlightRecorderPermission("accessFlightRecorder")}
 */
public static FlightRecorder getFlightRecorder() throws IllegalStateException, SecurityException {
    synchronized (PlatformRecorder.class) {
        Utils.checkAccessFlightRecorder();
        JVMSupport.ensureWithIllegalStateException();
        if (platformRecorder == null) {
            try {
                platformRecorder = new FlightRecorder(new PlatformRecorder());
            } catch (IllegalStateException ise) {
                throw ise;
            } catch (Exception e) {
                throw new IllegalStateException("Can't create Flight Recorder. " + e.getMessage(), e);
            }
            // Must be in synchronized block to prevent instance leaking out
            // before initialization is done
            initialized = true;
            Logger.log(JFR, INFO, "Flight Recorder initialized");
            Logger.log(JFR, DEBUG, "maxchunksize: " + Options.getMaxChunkSize()+ " bytes");
            Logger.log(JFR, DEBUG, "memorysize: " + Options.getMemorySize()+ " bytes");
            Logger.log(JFR, DEBUG, "globalbuffersize: " + Options.getGlobalBufferSize()+ " bytes");
            Logger.log(JFR, DEBUG, "globalbuffercount: " + Options.getGlobalBufferCount());
            Logger.log(JFR, DEBUG, "dumppath: " + Options.getDumpPath());
            Logger.log(JFR, DEBUG, "samplethreads: " + Options.getSampleThreads());
            Logger.log(JFR, DEBUG, "stackdepth: " + Options.getStackDepth());
            Logger.log(JFR, DEBUG, "threadbuffersize: " + Options.getThreadBufferSize());
            Logger.log(JFR, LogLevel.INFO, "Created repository " + Repository.getRepository().getRepositoryPath().toString());
            PlatformRecorder.notifyRecorderInitialized(platformRecorder);
        }
    }
    return platformRecorder;
}
 
Example #3
Source File: TestJcmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Object getOption(String name) {
    switch (name) {
        case DUMPPATH: return Options.getDumpPath().toString();
        case STACK_DEPTH: return Options.getStackDepth();
        case GLOBAL_BUFFER_COUNT: return Options.getGlobalBufferCount();
        case GLOBAL_BUFFER_SIZE: return Options.getGlobalBufferSize();
        case THREAD_BUFFER_SIZE: return Options.getThreadBufferSize();
        case MAX_CHUNK_SIZE: return Options.getMaxChunkSize();
        case SAMPLE_THREADS: return Options.getSampleThreads();
        default: throw new RuntimeException("Unknown option " + name);
    }
}
 
Example #4
Source File: FlightRecorder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the Flight Recorder for the platform.
 *
 * @return a Flight Recorder instance, not {@code null}
 *
 * @throws IllegalStateException if Flight Recorder can't be created (for
 *         example, if the Java Virtual Machine (JVM) lacks Flight Recorder
 *         support, or if the file repository can't be created or accessed)
 *
 * @throws SecurityException if a security manager exists and the caller does
 *         not have {@code FlightRecorderPermission("accessFlightRecorder")}
 */
public static FlightRecorder getFlightRecorder() throws IllegalStateException, SecurityException {
    synchronized (PlatformRecorder.class) {
        Utils.checkAccessFlightRecorder();
        JVMSupport.ensureWithIllegalStateException();
        if (platformRecorder == null) {
            try {
                platformRecorder = new FlightRecorder(new PlatformRecorder());
            } catch (IllegalStateException ise) {
                throw ise;
            } catch (Exception e) {
                throw new IllegalStateException("Can't create Flight Recorder. " + e.getMessage(), e);
            }
            // Must be in synchronized block to prevent instance leaking out
            // before initialization is done
            initialized = true;
            Logger.log(JFR, INFO, "Flight Recorder initialized");
            Logger.log(JFR, DEBUG, "maxchunksize: " + Options.getMaxChunkSize()+ " bytes");
            Logger.log(JFR, DEBUG, "memorysize: " + Options.getMemorySize()+ " bytes");
            Logger.log(JFR, DEBUG, "globalbuffersize: " + Options.getGlobalBufferSize()+ " bytes");
            Logger.log(JFR, DEBUG, "globalbuffercount: " + Options.getGlobalBufferCount());
            Logger.log(JFR, DEBUG, "dumppath: " + Options.getDumpPath());
            Logger.log(JFR, DEBUG, "samplethreads: " + Options.getSampleThreads());
            Logger.log(JFR, DEBUG, "stackdepth: " + Options.getStackDepth());
            Logger.log(JFR, DEBUG, "threadbuffersize: " + Options.getThreadBufferSize());
            Logger.log(JFR, LogLevel.INFO, "Created repository " + Repository.getRepository().getRepositoryPath().toString());
            PlatformRecorder.notifyRecorderInitialized(platformRecorder);
        }
    }
    return platformRecorder;
}
 
Example #5
Source File: TestJcmdConfigure.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Object getOption(String name) {
    switch (name) {
        case DUMPPATH: return Options.getDumpPath().toString();
        case STACK_DEPTH: return Options.getStackDepth();
        case GLOBAL_BUFFER_COUNT: return Options.getGlobalBufferCount();
        case GLOBAL_BUFFER_SIZE: return Options.getGlobalBufferSize();
        case THREAD_BUFFER_SIZE: return Options.getThreadBufferSize();
        case MAX_CHUNK_SIZE: return Options.getMaxChunkSize();
        case SAMPLE_THREADS: return Options.getSampleThreads();
        default: throw new RuntimeException("Unknown option " + name);
    }
}
 
Example #6
Source File: FlightRecorder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the Flight Recorder for the platform.
 *
 * @return a Flight Recorder instance, not {@code null}
 *
 * @throws IllegalStateException if Flight Recorder can't be created (for
 *         example, if the Java Virtual Machine (JVM) lacks Flight Recorder
 *         support, or if the file repository can't be created or accessed)
 *
 * @throws SecurityException if a security manager exists and the caller does
 *         not have {@code FlightRecorderPermission("accessFlightRecorder")}
 */
public static FlightRecorder getFlightRecorder() throws IllegalStateException, SecurityException {
    synchronized (PlatformRecorder.class) {
        Utils.checkAccessFlightRecorder();
        JVMSupport.ensureWithIllegalStateException();
        if (platformRecorder == null) {
            try {
                platformRecorder = new FlightRecorder(new PlatformRecorder());
            } catch (IllegalStateException ise) {
                throw ise;
            } catch (Exception e) {
                throw new IllegalStateException("Can't create Flight Recorder. " + e.getMessage(), e);
            }
            // Must be in synchronized block to prevent instance leaking out
            // before initialization is done
            initialized = true;
            Logger.log(JFR, INFO, "Flight Recorder initialized");
            Logger.log(JFR, DEBUG, "maxchunksize: " + Options.getMaxChunkSize()+ " bytes");
            Logger.log(JFR, DEBUG, "memorysize: " + Options.getMemorySize()+ " bytes");
            Logger.log(JFR, DEBUG, "globalbuffersize: " + Options.getGlobalBufferSize()+ " bytes");
            Logger.log(JFR, DEBUG, "globalbuffercount: " + Options.getGlobalBufferCount());
            Logger.log(JFR, DEBUG, "dumppath: " + Options.getDumpPath());
            Logger.log(JFR, DEBUG, "samplethreads: " + Options.getSampleThreads());
            Logger.log(JFR, DEBUG, "stackdepth: " + Options.getStackDepth());
            Logger.log(JFR, DEBUG, "threadbuffersize: " + Options.getThreadBufferSize());
            Logger.log(JFR, LogLevel.INFO, "Created repository " + Repository.getRepository().getRepositoryPath().toString());
            PlatformRecorder.notifyRecorderInitialized(platformRecorder);
        }
    }
    return platformRecorder;
}
 
Example #7
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printMemorySize() {
    print("Memory size: ");
    printBytes(Options.getMemorySize());
    println();
}
 
Example #8
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printGlobalBufferCount() {
    println("Global buffer count: " +  Options.getGlobalBufferCount());
}
 
Example #9
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printMaxChunkSize() {
    print("Max chunk size: ");
    printBytes(Options.getMaxChunkSize());
    println();
}
 
Example #10
Source File: TestMemoryOptions.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void populateResults() {
    optionList.get(MEMORYSIZE).setResult(Options.getMemorySize(), 'b');
    optionList.get(GLOBALBUFFERSIZE).setResult(Options.getGlobalBufferSize(), 'b');
    optionList.get(GLOBALBUFFERCOUNT).setResult(Options.getGlobalBufferCount(), 'b');
    optionList.get(THREADBUFFERSIZE).setResult(Options.getThreadBufferSize(), 'b');
}
 
Example #11
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printDumpPath() {
    print("Dump path: ");
    printPath(Options.getDumpPath());
    println();
}
 
Example #12
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printSampleThreads() {
    println("Sample threads: " + Options.getSampleThreads());
}
 
Example #13
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printStackDepth() {
    println("Stack depth: " +  Options.getStackDepth());
}
 
Example #14
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printGlobalBufferCount() {
    println("Global buffer count: " +  Options.getGlobalBufferCount());
}
 
Example #15
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printGlobalBufferSize() {
    print("Global buffer size: ");
    printBytes(Options.getGlobalBufferSize());
    println();
}
 
Example #16
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printThreadBufferSize() {
    print("Thread buffer size: ");
    printBytes(Options.getThreadBufferSize());
    println();
}
 
Example #17
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printMemorySize() {
    print("Memory size: ");
    printBytes(Options.getMemorySize());
    println();
}
 
Example #18
Source File: DCmdConfigure.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void printMaxChunkSize() {
    print("Max chunk size: ");
    printBytes(Options.getMaxChunkSize());
    println();
}
 
Example #19
Source File: TestMemoryOptions.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void populateResults() {
    optionList.get(MEMORYSIZE).setResult(Options.getMemorySize(), 'b');
    optionList.get(GLOBALBUFFERSIZE).setResult(Options.getGlobalBufferSize(), 'b');
    optionList.get(GLOBALBUFFERCOUNT).setResult(Options.getGlobalBufferCount(), 'b');
    optionList.get(THREADBUFFERSIZE).setResult(Options.getThreadBufferSize(), 'b');
}
 
Example #20
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printThreadBufferSize() {
    print("Thread buffer size: ");
    printBytes(Options.getThreadBufferSize());
    println();
}
 
Example #21
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printGlobalBufferSize() {
    print("Global buffer size: ");
    printBytes(Options.getGlobalBufferSize());
    println();
}
 
Example #22
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printStackDepth() {
    println("Stack depth: " +  Options.getStackDepth());
}
 
Example #23
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printSampleThreads() {
    println("Sample threads: " + Options.getSampleThreads());
}
 
Example #24
Source File: DCmdConfigure.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printDumpPath() {
    print("Dump path: ");
    printPath(Options.getDumpPath());
    println();
}
 
Example #25
Source File: TestMemoryOptions.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void populateResults() {
    optionList.get(MEMORYSIZE).setResult(Options.getMemorySize(), 'b');
    optionList.get(GLOBALBUFFERSIZE).setResult(Options.getGlobalBufferSize(), 'b');
    optionList.get(GLOBALBUFFERCOUNT).setResult(Options.getGlobalBufferCount(), 'b');
    optionList.get(THREADBUFFERSIZE).setResult(Options.getThreadBufferSize(), 'b');
}
 
Example #26
Source File: DCmdConfigure.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void printObjectAllocationsSamplingInterval() {
    println("objects allocations sampling interval: " + Options.getObjectAllocationsSamplingInterval());
}
 
Example #27
Source File: DCmdConfigure.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void printSampleObjectAllocations() {
    println("Sample object allocations: " + Options.getSampleObjectAllocations());
}
 
Example #28
Source File: DCmdConfigure.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void printMaxChunkSize() {
    print("Max chunk size: ");
    printBytes(Options.getMaxChunkSize(), " ");
    println();
}
 
Example #29
Source File: DCmdConfigure.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void printMemorySize() {
    print("Memory size: ");
    printBytes(Options.getMemorySize(), " ");
    println();
}
 
Example #30
Source File: DCmdConfigure.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void printThreadBufferSize() {
    print("Thread buffer size: ");
    printBytes(Options.getThreadBufferSize(), " ");
    println();
}