Skip to content

Commit 341f3d5

Browse files
Jaroslav Bachorikthegreystone
authored andcommitted
7338: Add parser support for frame types generated by async-profiler
Reviewed-by: hirt
1 parent 2844db9 commit 341f3d5

File tree

2 files changed

+23
-2
lines changed
  • core
    • org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common
    • org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/util

2 files changed

+23
-2
lines changed

core/org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common/IMCFrame.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -62,6 +62,18 @@ public enum Type {
6262
* The frame was executed as code that was inlined by the Java JIT compiler.
6363
*/
6464
INLINED,
65+
/**
66+
* The frame was executed as native code, most probably a C function.
67+
*/
68+
NATIVE,
69+
/**
70+
* The frame was executed as native code compiled from C++.
71+
*/
72+
CPP,
73+
/**
74+
* The frame was executed as kernel native code.
75+
*/
76+
KERNEL,
6577
/**
6678
* The frame compilation type is unknown.
6779
*/

core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/util/ParserToolkit.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -80,6 +80,15 @@ public static IMCFrame.Type parseFrameType(String type) {
8080
if ("Inlined".equals(type)) { //$NON-NLS-1$
8181
return IMCFrame.Type.INLINED;
8282
}
83+
if ("Native".equals(type)) { //$NON-NLS-1$
84+
return IMCFrame.Type.NATIVE;
85+
}
86+
if ("C++".equals(type)) { //$NON-NLS-1$
87+
return IMCFrame.Type.CPP;
88+
}
89+
if ("Kernel".equals(type)) { //$NON-NLS-1$
90+
return IMCFrame.Type.KERNEL;
91+
}
8392
return IMCFrame.Type.UNKNOWN;
8493
}
8594
}

0 commit comments

Comments
 (0)