Skip to content
Permalink
Browse files

8249713: JFR: java.base events have incomplete stacktraces

Reviewed-by: egahlin
  • Loading branch information
Markus Grönlund
Markus Grönlund committed Jul 21, 2020
1 parent 8d97637 commit c7b074a9dbf4e8f7156498d984add1e30fea2a7c
Showing with 25 additions and 4 deletions.
  1. +25 −4 src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java
@@ -75,13 +75,34 @@
this.stackTraceOffset = stackTraceOffset(name, isJDK);
}

private static boolean isExceptionEvent(String name) {
switch (name) {
case Type.EVENT_NAME_PREFIX + "JavaErrorThrow" :
case Type.EVENT_NAME_PREFIX + "JavaExceptionThrow" :
return true;
}
return false;
}

private static boolean isUsingHandler(String name) {
switch (name) {
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 static int stackTraceOffset(String name, boolean isJDK) {
if (isJDK) {
if (name.equals(Type.EVENT_NAME_PREFIX + "JavaExceptionThrow")) {
return 5;
if (isExceptionEvent(name)) {
return 4;
}
if (name.equals(Type.EVENT_NAME_PREFIX + "JavaErrorThrow")) {
return 5;
if (isUsingHandler(name)) {
return 3;
}
}
return 4;

0 comments on commit c7b074a

Please sign in to comment.