1 /*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 package dalvik.system;
19
20 @SuppressWarnings({"unchecked", "deprecation", "all"})
21 public final class VMDebug {
22
VMDebug()23 VMDebug() { throw new RuntimeException("Stub!"); }
24
suspendAllAndSendVmStart()25 public static native void suspendAllAndSendVmStart();
26
lastDebuggerActivity()27 public static native long lastDebuggerActivity();
28
isDebuggingEnabled()29 public static native boolean isDebuggingEnabled();
30
isDebuggerConnected()31 public static native boolean isDebuggerConnected();
32
getVmFeatureList()33 public static native String[] getVmFeatureList();
34
startMethodTracing(String traceFileName, int bufferSize, int flags, boolean samplingEnabled, int intervalUs)35 public static void startMethodTracing(String traceFileName, int bufferSize, int flags, boolean samplingEnabled, int intervalUs) { throw new RuntimeException("Stub!"); }
36
startMethodTracing(String traceFileName, FileDescriptor fd, int bufferSize, int flags, boolean samplingEnabled, int intervalUs, boolean streamingOutput)37 public static void startMethodTracing(String traceFileName, FileDescriptor fd, int bufferSize, int flags, boolean samplingEnabled, int intervalUs, boolean streamingOutput) { throw new RuntimeException("Stub!"); }
38
startMethodTracingDdms(int bufferSize, int flags, boolean samplingEnabled, int intervalUs)39 public static void startMethodTracingDdms(int bufferSize, int flags, boolean samplingEnabled, int intervalUs) { throw new RuntimeException("Stub!"); }
40
getMethodTracingMode()41 public static native int getMethodTracingMode();
42
stopMethodTracing()43 public static native void stopMethodTracing();
44
threadCpuTimeNanos()45 public static native long threadCpuTimeNanos();
46
startAllocCounting()47 public static native void startAllocCounting();
48
stopAllocCounting()49 public static native void stopAllocCounting();
50
getAllocCount(int kind)51 public static native int getAllocCount(int kind);
52
resetAllocCount(int kinds)53 public static native void resetAllocCount(int kinds);
54
printLoadedClasses(int flags)55 public static native void printLoadedClasses(int flags);
56
getLoadedClassCount()57 public static native int getLoadedClassCount();
58
dumpHprofData(String filename)59 public static void dumpHprofData(String filename) { throw new RuntimeException("Stub!"); }
60
dumpHprofDataDdms()61 public static native void dumpHprofDataDdms();
62
dumpHprofData(String fileName, FileDescriptor fd)63 public static void dumpHprofData(String fileName, FileDescriptor fd) { throw new RuntimeException("Stub!"); }
64
dumpReferenceTables()65 public static native void dumpReferenceTables();
66
countInstancesOfClass(Class klass, boolean assignable)67 public static native long countInstancesOfClass(Class klass, boolean assignable);
68
countInstancesOfClasses(Class[] classes, boolean assignable)69 public static native long[] countInstancesOfClasses(Class[] classes, boolean assignable);
70
getRuntimeStat(String statName)71 public static String getRuntimeStat(String statName) { throw new RuntimeException("Stub!"); }
72
getRuntimeStats()73 public static Map<String,String> getRuntimeStats() { throw new RuntimeException("Stub!"); }
74
attachAgent(String agent, ClassLoader classLoader)75 public static void attachAgent(String agent, ClassLoader classLoader) { throw new RuntimeException("Stub!"); }
76
setAllocTrackerStackDepth(int stackDepth)77 public static native void setAllocTrackerStackDepth(int stackDepth);
78
79 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_APPINFO)
setCurrentProcessName(String processName)80 public static native void setCurrentProcessName(String processName);
81
82 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_APPINFO)
addApplication(String packageName)83 public static native void addApplication(String packageName);
84
85 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_APPINFO)
removeApplication(String packageName)86 public static native void removeApplication(String packageName);
87
88 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_APPINFO)
setUserId(int userId)89 public static native void setUserId(int userId);
90
91 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_APPINFO)
setWaitingForDebugger(boolean waiting)92 public static native void setWaitingForDebugger(boolean waiting);
93
94 public static final int KIND_ALL_COUNTS = -1; // 0xffffffff
95
96 public static final int KIND_GLOBAL_ALLOCATED_BYTES = 2; // 0x2
97
98 public static final int KIND_GLOBAL_ALLOCATED_OBJECTS = 1; // 0x1
99
100 public static final int KIND_GLOBAL_CLASS_INIT_COUNT = 32; // 0x20
101
102 public static final int KIND_GLOBAL_CLASS_INIT_TIME = 64; // 0x40
103
104 public static final int KIND_GLOBAL_FREED_BYTES = 8; // 0x8
105
106 public static final int KIND_GLOBAL_FREED_OBJECTS = 4; // 0x4
107
108 public static final int KIND_GLOBAL_GC_INVOCATIONS = 16; // 0x10
109
110 public static final int KIND_THREAD_ALLOCATED_BYTES = 131072; // 0x20000
111
112 public static final int KIND_THREAD_ALLOCATED_OBJECTS = 65536; // 0x10000
113
114 public static final int KIND_THREAD_GC_INVOCATIONS = 1048576; // 0x100000
115
116 public static final int TRACE_COUNT_ALLOCS = 1; // 0x1
117 }
118
119