Skip to content

Commit 1b11e12

Browse files
style
1 parent 533da7a commit 1b11e12

File tree

10 files changed

+78
-4
lines changed

10 files changed

+78
-4
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrChunkWriter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public interface JfrChunkWriter extends JfrUnlockedChunkWriter {
4747
void markChunkFinal();
4848

4949
void closeFile();
50+
5051
void closeFileForEmergencyDump();
5152

5253
void setMetadata(byte[] bytes);

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrEmergencyDumpFeature.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
import org.graalvm.nativeimage.ImageSingletons;
3535

3636
/**
37-
* The JFR emergency dump mechanism uses platform-specific implementations (see {@link JfrEmergencyDumpSupport}).
37+
* The JFR emergency dump mechanism uses platform-specific implementations (see
38+
* {@link JfrEmergencyDumpSupport}).
3839
*/
3940
@AutomaticallyRegisteredFeature
4041
public class JfrEmergencyDumpFeature implements InternalFeature {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrEmergencyDumpSupport.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.graalvm.nativeimage.ImageSingletons;
3131

3232
import jdk.graal.compiler.api.replacements.Fold;
33+
3334
public interface JfrEmergencyDumpSupport {
3435
@Fold
3536
static boolean isPresent() {
@@ -42,10 +43,16 @@ static JfrEmergencyDumpSupport singleton() {
4243
}
4344

4445
void initialize();
46+
4547
void setRepositoryLocation(String dirText);
48+
4649
void setDumpPath(String dumpPathText);
50+
4751
String getDumpPath();
52+
4853
RawFileOperationSupport.RawFileDescriptor chunkPath();
54+
4955
void onVmError();
56+
5057
void teardown();
5158
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static HotSpotDiagnosticMXBean getDiagnosticBean() {
154154

155155
@Override
156156
public List<Class<? extends Feature>> getRequiredFeatures() {
157-
return Arrays.asList(ThreadListenerSupportFeature.class, JfrEmergencyDumpFeature.class);
157+
return Arrays.asList(ThreadListenerSupportFeature.class, JfrEmergencyDumpFeature.class);
158158
}
159159

160160
@Override

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrGCWhenSerializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
public class JfrGCWhenSerializer implements JfrSerializer {
3131
private JfrGCWhen[] values;
32+
3233
@Platforms(Platform.HOSTED_ONLY.class)
3334
public JfrGCWhenSerializer() {
3435
values = JfrGCWhen.values();

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrNmtCategorySerializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
public class JfrNmtCategorySerializer implements JfrSerializer {
3535
private NmtCategory[] nmtCategories;
36+
3637
@Platforms(Platform.HOSTED_ONLY.class)
3738
public JfrNmtCategorySerializer() {
3839
nmtCategories = NmtCategory.values();

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrSymbolRepository.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public long getSymbolId(String imageHeapString, boolean previousEpoch, boolean r
9595
return getSymbolId(buffer, WordFactory.unsigned(length), hash, previousEpoch);
9696
}
9797

98-
9998
@Uninterruptible(reason = "Locking without transition and result is only valid until epoch changes.", callerMustBe = true)
10099
public long getSymbolId(PointerBase buffer, UnsignedWord length, int hash, boolean previousEpoch) {
101100
com.oracle.svm.core.util.VMError.guarantee(buffer.isNonNull());
@@ -181,10 +180,13 @@ private interface JfrSymbol extends UninterruptibleEntry {
181180

182181
@RawField
183182
void setLength(UnsignedWord value);
183+
184184
@RawField
185185
UnsignedWord getLength();
186+
186187
@RawField
187188
void setModifiedUTF8(PointerBase value);
189+
188190
@RawField
189191
PointerBase getModifiedUTF8();
190192
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2025, 2025, Red Hat Inc. All rights reserved.
4+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
*
6+
* This code is free software; you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License version 2 only, as
8+
* published by the Free Software Foundation. Oracle designates this
9+
* particular file as subject to the "Classpath" exception as provided
10+
* by Oracle in the LICENSE file that accompanied this code.
11+
*
12+
* This code is distributed in the hope that it will be useful, but WITHOUT
13+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
* version 2 for more details (a copy is included in the LICENSE file that
16+
* accompanied this code).
17+
*
18+
* You should have received a copy of the GNU General Public License version
19+
* 2 along with this work; if not, write to the Free Software Foundation,
20+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21+
*
22+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23+
* or visit www.oracle.com if you need additional information or have any
24+
* questions.
25+
*/
26+
27+
package com.oracle.svm.core.src.com.oracle.svm.core.jfr.events;
28+
29+
import com.oracle.svm.core.Uninterruptible;
30+
import com.oracle.svm.core.jfr.HasJfrSupport;
31+
import com.oracle.svm.core.jfr.JfrEvent;
32+
import com.oracle.svm.core.jfr.JfrNativeEventWriter;
33+
import com.oracle.svm.core.jfr.JfrNativeEventWriterData;
34+
import com.oracle.svm.core.jfr.JfrNativeEventWriterDataAccess;
35+
import com.oracle.svm.core.jfr.JfrTicks;
36+
import org.graalvm.nativeimage.StackValue;
37+
38+
public class ShutdownEvent {
39+
public static void emit(String reason, int recordingId) {
40+
if (HasJfrSupport.get()) {
41+
emit0(reason, recordingId);
42+
}
43+
}
44+
45+
@Uninterruptible(reason = "Accesses a JFR buffer.")
46+
private static void emit0(String reason, int recordingId) {
47+
if (JfrEvent.DumpReason.shouldEmit()) {
48+
JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
49+
JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
50+
51+
JfrNativeEventWriter.beginSmallEvent(data, JfrEvent.DumpReason);
52+
JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks());
53+
JfrNativeEventWriter.putString(data, reason);
54+
JfrNativeEventWriter.putInt(data, recordingId);
55+
JfrNativeEventWriter.endSmallEvent(data);
56+
}
57+
}
58+
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/util/PlatformTimeUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ public long nanosNow() {
7474
public interface SecondsNanos extends PointerBase {
7575
@RawField
7676
void setNanos(long value);
77+
7778
@RawField
7879
long getNanos();
80+
7981
@RawField
8082
void setSeconds(long value);
83+
8184
@RawField
8285
long getSeconds();
8386
}

substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/utils/poolparsers/ConstantPoolParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void compareFoundAndExpectedIds() {
7171
missingIds.removeAll(foundIds);
7272

7373
if (!missingIds.isEmpty()) {
74-
Assert.fail("Error during parsing " + this.getClass().getName() + " constant pool! Missing IDs: " + missingIds + ". Expected IDs: " + expectedIds + ". Found IDs: " + foundIds);
74+
Assert.fail("Error during parsing " + this.getClass().getName() + " constant pool! Missing IDs: " + missingIds + ". Expected IDs: " + expectedIds + ". Found IDs: " + foundIds);
7575
}
7676
}
7777

0 commit comments

Comments
 (0)