< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java

Print this page
rev 52509 : [mq]: graal2

@@ -112,10 +112,17 @@
             return args.subList(0, index);
         }
     }
 
     /**
+     * Detects whether a java agent is attached.
+     */
+    public static boolean isJavaAgentAttached() {
+        return SubprocessUtil.getVMCommandLine().stream().anyMatch(args -> args.startsWith("-javaagent"));
+    }
+
+    /**
      * The details of a subprocess execution.
      */
     public static class Subprocess {
 
         /**
< prev index next >