Last active
February 20, 2023 11:57
-
-
Save parttimenerd/502251b67d3e42baad17419442a72c39 to your computer and use it in GitHub Desktop.
Tiny self-contained reproducer for https://bugs.openjdk.org/browse/JDK-8302320 (AsyncGetCallTrace obtains too few frames in sanity test)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class Main { | |
public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { | |
Class<?> klass = Main.class; | |
Method mainMethod = klass.getMethod("test"); | |
mainMethod.invoke(null); | |
} | |
public static void test() { | |
javaLoop(); | |
} | |
public static void javaLoop() { | |
long start = System.currentTimeMillis(); | |
while (start + 3000 > System.currentTimeMillis()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
javac Main.java | |
java -cp . -XX:StartFlightRecording=filename=profile.jfr Main | |
jfr print --events "jdk.ExecutionSample" --json profile.jfr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment