diff options
| author | 2017-05-30 18:04:36 +0100 | |
|---|---|---|
| committer | 2017-11-01 13:24:47 +0000 | |
| commit | 19541e84b1f3c86f7460a527b5d25907ad8bfbb1 (patch) | |
| tree | 5c5160ed470f7a2d9e5f9d40c54c5025f44d3cc2 | |
| parent | 80c3c7093040a6c66a2fa7c634451694d2bb5ee8 (diff) | |
Debug: Remove obsolete InstructionCount code.
Support for instruction counting has been removed from ART
and the VMDebug APIs in question throw UnsupportedOperationException
unconditionally.
Test: make
Change-Id: Ibcaa160f755a5708bc6fbef3a783acfc26f0ba90
| -rw-r--r-- | core/java/android/os/Debug.java | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index 75fea5253674..2efde23275ab 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -23,7 +23,6 @@ import android.util.Log; import com.android.internal.util.FastPrintWriter; import com.android.internal.util.TypedProperties; -import dalvik.bytecode.OpcodeInfo; import dalvik.system.VMDebug; import org.apache.harmony.dalvik.ddmc.Chunk; @@ -48,8 +47,6 @@ import java.util.HashMap; import java.util.Map; - - /** * Provides various debugging methods for Android applications, including * tracing and allocation counts. @@ -1948,13 +1945,7 @@ public final class Debug */ @Deprecated public static class InstructionCount { - private static final int NUM_INSTR = - OpcodeInfo.MAXIMUM_PACKED_VALUE + 1; - - private int[] mCounts; - public InstructionCount() { - mCounts = new int[NUM_INSTR]; } /** @@ -1964,13 +1955,7 @@ public final class Debug * @return true if counting was started */ public boolean resetAndStart() { - try { - VMDebug.startInstructionCounting(); - VMDebug.resetInstructionCount(); - } catch (UnsupportedOperationException uoe) { - return false; - } - return true; + return false; } /** @@ -1978,13 +1963,7 @@ public final class Debug * counting process. */ public boolean collect() { - try { - VMDebug.stopInstructionCounting(); - VMDebug.getInstructionCount(mCounts); - } catch (UnsupportedOperationException uoe) { - return false; - } - return true; + return false; } /** @@ -1992,13 +1971,7 @@ public final class Debug * all threads). */ public int globalTotal() { - int count = 0; - - for (int i = 0; i < NUM_INSTR; i++) { - count += mCounts[i]; - } - - return count; + return 0; } /** @@ -2006,15 +1979,7 @@ public final class Debug * executed globally. */ public int globalMethodInvocations() { - int count = 0; - - for (int i = 0; i < NUM_INSTR; i++) { - if (OpcodeInfo.isInvoke(i)) { - count += mCounts[i]; - } - } - - return count; + return 0; } } |