Skip to content

Commit 2d5829a

Browse files
committed
8239508: JFR: @RemoveFields
Reviewed-by: mgronlun
1 parent 0064cf9 commit 2d5829a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+491
-219
lines changed

src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
import jdk.jfr.EventType;
3333
import jdk.jfr.ValueDescriptor;
34-
import jdk.jfr.internal.util.Utils;
3534
import jdk.jfr.internal.consumer.ObjectContext;
35+
import jdk.jfr.internal.util.ImplicitFields;
3636

3737
/**
3838
* A recorded event.
@@ -57,7 +57,7 @@ public final class RecordedEvent extends RecordedObject {
5757
* @return stack trace, or {@code null} if doesn't exist for the event
5858
*/
5959
public RecordedStackTrace getStackTrace() {
60-
return getTyped(Utils.FIELD_STACK_TRACE, RecordedStackTrace.class, null);
60+
return getTyped(ImplicitFields.STACK_TRACE, RecordedStackTrace.class, null);
6161
}
6262

6363
/**
@@ -67,7 +67,7 @@ public RecordedStackTrace getStackTrace() {
6767
* @return thread, or {@code null} if doesn't exist for the event
6868
*/
6969
public RecordedThread getThread() {
70-
return getTyped(Utils.FIELD_EVENT_THREAD, RecordedThread.class, null);
70+
return getTyped(ImplicitFields.EVENT_THREAD, RecordedThread.class, null);
7171
}
7272

7373
/**

src/jdk.jfr/share/classes/jdk/jfr/events/AbstractBufferStatisticsEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
3030
import jdk.jfr.*;
3131

3232
@Category({ "Java Application", "Statistics" })
33-
public abstract class AbstractBufferStatisticsEvent extends AbstractJDKEvent {
33+
public abstract class AbstractBufferStatisticsEvent extends AbstractPeriodicEvent {
3434

3535
protected AbstractBufferStatisticsEvent(BufferPool bufferPool) {
3636
count = bufferPool.getCount();
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
package jdk.jfr.events;
26+
27+
import jdk.jfr.internal.RemoveFields;
28+
29+
@RemoveFields({"duration", "eventThread", "stackTrace"})
30+
abstract class AbstractPeriodicEvent extends AbstractJDKEvent {
31+
}

src/jdk.jfr/share/classes/jdk/jfr/events/ActiveRecordingEvent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
import jdk.jfr.StackTrace;
3333
import jdk.jfr.Timespan;
3434
import jdk.jfr.Timestamp;
35+
import jdk.jfr.internal.RemoveFields;
3536
import jdk.jfr.internal.Type;
3637

3738
@Name(Type.EVENT_NAME_PREFIX + "ActiveRecording")
3839
@Label("Flight Recording")
3940
@Category("Flight Recorder")
4041
@StackTrace(false)
42+
@RemoveFields({"duration", "eventThread", "stackTrace"})
4143
public final class ActiveRecordingEvent extends AbstractJDKEvent {
4244

4345
// The order of these fields must be the same as the parameters in
@@ -79,7 +81,7 @@ public static boolean enabled() {
7981
return false; // Generated
8082
}
8183

82-
public static void commit(long timestamp, long duration, long id, String name,
84+
public static void commit(long timestamp, long id, String name,
8385
String destination, boolean disk, long maxAge, long flushInterval,
8486
long maxSize, long recordingStart, long recordingDuration) {
8587
// Generated

src/jdk.jfr/share/classes/jdk/jfr/events/ActiveSettingEvent.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,12 +29,14 @@
2929
import jdk.jfr.Label;
3030
import jdk.jfr.Name;
3131
import jdk.jfr.StackTrace;
32+
import jdk.jfr.internal.RemoveFields;
3233
import jdk.jfr.internal.Type;
3334

3435
@Name(Type.EVENT_NAME_PREFIX + "ActiveSetting")
3536
@Label("Recording Setting")
3637
@Category("Flight Recorder")
3738
@StackTrace(false)
39+
@RemoveFields({"duration", "eventThread", "stackTrace"})
3840
public final class ActiveSettingEvent extends AbstractJDKEvent {
3941

4042
// The order of these fields must be the same as the parameters in
@@ -49,7 +51,7 @@ public final class ActiveSettingEvent extends AbstractJDKEvent {
4951
@Label("Setting Value")
5052
public String value;
5153

52-
public static void commit(long startTime, long duration, long id, String name, String value) {
54+
public static void commit(long startTime, long id, String name, String value) {
5355
// Generated
5456
}
5557

src/jdk.jfr/share/classes/jdk/jfr/events/ContainerCPUThrottlingEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021, DataDog. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -36,7 +36,7 @@
3636
@Label("CPU Throttling")
3737
@Category({"Operating System", "Processor"})
3838
@Description("Container CPU throttling related information")
39-
public class ContainerCPUThrottlingEvent extends AbstractJDKEvent {
39+
public class ContainerCPUThrottlingEvent extends AbstractPeriodicEvent {
4040
@Label("CPU Elapsed Slices")
4141
@Description("Number of time-slice periods that have elapsed if a CPU quota has been setup for the container")
4242
public long cpuElapsedSlices;

src/jdk.jfr/share/classes/jdk/jfr/events/ContainerCPUUsageEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021, DataDog. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -36,7 +36,7 @@
3636
@Label("CPU Usage")
3737
@Category({"Operating System", "Processor"})
3838
@Description("Container CPU usage related information")
39-
public class ContainerCPUUsageEvent extends AbstractJDKEvent {
39+
public class ContainerCPUUsageEvent extends AbstractPeriodicEvent {
4040
@Label("CPU Time")
4141
@Description("Aggregate time consumed by all tasks in the container")
4242
@Timespan

src/jdk.jfr/share/classes/jdk/jfr/events/ContainerConfigurationEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021, DataDog. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -37,7 +37,7 @@
3737
@Label("Container Configuration")
3838
@Category({"Operating System"})
3939
@Description("A set of container specific attributes")
40-
public final class ContainerConfigurationEvent extends AbstractJDKEvent {
40+
public final class ContainerConfigurationEvent extends AbstractPeriodicEvent {
4141
@Label("Container Type")
4242
@Description("Container type information")
4343
public String containerType;

src/jdk.jfr/share/classes/jdk/jfr/events/ContainerIOUsageEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021, DataDog. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -37,7 +37,7 @@
3737
@Label("Container IO Usage")
3838
@Category({"Operating System", "File System"})
3939
@Description("Container IO usage related information")
40-
public class ContainerIOUsageEvent extends AbstractJDKEvent {
40+
public class ContainerIOUsageEvent extends AbstractPeriodicEvent {
4141

4242
@Label("Block IO Request Count")
4343
@Description("Number of block IO requests to the disk that have been issued by the container")

src/jdk.jfr/share/classes/jdk/jfr/events/ContainerMemoryUsageEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021, DataDog. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -36,7 +36,7 @@
3636
@Label("Container Memory Usage")
3737
@Category({"Operating System", "Memory"})
3838
@Description("Container memory usage related information")
39-
public final class ContainerMemoryUsageEvent extends AbstractJDKEvent {
39+
public final class ContainerMemoryUsageEvent extends AbstractPeriodicEvent {
4040
@Label("Memory Fail Count")
4141
@Description("Number of times that user memory requests in the container have exceeded the memory limit")
4242
public long memoryFailCount;

0 commit comments

Comments
 (0)