(Slides)
(Resources)
| import java.lang.instrument.Instrumentation; | |
| import java.lang.instrument.ClassFileTransformer; | |
| import java.security.ProtectionDomain; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| public class HCRRepro { | |
| public static volatile boolean running = true; | |
| static volatile long counter = 0; | |
| static Instrumentation inst; | |
| static volatile int retransCount = 0; |
| /* | |
| * Standalone driver for the OpenJ9 AsyncGetCallTrace self-deadlock repro. | |
| * No Datadog code -- generic JNI/JVMTI only. | |
| * | |
| * Workload: many threads continuously allocate a fresh monitor object, | |
| * synchronize on it and wait() with a short timeout (forcing an | |
| * inflate-then-deflate cycle every iteration), while a dedicated thread | |
| * forces frequent GC. Combined with the native agent's 1ms-period | |
| * AsyncGetCallTrace sampling (see agent.c), this reliably lands a sample | |
| * signal on a thread that is inside OpenJ9's JIT-artifact-monitor critical |
(Slides)
(Resources)
(Resources)
| #include <jvmti.h> | |
| #include <jni.h> | |
| #include <string.h> | |
| static jvmtiEnv *jvmti = NULL; | |
| static jclass outOfMemoryErrorClass = NULL; | |
| void check_exact_exception_type(JNIEnv *jni_env, jobject exception) { | |
| jclass exceptionClass = (*jni_env)->GetObjectClass(jni_env, exception); | |
| if ((*jni_env)->IsSameObject(jni_env, exceptionClass, outOfMemoryErrorClass)) { |
| #! /bin/bash | |
| # see http://hirt.se/images/openjdk/ilw.png | |
| if [ $# -ne 1 ]; then | |
| echo "Provide ILW score" | |
| exit 1 | |
| fi | |
| priority="P5" |
| import org.openjdk.btrace.core.BTraceUtils; | |
| import org.openjdk.btrace.core.annotations.*; | |
| import org.openjdk.btrace.core.jfr.JfrEvent; | |
| import static org.openjdk.btrace.core.BTraceUtils.*; | |
| import static org.openjdk.btrace.core.BTraceUtils.Jfr.*; | |
| @BTrace | |
| public class TracePreparedQuery { | |
| @Event( | |
| name = "jdbc.PreparedQuery", |
| gunther:0.0.0-JFR jbachorik$ ./bin/btrace -lp anagrams.jar | |
| btrace INFO: Attaching BTrace to PID: 32199 | |
| 1: 6c83f579-2624-4acb-9cbf-1f59b3aa2076 [org.openjdk.btrace.runtime.aux.AllMethods1] |
| import org.openjdk.btrace.core.BTraceUtils; | |
| import org.openjdk.btrace.core.annotations.*; | |
| import org.openjdk.btrace.core.jfr.JfrEvent; | |
| import static org.openjdk.btrace.core.BTraceUtils.*; | |
| import static org.openjdk.btrace.core.BTraceUtils.Jfr.*; | |
| @BTrace public class JfrEventsProbe { | |
| @Event( | |
| name = "CustomEvent", | |
| label = "Custom Event", |