diff options
author | 2015-11-04 10:57:23 +0000 | |
---|---|---|
committer | 2015-11-04 10:57:23 +0000 | |
commit | 41f10bcea6b1e7ebc8c18f8fc880c0ad8711e407 (patch) | |
tree | 5d47abcb783a025ea390723ac195fc5088136ed4 | |
parent | 12cbc872477dd278a27599d8714381657211b184 (diff) |
Fix test in case we run the ART_TEST_TRACE tests.
Change-Id: Ic998a29f2d5c573f34def798eb4f2fe5cf30e8a5
-rw-r--r-- | test/545-tracing-and-jit/src/Main.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/545-tracing-and-jit/src/Main.java b/test/545-tracing-and-jit/src/Main.java index d3c79aeb5e..a2d51d5a8c 100644 --- a/test/545-tracing-and-jit/src/Main.java +++ b/test/545-tracing-and-jit/src/Main.java @@ -84,6 +84,10 @@ public class Main { } } else { if (invocationCount == 0) { + // When running the trace in trace mode, there is already a trace running. + if (VMDebug.getMethodTracingMode() != 0) { + VMDebug.stopMethodTracing(); + } VMDebug.startMethodTracing(file.getPath(), 0, 0, false, 0); } fillJit(); @@ -219,12 +223,14 @@ public class Main { private static class VMDebug { private static final Method startMethodTracingMethod; private static final Method stopMethodTracingMethod; + private static final Method getMethodTracingModeMethod; static { try { Class c = Class.forName("dalvik.system.VMDebug"); startMethodTracingMethod = c.getDeclaredMethod("startMethodTracing", String.class, Integer.TYPE, Integer.TYPE, Boolean.TYPE, Integer.TYPE); stopMethodTracingMethod = c.getDeclaredMethod("stopMethodTracing"); + getMethodTracingModeMethod = c.getDeclaredMethod("getMethodTracingMode"); } catch (Exception e) { throw new RuntimeException(e); } @@ -238,5 +244,8 @@ public class Main { public static void stopMethodTracing() throws Exception { stopMethodTracingMethod.invoke(null); } + public static int getMethodTracingMode() throws Exception { + return (int) getMethodTracingModeMethod.invoke(null); + } } } |