Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f3f4d51
rebase with master. basic. Not uninterruptible. No stack traces
roberttoyonaga Jan 10, 2023
6aeef6b
add weight
roberttoyonaga Jan 17, 2023
b72be8a
evenly space out samples based on previous window
roberttoyonaga Jan 18, 2023
bdc75f2
debt. tests. EWMA.
roberttoyonaga Jan 25, 2023
59b19f4
normalize and set low rate. tests pass
roberttoyonaga Jan 30, 2023
26ab73c
minor updates, comments, text adjustment
roberttoyonaga May 5, 2023
f4ce168
improve tests
roberttoyonaga May 9, 2023
1d6f2f4
use VMMutex instead of spinlock. Minor tweaks
roberttoyonaga Jun 19, 2023
0c1736d
fix computeAccumulatedDebtCarryLimit. Add zeroRate test. Add partial …
roberttoyonaga Jun 19, 2023
929debd
distribution tests and fix adjustedProjectedpop
roberttoyonaga Jun 22, 2023
d1386ea
cleanup. Fix EWMA test case
roberttoyonaga Jun 23, 2023
dc8f2d0
use geometric sampling distribution. Adjust debt testcase
roberttoyonaga Jun 23, 2023
ecc2da1
Clean up. Group allocation events. Add testing back door static class.
roberttoyonaga Jun 23, 2023
26b20bd
gate fixes
roberttoyonaga Jun 27, 2023
2f3ff73
throttle
roberttoyonaga Jun 27, 2023
e9bb9ac
clean up volatile vars
roberttoyonaga Jul 5, 2023
9a20073
update changelog
roberttoyonaga Jul 7, 2023
07dfc05
Merge branch 'master' into throttle
roberttoyonaga Jul 7, 2023
1990018
clean up missed comments
roberttoyonaga Jul 10, 2023
2d94e69
Merge branch 'throttle' of github.com:roberttoyonaga/graal into throttle
roberttoyonaga Jul 10, 2023
db05846
merge master
roberttoyonaga Sep 19, 2023
f585631
minor review feedback resolution
roberttoyonaga Sep 20, 2023
1823f09
remove JfrThrottlerSupport. Add field to JfrEvent. Order JfrThrottler…
roberttoyonaga Sep 21, 2023
750cf4b
make uninterruptible. JfrRandom
roberttoyonaga Sep 25, 2023
f68763a
add read-write lock
roberttoyonaga Sep 25, 2023
34ceac8
cleanup. comments. javadoc. error handling. reset lastAllocationSize.
roberttoyonaga Sep 26, 2023
d4eb401
dedicated test class in test code
roberttoyonaga Sep 26, 2023
1093ee6
merge master
roberttoyonaga Sep 27, 2023
48ac440
gate fixes and cleaning
roberttoyonaga Sep 27, 2023
f5fa957
gate fixes. Math.ceil and style
roberttoyonaga Sep 27, 2023
41811ee
fix some concurrency issues
roberttoyonaga Oct 11, 2023
47928ae
fix conflicts
roberttoyonaga Nov 1, 2023
7e2cb91
minor clean up. Use jdk.graal.compiler
roberttoyonaga Nov 1, 2023
63c89ed
Merge branch 'master' of github.com:roberttoyonaga/graal into throttle
roberttoyonaga Nov 13, 2023
1c021bd
Merge branch 'master' into throttle
roberttoyonaga Nov 13, 2023
b0960fe
fix conflicts
roberttoyonaga Nov 13, 2023
4e77a8d
Merge branch 'master' of github.com:roberttoyonaga/graal into throttle
roberttoyonaga Dec 4, 2023
8a64fd6
comment
roberttoyonaga Dec 4, 2023
6db1df2
style
roberttoyonaga Dec 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions substratevm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This changelog summarizes major changes to GraalVM Native Image.
* (GR-48304) Red Hat added support for the JFR event ThreadAllocationStatistics.
* (GR-48343) Red Hat added support for the JFR events AllocationRequiringGC and SystemGC.
* (GR-48612) Enable `--strict-image-heap` by default. The option is now deprecated and can be removed from your argument list. A blog post with more information will follow shortly.
* (GR-47109) JFR event throttling support was added, along with the jdk.ObjectAllocationSample event.
* (GR-48354) Remove native-image-agent legacy `build`-option
* (GR-49221) Support for thread dumps can now be enabled with `--enable-monitoring=threaddump`. The option `-H:±DumpThreadStacksOnSignal` is deprecated and marked for removal.
* (GR-48579) Options ParseOnce, ParseOnceJIT, and InlineBeforeAnalysis are deprecated and no longer have any effect.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import com.oracle.svm.core.hub.DynamicHub;
import com.oracle.svm.core.hub.LayoutEncoding;
import com.oracle.svm.core.jfr.JfrTicks;
import com.oracle.svm.core.jfr.events.ObjectAllocationInNewTLABEvent;
import com.oracle.svm.core.jfr.events.JfrAllocationEvents;
import com.oracle.svm.core.log.Log;
import com.oracle.svm.core.snippets.KnownIntrinsics;
import com.oracle.svm.core.snippets.SubstrateForeignCallTarget;
Expand Down Expand Up @@ -238,7 +238,7 @@ private static Object slowPathNewInstanceWithoutAllocating(DynamicHub hub) {
AlignedHeader newTlab = HeapImpl.getChunkProvider().produceAlignedChunk();
return allocateInstanceInNewTlab(hub, size, newTlab);
} finally {
ObjectAllocationInNewTLABEvent.emit(startTicks, hub, size, HeapParameters.getAlignedHeapChunkSize());
JfrAllocationEvents.emit(startTicks, hub, size, HeapParameters.getAlignedHeapChunkSize());
DeoptTester.enableDeoptTesting();
}
}
Expand Down Expand Up @@ -319,7 +319,7 @@ private static Object slowPathNewArrayLikeObject0(DynamicHub hub, int length, Un
}
return array;
} finally {
ObjectAllocationInNewTLABEvent.emit(startTicks, hub, size, tlabSize);
JfrAllocationEvents.emit(startTicks, hub, size, tlabSize);
DeoptTester.enableDeoptTesting();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,17 @@ public static int abs(int a) {
public static long abs(long a) {
return (a < 0) ? -a : a;
}

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public static long floor(double a) {
return (long) a;
}

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public static long ceil(double a) {
long floor = floor(a);
return a > floor ? floor + 1 : floor;
}
}

public static class Byte {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,75 @@
import com.oracle.svm.core.Uninterruptible;
import com.oracle.svm.core.thread.JavaThreads;

import java.util.ArrayList;
import java.util.List;

/**
* This file contains the VM-level events that Native Image supports on all JDK versions. The event
* IDs depend on the JDK version (see metadata.xml file) and are computed at image build time.
*/
public final class JfrEvent {
public static final JfrEvent ThreadStart = create("jdk.ThreadStart", false);
public static final JfrEvent ThreadEnd = create("jdk.ThreadEnd", false);
public static final JfrEvent ThreadCPULoad = create("jdk.ThreadCPULoad", false);
public static final JfrEvent DataLoss = create("jdk.DataLoss", false);
public static final JfrEvent ClassLoadingStatistics = create("jdk.ClassLoadingStatistics", false);
public static final JfrEvent InitialEnvironmentVariable = create("jdk.InitialEnvironmentVariable", false);
public static final JfrEvent InitialSystemProperty = create("jdk.InitialSystemProperty", false);
public static final JfrEvent JavaThreadStatistics = create("jdk.JavaThreadStatistics", false);
public static final JfrEvent JVMInformation = create("jdk.JVMInformation", false);
public static final JfrEvent OSInformation = create("jdk.OSInformation", false);
public static final JfrEvent PhysicalMemory = create("jdk.PhysicalMemory", false);
public static final JfrEvent ExecutionSample = create("jdk.ExecutionSample", false);
public static final JfrEvent NativeMethodSample = create("jdk.NativeMethodSample", false);
public static final JfrEvent GarbageCollection = create("jdk.GarbageCollection", true);
public static final JfrEvent GCPhasePause = create("jdk.GCPhasePause", true);
public static final JfrEvent GCPhasePauseLevel1 = create("jdk.GCPhasePauseLevel1", true);
public static final JfrEvent GCPhasePauseLevel2 = create("jdk.GCPhasePauseLevel2", true);
public static final JfrEvent GCPhasePauseLevel3 = create("jdk.GCPhasePauseLevel3", true);
public static final JfrEvent GCPhasePauseLevel4 = create("jdk.GCPhasePauseLevel4", true);
public static final JfrEvent SafepointBegin = create("jdk.SafepointBegin", true);
public static final JfrEvent SafepointEnd = create("jdk.SafepointEnd", true);
public static final JfrEvent ExecuteVMOperation = create("jdk.ExecuteVMOperation", true);
public static final JfrEvent JavaMonitorEnter = create("jdk.JavaMonitorEnter", true);
public static final JfrEvent ThreadPark = create("jdk.ThreadPark", true);
public static final JfrEvent JavaMonitorWait = create("jdk.JavaMonitorWait", true);
public static final JfrEvent JavaMonitorInflate = create("jdk.JavaMonitorInflate", true);
public static final JfrEvent ObjectAllocationInNewTLAB = create("jdk.ObjectAllocationInNewTLAB", false);
public static final JfrEvent GCHeapSummary = create("jdk.GCHeapSummary", false);
public static final JfrEvent ThreadAllocationStatistics = create("jdk.ThreadAllocationStatistics", false);
public static final JfrEvent SystemGC = create("jdk.SystemGC", true);
public static final JfrEvent AllocationRequiringGC = create("jdk.AllocationRequiringGC", false);

private static final List<JfrEvent> events = new ArrayList<>();
public static final JfrEvent ThreadStart = create("jdk.ThreadStart", false, false);
public static final JfrEvent ThreadEnd = create("jdk.ThreadEnd", false, false);
public static final JfrEvent ThreadCPULoad = create("jdk.ThreadCPULoad", false, false);
public static final JfrEvent DataLoss = create("jdk.DataLoss", false, false);
public static final JfrEvent ClassLoadingStatistics = create("jdk.ClassLoadingStatistics", false, false);
public static final JfrEvent InitialEnvironmentVariable = create("jdk.InitialEnvironmentVariable", false, false);
public static final JfrEvent InitialSystemProperty = create("jdk.InitialSystemProperty", false, false);
public static final JfrEvent JavaThreadStatistics = create("jdk.JavaThreadStatistics", false, false);
public static final JfrEvent JVMInformation = create("jdk.JVMInformation", false, false);
public static final JfrEvent OSInformation = create("jdk.OSInformation", false, false);
public static final JfrEvent PhysicalMemory = create("jdk.PhysicalMemory", false, false);
public static final JfrEvent ExecutionSample = create("jdk.ExecutionSample", false, false);
public static final JfrEvent NativeMethodSample = create("jdk.NativeMethodSample", false, false);
public static final JfrEvent GarbageCollection = create("jdk.GarbageCollection", true, false);
public static final JfrEvent GCPhasePause = create("jdk.GCPhasePause", true, false);
public static final JfrEvent GCPhasePauseLevel1 = create("jdk.GCPhasePauseLevel1", true, false);
public static final JfrEvent GCPhasePauseLevel2 = create("jdk.GCPhasePauseLevel2", true, false);
public static final JfrEvent GCPhasePauseLevel3 = create("jdk.GCPhasePauseLevel3", true, false);
public static final JfrEvent GCPhasePauseLevel4 = create("jdk.GCPhasePauseLevel4", true, false);
public static final JfrEvent SafepointBegin = create("jdk.SafepointBegin", true, false);
public static final JfrEvent SafepointEnd = create("jdk.SafepointEnd", true, false);
public static final JfrEvent ExecuteVMOperation = create("jdk.ExecuteVMOperation", true, false);
public static final JfrEvent JavaMonitorEnter = create("jdk.JavaMonitorEnter", true, false);
public static final JfrEvent ThreadPark = create("jdk.ThreadPark", true, false);
public static final JfrEvent JavaMonitorWait = create("jdk.JavaMonitorWait", true, false);
public static final JfrEvent JavaMonitorInflate = create("jdk.JavaMonitorInflate", true, false);
public static final JfrEvent ObjectAllocationInNewTLAB = create("jdk.ObjectAllocationInNewTLAB", false, false);
public static final JfrEvent GCHeapSummary = create("jdk.GCHeapSummary", false, false);
public static final JfrEvent ThreadAllocationStatistics = create("jdk.ThreadAllocationStatistics", false, false);
public static final JfrEvent SystemGC = create("jdk.SystemGC", true, false);
public static final JfrEvent AllocationRequiringGC = create("jdk.AllocationRequiringGC", false, false);
public static final JfrEvent ObjectAllocationSample = create("jdk.ObjectAllocationSample", false, true);
private final long id;
private final String name;
private final boolean hasDuration;
private JfrThrottler throttler;

@Platforms(Platform.HOSTED_ONLY.class)
public static JfrEvent create(String name, boolean hasDuration) {
return new JfrEvent(name, hasDuration);
public static JfrEvent create(String name, boolean hasDuration, boolean hasThrottling) {
return new JfrEvent(name, hasDuration, hasThrottling);
}

@Platforms(Platform.HOSTED_ONLY.class)
private JfrEvent(String name, boolean hasDuration) {
private JfrEvent(String name, boolean hasDuration, boolean hasThrottling) {
this.id = JfrMetadataTypeLibrary.lookupPlatformEvent(name);
this.name = name;
this.hasDuration = hasDuration;
if (hasThrottling) {
throttler = new JfrThrottler();
}
events.add(this);
}

public static List<JfrEvent> getEvents() {
return events;
}

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public JfrThrottler getThrottler() {
return throttler;
}

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
Expand Down Expand Up @@ -113,6 +131,6 @@ public boolean shouldEmit(long durationTicks) {

@Uninterruptible(reason = "Prevent races with VM operations that start/stop recording.", callerMustBe = true)
private boolean shouldEmit0() {
return SubstrateJVM.get().isRecording() && SubstrateJVM.get().isEnabled(this);
return SubstrateJVM.get().shouldCommit(this) && SubstrateJVM.get().isRecording() && SubstrateJVM.get().isEnabled(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public RuntimeSupport.Hook startupHook() {
return isFirstIsolate -> {
parseFlightRecorderLogging(SubstrateOptions.FlightRecorderLogging.getValue());
periodicEventSetup();
SubstrateJVM.getJfrRandom().resetSeed();
if (isJFREnabled()) {
initRecording();
}
Expand Down
Loading