Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion src/jdk.jfr/share/classes/jdk/jfr/events/FileReadEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
@Label("File Read")
@Category("Java Application")
@Description("Reading data from a file")
@StackFilter({"java.io.FileInputStream", "java.io.RandomAccessFile", "sun.nio.ch.FileChannelImpl"})
@StackFilter({"java.nio.channels.FileChannel",
"java.io.DataInputStream",
"java.io.FileInputStream",
"java.io.InputStream",
"java.io.RandomAccessFile",
"sun.nio.ch.ChannelInputStream",
"sun.nio.ch.FileChannelImpl"})
@Throttle
public final class FileReadEvent extends MirrorEvent {

Expand Down
8 changes: 7 additions & 1 deletion src/jdk.jfr/share/classes/jdk/jfr/events/FileWriteEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
@Label("File Write")
@Category("Java Application")
@Description("Writing data to a file")
@StackFilter({"java.io.FileOutputStream", "java.io.RandomAccessFile", "sun.nio.ch.FileChannelImpl"})
@StackFilter({"java.nio.channels.FileChannel",
"java.io.DataOutputStream",
"java.io.FileOutputStream",
"java.io.OutputStream",
"java.io.RandomAccessFile",
"sun.nio.ch.ChannelOutputStream",
"sun.nio.ch.FileChannelImpl"})
@Throttle
public final class FileWriteEvent extends MirrorEvent {

Expand Down
4 changes: 4 additions & 0 deletions src/jdk.jfr/share/classes/jdk/jfr/events/SocketReadEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
@Label("Socket Read")
@Category("Java Application")
@Description("Reading data from a socket")
@StackFilter({"java.io.InputStream",
"java.net.Socket$SocketInputStream",
"java.nio.channels.SocketChannel",
"sun.nio.ch.SocketInputStream"})
@Throttle
public final class SocketReadEvent extends MirrorEvent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
@Label("Socket Write")
@Category("Java Application")
@Description("Writing data to a socket")
@StackFilter({"java.io.OutputStream",
"java.net.Socket$SocketOutputStream",
"java.nio.channels.SocketChannel",
"sun.nio.ch.SocketOutputStream"})
@Throttle
public final class SocketWriteEvent extends MirrorEvent {

Expand Down
23 changes: 8 additions & 15 deletions src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ private boolean isExceptionEvent() {
return false;
}

private boolean isStaticCommit() {
switch (getName()) {
case Type.EVENT_NAME_PREFIX + "SocketRead" :
case Type.EVENT_NAME_PREFIX + "SocketWrite" :
case Type.EVENT_NAME_PREFIX + "FileRead" :
case Type.EVENT_NAME_PREFIX + "FileWrite" :
case Type.EVENT_NAME_PREFIX + "FileForce" :
return true;
}
return false;
}

private int determineStackTraceOffset() {
if (isJDK) {
// Order matters
Expand All @@ -116,9 +104,14 @@ private int determineStackTraceOffset() {
if (getModification() == Modification.TRACING) {
return 5;
}
if (isStaticCommit()) {
return 3;
}
return switch (getName()) {
case Type.EVENT_NAME_PREFIX + "SocketRead",
Type.EVENT_NAME_PREFIX + "SocketWrite",
Type.EVENT_NAME_PREFIX + "FileRead",
Type.EVENT_NAME_PREFIX + "FileWrite" -> 6;
case Type.EVENT_NAME_PREFIX + "FileForce" -> 5;
default -> 3;
};
}
return 3;
}
Expand Down
Loading