Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 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 | |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 17 | #include <string.h> |
| 18 | #include <unistd.h> |
| 19 | |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 20 | #include "class_linker.h" |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 21 | #include "common_throws.h" |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 22 | #include "debugger.h" |
| 23 | #include "hprof/hprof.h" |
| 24 | #include "jni_internal.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 25 | #include "mirror/class.h" |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 26 | #include "ScopedUtfChars.h" |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 27 | #include "scoped_thread_state_change.h" |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 28 | #include "toStringArray.h" |
| 29 | #include "trace.h" |
| 30 | |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 31 | namespace art { |
| 32 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 33 | static jobjectArray VMDebug_getVmFeatureList(JNIEnv* env, jclass) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 34 | std::vector<std::string> features; |
jeffhao | e343b76 | 2011-12-05 16:36:44 -0800 | [diff] [blame] | 35 | features.push_back("method-trace-profiling"); |
| 36 | features.push_back("method-trace-profiling-streaming"); |
Elliott Hughes | 767a147 | 2011-10-26 18:49:02 -0700 | [diff] [blame] | 37 | features.push_back("hprof-heap-dump"); |
| 38 | features.push_back("hprof-heap-dump-streaming"); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 39 | return toStringArray(env, features); |
| 40 | } |
| 41 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 42 | static void VMDebug_startAllocCounting(JNIEnv*, jclass) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 43 | Runtime::Current()->SetStatsEnabled(true); |
| 44 | } |
| 45 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 46 | static void VMDebug_stopAllocCounting(JNIEnv*, jclass) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 47 | Runtime::Current()->SetStatsEnabled(false); |
| 48 | } |
| 49 | |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 50 | static jint VMDebug_getAllocCount(JNIEnv*, jclass, jint kind) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 51 | return Runtime::Current()->GetStat(kind); |
| 52 | } |
| 53 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 54 | static void VMDebug_resetAllocCount(JNIEnv*, jclass, jint kinds) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 55 | Runtime::Current()->ResetStats(kinds); |
| 56 | } |
| 57 | |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 58 | static void VMDebug_startMethodTracingDdmsImpl(JNIEnv*, jclass, jint bufferSize, jint flags) { |
jeffhao | e343b76 | 2011-12-05 16:36:44 -0800 | [diff] [blame] | 59 | Trace::Start("[DDMS]", -1, bufferSize, flags, true); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 62 | static void VMDebug_startMethodTracingFd(JNIEnv* env, jclass, jstring javaTraceFilename, |
| 63 | jobject javaFd, jint bufferSize, jint flags) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 64 | int originalFd = jniGetFDFromFileDescriptor(env, javaFd); |
| 65 | if (originalFd < 0) { |
| 66 | return; |
| 67 | } |
| 68 | |
| 69 | int fd = dup(originalFd); |
| 70 | if (fd < 0) { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 71 | ScopedObjectAccess soa(env); |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 72 | ThrowLocation throw_location = soa.Self()->GetCurrentLocationForThrow(); |
| 73 | soa.Self()->ThrowNewExceptionF(throw_location, "Ljava/lang/RuntimeException;", |
| 74 | "dup(%d) failed: %s", originalFd, strerror(errno)); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 75 | return; |
| 76 | } |
| 77 | |
| 78 | ScopedUtfChars traceFilename(env, javaTraceFilename); |
| 79 | if (traceFilename.c_str() == NULL) { |
| 80 | return; |
| 81 | } |
jeffhao | e343b76 | 2011-12-05 16:36:44 -0800 | [diff] [blame] | 82 | Trace::Start(traceFilename.c_str(), fd, bufferSize, flags, false); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 85 | static void VMDebug_startMethodTracingFilename(JNIEnv* env, jclass, jstring javaTraceFilename, |
| 86 | jint bufferSize, jint flags) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 87 | ScopedUtfChars traceFilename(env, javaTraceFilename); |
| 88 | if (traceFilename.c_str() == NULL) { |
| 89 | return; |
| 90 | } |
jeffhao | e343b76 | 2011-12-05 16:36:44 -0800 | [diff] [blame] | 91 | Trace::Start(traceFilename.c_str(), -1, bufferSize, flags, false); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 92 | } |
| 93 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 94 | static jboolean VMDebug_isMethodTracingActive(JNIEnv*, jclass) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 95 | return Trace::IsMethodTracingActive(); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 96 | } |
| 97 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 98 | static void VMDebug_stopMethodTracing(JNIEnv*, jclass) { |
jeffhao | e343b76 | 2011-12-05 16:36:44 -0800 | [diff] [blame] | 99 | Trace::Stop(); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 100 | } |
| 101 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 102 | static void VMDebug_startEmulatorTracing(JNIEnv*, jclass) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 103 | UNIMPLEMENTED(WARNING); |
| 104 | //dvmEmulatorTraceStart(); |
| 105 | } |
| 106 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 107 | static void VMDebug_stopEmulatorTracing(JNIEnv*, jclass) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 108 | UNIMPLEMENTED(WARNING); |
| 109 | //dvmEmulatorTraceStop(); |
| 110 | } |
| 111 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 112 | static jboolean VMDebug_isDebuggerConnected(JNIEnv*, jclass) { |
Elliott Hughes | c0f0933 | 2012-03-26 13:27:06 -0700 | [diff] [blame] | 113 | return Dbg::IsDebuggerActive(); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 114 | } |
| 115 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 116 | static jboolean VMDebug_isDebuggingEnabled(JNIEnv*, jclass) { |
Elliott Hughes | c0f0933 | 2012-03-26 13:27:06 -0700 | [diff] [blame] | 117 | return Dbg::IsJdwpConfigured(); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 118 | } |
| 119 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 120 | static jlong VMDebug_lastDebuggerActivity(JNIEnv*, jclass) { |
Elliott Hughes | 872d4ec | 2011-10-21 17:07:15 -0700 | [diff] [blame] | 121 | return Dbg::LastDebuggerActivity(); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 122 | } |
| 123 | |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 124 | static void ThrowUnsupportedOperationException(JNIEnv* env) { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 125 | ScopedObjectAccess soa(env); |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 126 | ThrowLocation throw_location = soa.Self()->GetCurrentLocationForThrow(); |
| 127 | soa.Self()->ThrowNewException(throw_location, "Ljava/lang/UnsupportedOperationException;", NULL); |
| 128 | } |
| 129 | |
| 130 | static void VMDebug_startInstructionCounting(JNIEnv* env, jclass) { |
| 131 | ThrowUnsupportedOperationException(env); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 134 | static void VMDebug_stopInstructionCounting(JNIEnv* env, jclass) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 135 | ThrowUnsupportedOperationException(env); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 136 | } |
| 137 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 138 | static void VMDebug_getInstructionCount(JNIEnv* env, jclass, jintArray /*javaCounts*/) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 139 | ThrowUnsupportedOperationException(env); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 140 | } |
| 141 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 142 | static void VMDebug_resetInstructionCount(JNIEnv* env, jclass) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 143 | ThrowUnsupportedOperationException(env); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 144 | } |
| 145 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 146 | static void VMDebug_printLoadedClasses(JNIEnv* env, jclass, jint flags) { |
| 147 | ScopedObjectAccess soa(env); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 148 | return Runtime::Current()->GetClassLinker()->DumpAllClasses(flags); |
| 149 | } |
| 150 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 151 | static jint VMDebug_getLoadedClassCount(JNIEnv*, jclass) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 152 | return Runtime::Current()->GetClassLinker()->NumLoadedClasses(); |
| 153 | } |
| 154 | |
| 155 | /* |
| 156 | * Returns the thread-specific CPU-time clock value for the current thread, |
| 157 | * or -1 if the feature isn't supported. |
| 158 | */ |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 159 | static jlong VMDebug_threadCpuTimeNanos(JNIEnv*, jclass) { |
| 160 | return ThreadCpuNanoTime(); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | /* |
| 164 | * static void dumpHprofData(String fileName, FileDescriptor fd) |
| 165 | * |
| 166 | * Cause "hprof" data to be dumped. We can throw an IOException if an |
| 167 | * error occurs during file handling. |
| 168 | */ |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 169 | static void VMDebug_dumpHprofData(JNIEnv* env, jclass, jstring javaFilename, jobject javaFd) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 170 | // Only one of these may be NULL. |
| 171 | if (javaFilename == NULL && javaFd == NULL) { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 172 | ScopedObjectAccess soa(env); |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 173 | ThrowNullPointerException(NULL, "fileName == null && fd == null"); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 174 | return; |
| 175 | } |
| 176 | |
| 177 | std::string filename; |
| 178 | if (javaFilename != NULL) { |
| 179 | ScopedUtfChars chars(env, javaFilename); |
| 180 | if (env->ExceptionCheck()) { |
| 181 | return; |
| 182 | } |
| 183 | filename = chars.c_str(); |
| 184 | } else { |
| 185 | filename = "[fd]"; |
| 186 | } |
| 187 | |
| 188 | int fd = -1; |
| 189 | if (javaFd != NULL) { |
| 190 | fd = jniGetFDFromFileDescriptor(env, javaFd); |
| 191 | if (fd < 0) { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 192 | ScopedObjectAccess soa(env); |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame^] | 193 | ThrowRuntimeException("Invalid file descriptor"); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 194 | return; |
| 195 | } |
| 196 | } |
| 197 | |
Elliott Hughes | 622a698 | 2012-06-08 17:58:54 -0700 | [diff] [blame] | 198 | hprof::DumpHeap(filename.c_str(), fd, false); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 199 | } |
| 200 | |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 201 | static void VMDebug_dumpHprofDataDdms(JNIEnv*, jclass) { |
Elliott Hughes | 622a698 | 2012-06-08 17:58:54 -0700 | [diff] [blame] | 202 | hprof::DumpHeap("[DDMS]", -1, true); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 203 | } |
| 204 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 205 | static void VMDebug_dumpReferenceTables(JNIEnv* env, jclass) { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 206 | ScopedObjectAccess soa(env); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 207 | LOG(INFO) << "--- reference table dump ---"; |
| 208 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 209 | soa.Env()->DumpReferenceTables(LOG(INFO)); |
| 210 | soa.Vm()->DumpReferenceTables(LOG(INFO)); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 211 | |
| 212 | LOG(INFO) << "---"; |
| 213 | } |
| 214 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 215 | static void VMDebug_crash(JNIEnv*, jclass) { |
Elliott Hughes | 81ff318 | 2012-03-23 20:35:56 -0700 | [diff] [blame] | 216 | LOG(FATAL) << "Crashing runtime on request"; |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 217 | } |
| 218 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 219 | static void VMDebug_infopoint(JNIEnv*, jclass, jint id) { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 220 | LOG(INFO) << "VMDebug infopoint " << id << " hit"; |
| 221 | } |
| 222 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 223 | static jlong VMDebug_countInstancesOfClass(JNIEnv* env, jclass, jclass javaClass, |
| 224 | jboolean countAssignable) { |
| 225 | ScopedObjectAccess soa(env); |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 226 | mirror::Class* c = soa.Decode<mirror::Class*>(javaClass); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 227 | if (c == NULL) { |
| 228 | return 0; |
| 229 | } |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 230 | std::vector<mirror::Class*> classes; |
Elliott Hughes | ec0f83d | 2013-01-15 16:54:08 -0800 | [diff] [blame] | 231 | classes.push_back(c); |
| 232 | uint64_t count = 0; |
| 233 | Runtime::Current()->GetHeap()->CountInstances(classes, countAssignable, &count); |
| 234 | return count; |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 235 | } |
| 236 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 237 | static JNINativeMethod gMethods[] = { |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 238 | NATIVE_METHOD(VMDebug, countInstancesOfClass, "(Ljava/lang/Class;Z)J"), |
| 239 | NATIVE_METHOD(VMDebug, crash, "()V"), |
| 240 | NATIVE_METHOD(VMDebug, dumpHprofData, "(Ljava/lang/String;Ljava/io/FileDescriptor;)V"), |
| 241 | NATIVE_METHOD(VMDebug, dumpHprofDataDdms, "()V"), |
| 242 | NATIVE_METHOD(VMDebug, dumpReferenceTables, "()V"), |
| 243 | NATIVE_METHOD(VMDebug, getAllocCount, "(I)I"), |
| 244 | NATIVE_METHOD(VMDebug, getInstructionCount, "([I)V"), |
| 245 | NATIVE_METHOD(VMDebug, getLoadedClassCount, "()I"), |
| 246 | NATIVE_METHOD(VMDebug, getVmFeatureList, "()[Ljava/lang/String;"), |
| 247 | NATIVE_METHOD(VMDebug, infopoint, "(I)V"), |
| 248 | NATIVE_METHOD(VMDebug, isDebuggerConnected, "()Z"), |
| 249 | NATIVE_METHOD(VMDebug, isDebuggingEnabled, "()Z"), |
| 250 | NATIVE_METHOD(VMDebug, isMethodTracingActive, "()Z"), |
| 251 | NATIVE_METHOD(VMDebug, lastDebuggerActivity, "()J"), |
| 252 | NATIVE_METHOD(VMDebug, printLoadedClasses, "(I)V"), |
| 253 | NATIVE_METHOD(VMDebug, resetAllocCount, "(I)V"), |
| 254 | NATIVE_METHOD(VMDebug, resetInstructionCount, "()V"), |
| 255 | NATIVE_METHOD(VMDebug, startAllocCounting, "()V"), |
| 256 | NATIVE_METHOD(VMDebug, startEmulatorTracing, "()V"), |
| 257 | NATIVE_METHOD(VMDebug, startInstructionCounting, "()V"), |
| 258 | NATIVE_METHOD(VMDebug, startMethodTracingDdmsImpl, "(II)V"), |
| 259 | NATIVE_METHOD(VMDebug, startMethodTracingFd, "(Ljava/lang/String;Ljava/io/FileDescriptor;II)V"), |
| 260 | NATIVE_METHOD(VMDebug, startMethodTracingFilename, "(Ljava/lang/String;II)V"), |
| 261 | NATIVE_METHOD(VMDebug, stopAllocCounting, "()V"), |
| 262 | NATIVE_METHOD(VMDebug, stopEmulatorTracing, "()V"), |
| 263 | NATIVE_METHOD(VMDebug, stopInstructionCounting, "()V"), |
| 264 | NATIVE_METHOD(VMDebug, stopMethodTracing, "()V"), |
| 265 | NATIVE_METHOD(VMDebug, threadCpuTimeNanos, "()J"), |
| 266 | }; |
| 267 | |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 268 | void register_dalvik_system_VMDebug(JNIEnv* env) { |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 269 | REGISTER_NATIVE_METHODS("dalvik/system/VMDebug"); |
Elliott Hughes | 9d5ccec | 2011-09-19 13:19:50 -0700 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | } // namespace art |