Skip to content

Commit

Permalink
[GR-34389] Moved all JFR-related files to com.oracle.svm.core.
Browse files Browse the repository at this point in the history
PullRequest: graal/10826
  • Loading branch information
christianhaeubl committed Jan 25, 2022
2 parents 04cb47f + c158d87 commit 8676f60
Show file tree
Hide file tree
Showing 66 changed files with 178 additions and 209 deletions.
80 changes: 27 additions & 53 deletions substratevm/mx.substratevm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,12 @@
"com.oracle.svm.common",
],
"requires" : [
"java.compiler",
"java.logging",
"java.scripting",
"jdk.jfr",
"jdk.management",
"jdk.unsupported",
"java.compiler",
],
"requiresConcealed" : {
"java.base" : [
Expand All @@ -198,18 +199,19 @@
"sun.security.jca",
"sun.security.ssl",
"sun.security.util",
"sun.text.spi",
"sun.util",
"sun.util.calendar",
"sun.util.locale.provider",
"sun.util.resources",
"jdk.internal.module",
"jdk.internal.reflect",
"jdk.internal.misc",
"jdk.internal.logger",
"jdk.internal.event",
"jdk.internal.loader",
"sun.text.spi",
"jdk.internal.logger",
"jdk.internal.misc",
"jdk.internal.module",
"jdk.internal.perf",
"jdk.internal.ref",
"jdk.internal.reflect",
],
"java.desktop": [
"sun.java2d",
Expand All @@ -219,6 +221,12 @@
"com.sun.jmx.mbeanserver",
"sun.management",
],
"jdk.jfr": [
"jdk.jfr.events",
"jdk.jfr.internal",
"jdk.jfr.internal.jfc",
"jdk.jfr.internal.handlers",
],
},
"javaCompliance": "11+",
"checkstyleVersion" : "8.36.1",
Expand Down Expand Up @@ -414,6 +422,7 @@
"java.security.sasl",
"java.smartcardio",
"java.xml.crypto",
"jdk.jfr",
"jdk.management",
"jdk.unsupported",
],
Expand All @@ -433,8 +442,18 @@
"sun.util.locale"
],
"jdk.internal.vm.ci" : [
"jdk.vm.ci.runtime",
"jdk.vm.ci.meta",
"jdk.vm.ci.code",
"jdk.vm.ci.code.site",
"jdk.vm.ci.hotspot",
"jdk.vm.ci.runtime",
],
"jdk.management": [
"com.sun.management.internal"
],
"jdk.jfr": [
"jdk.jfr.internal",
"jdk.jfr.internal.jfc",
],
},
"javaCompliance": "11+",
Expand Down Expand Up @@ -597,50 +616,6 @@
"spotbugs": "false",
},

"com.oracle.svm.jfr": {
"subDir": "src",
"sourceDirs": ["src"],
"dependencies": [
"com.oracle.svm.hosted",
],
"checkstyle": "com.oracle.svm.core",
"javaCompliance": "11+",
"requires": [
"jdk.jfr",
"jdk.management",
"jdk.unsupported"
],
"requiresConcealed": {
"jdk.management": [
"com.sun.management.internal"
],
"jdk.jfr": [
"jdk.jfr.internal",
"jdk.jfr.internal.consumer",
"jdk.jfr.internal.jfc",
"jdk.jfr.internal.handlers",
"jdk.jfr.events"
],
"jdk.internal.vm.ci": [
"jdk.vm.ci.meta",
"jdk.vm.ci.code",
"jdk.vm.ci.code.site",
"jdk.vm.ci.hotspot"
],
"java.base": [
"jdk.internal.event",
"jdk.internal.misc",
"jdk.internal.util.xml",
"jdk.internal.util.xml.impl",
"jdk.internal.org.xml.sax.helpers"
]
},
"annotationProcessors": [
"compiler:GRAAL_PROCESSOR",
],
"workingSets": "SVM",
},

"com.oracle.svm.driver": {
"subDir": "src",
"sourceDirs": [
Expand Down Expand Up @@ -1109,7 +1084,6 @@
"com.oracle.svm.core.genscavenge",
"com.oracle.svm.core.containers",
"com.oracle.svm.jni",
"com.oracle.svm.jfr",
"com.oracle.svm.reflect",
"com.oracle.svm.methodhandles"
],
Expand All @@ -1132,7 +1106,7 @@
"com.oracle.svm.core", # Uses of com.oracle.svm.core.TypeResult
"com.oracle.svm.core.util", # Uses of com.oracle.svm.core.util.VMError
"com.oracle.svm.core.jni", # Uses of com.oracle.svm.core.jni.JNIRuntimeAccess
"com.oracle.svm.jfr", # Uses of com.oracle.svm.jfr.JfrEnabled
"com.oracle.svm.core.jfr", # Uses of com.oracle.svm.core.jfr.JfrEnabled
"com.oracle.svm.hosted to java.base",
"com.oracle.svm.hosted.agent to java.instrument",
"com.oracle.svm.truffle.api to org.graalvm.truffle",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import com.oracle.svm.core.c.struct.PinnedObjectField;
import org.graalvm.nativeimage.c.struct.RawField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.compiler.api.replacements.Fold;
import org.graalvm.compiler.nodes.NamedLocationIdentity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

/**
* List of all possible {@link com.oracle.svm.jfr.JfrBuffer} types.
* List of all possible {@link JfrBuffer} types.
*/
public enum JfrBufferType {
/**
* A thread-local native buffer, see {@link com.oracle.svm.jfr.JfrThreadLocal}.
* A thread-local native buffer, see {@link JfrThreadLocal}.
*/
THREAD_LOCAL_NATIVE,
/**
* A thread-local java buffer, see {@link com.oracle.svm.jfr.JfrThreadLocal}.
* A thread-local java buffer, see {@link JfrThreadLocal}.
*/
THREAD_LOCAL_JAVA,
/**
* A global JFR buffer, see {@link com.oracle.svm.jfr.JfrGlobalMemory}.
* A global JFR buffer, see {@link JfrGlobalMemory}.
*/
GLOBAL_MEMORY,
/**
* Other buffers that live in the C heap and that can be resized (i.e., reallocated) if
* necessary. This type is for example used for the epoch-based global buffers in
* {@link com.oracle.svm.jfr.JfrThreadRepository}.
* {@link JfrThreadRepository}.
*/
C_HEAP
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.nativeimage.c.struct.RawPointerTo;
import org.graalvm.word.PointerBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import java.nio.charset.StandardCharsets;
import java.util.concurrent.locks.ReentrantLock;
Expand All @@ -42,7 +42,7 @@
import com.oracle.svm.core.thread.VMOperation;
import com.oracle.svm.core.thread.VMOperationControl;
import com.oracle.svm.core.thread.VMThreads;
import com.oracle.svm.jfr.traceid.JfrTraceIdEpoch;
import com.oracle.svm.core.jfr.traceid.JfrTraceIdEpoch;

/**
* This class is used when writing the in-memory JFR data to a file. For all operations, except
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import com.oracle.svm.core.annotate.Uninterruptible;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import java.util.function.BooleanSupplier;

Expand All @@ -40,6 +40,13 @@ public boolean getAsBoolean() {

@Fold
public static boolean get() {
return ImageSingletons.contains(JfrFeature.class);
return ImageSingletons.contains(JfrManager.class);
}
}

class JfrHostedEnabled implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return ImageSingletons.contains(JfrManager.class) && ImageSingletons.lookup(JfrManager.class).hostedEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import java.lang.reflect.Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.compiler.core.common.NumUtil;
import org.graalvm.compiler.options.OptionsParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import java.io.FileNotFoundException;
import java.io.IOException;
Expand All @@ -44,8 +44,8 @@
import com.oracle.svm.core.SubstrateOptions;
import com.oracle.svm.core.util.UserError.UserException;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.jfr.events.EndChunkNativePeriodicEvents;
import com.oracle.svm.jfr.events.EveryChunkNativePeriodicEvents;
import com.oracle.svm.core.jfr.events.EndChunkNativePeriodicEvents;
import com.oracle.svm.core.jfr.events.EveryChunkNativePeriodicEvents;

import jdk.jfr.FlightRecorder;
import jdk.jfr.Recording;
Expand All @@ -64,16 +64,19 @@
public class JfrManager {
private static final String DEFAULT_JFC_NAME = "default";

final boolean hostedEnabled;

@Platforms(Platform.HOSTED_ONLY.class)
public JfrManager() {
public JfrManager(boolean hostedEnabled) {
this.hostedEnabled = hostedEnabled;
}

@Fold
static JfrManager get() {
public static JfrManager get() {
return ImageSingletons.lookup(JfrManager.class);
}

Runnable startupHook() {
public Runnable startupHook() {
return () -> {
parseFlightRecorderLogging(SubstrateOptions.FlightRecorderLogging.getValue());
if (SubstrateOptions.FlightRecorder.getValue()) {
Expand All @@ -83,7 +86,7 @@ Runnable startupHook() {
};
}

Runnable shutdownHook() {
public Runnable shutdownHook() {
return () -> {
if (SubstrateOptions.FlightRecorder.getValue()) {
// Everything should already have been torn down by JVM.destroyJFR(), which is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import com.oracle.svm.core.annotate.Uninterruptible;
import org.graalvm.nativeimage.Platform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.jfr;
package com.oracle.svm.core.jfr;

import org.graalvm.nativeimage.CurrentIsolate;
import org.graalvm.nativeimage.IsolateThread;
Expand Down
Loading

0 comments on commit 8676f60

Please sign in to comment.