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 
17 #include "dalvik_system_VMDebug.h"
18 
19 #include <string.h>
20 #include <unistd.h>
21 
22 #include <sstream>
23 
24 #include "base/histogram-inl.h"
25 #include "base/time_utils.h"
26 #include "class_linker.h"
27 #include "common_throws.h"
28 #include "debugger.h"
29 #include "gc/space/bump_pointer_space.h"
30 #include "gc/space/dlmalloc_space.h"
31 #include "gc/space/large_object_space.h"
32 #include "gc/space/space-inl.h"
33 #include "gc/space/zygote_space.h"
34 #include "hprof/hprof.h"
35 #include "jni_internal.h"
36 #include "mirror/class.h"
37 #include "ScopedLocalRef.h"
38 #include "ScopedUtfChars.h"
39 #include "scoped_fast_native_object_access.h"
40 #include "trace.h"
41 #include "well_known_classes.h"
42 
43 namespace art {
44 
VMDebug_getVmFeatureList(JNIEnv * env,jclass)45 static jobjectArray VMDebug_getVmFeatureList(JNIEnv* env, jclass) {
46   static const char* features[] = {
47     "method-trace-profiling",
48     "method-trace-profiling-streaming",
49     "method-sample-profiling",
50     "hprof-heap-dump",
51     "hprof-heap-dump-streaming",
52   };
53   jobjectArray result = env->NewObjectArray(arraysize(features),
54                                             WellKnownClasses::java_lang_String,
55                                             nullptr);
56   if (result != nullptr) {
57     for (size_t i = 0; i < arraysize(features); ++i) {
58       ScopedLocalRef<jstring> jfeature(env, env->NewStringUTF(features[i]));
59       if (jfeature.get() == nullptr) {
60         return nullptr;
61       }
62       env->SetObjectArrayElement(result, i, jfeature.get());
63     }
64   }
65   return result;
66 }
67 
VMDebug_startAllocCounting(JNIEnv *,jclass)68 static void VMDebug_startAllocCounting(JNIEnv*, jclass) {
69   Runtime::Current()->SetStatsEnabled(true);
70 }
71 
VMDebug_stopAllocCounting(JNIEnv *,jclass)72 static void VMDebug_stopAllocCounting(JNIEnv*, jclass) {
73   Runtime::Current()->SetStatsEnabled(false);
74 }
75 
VMDebug_getAllocCount(JNIEnv *,jclass,jint kind)76 static jint VMDebug_getAllocCount(JNIEnv*, jclass, jint kind) {
77   return Runtime::Current()->GetStat(kind);
78 }
79 
VMDebug_resetAllocCount(JNIEnv *,jclass,jint kinds)80 static void VMDebug_resetAllocCount(JNIEnv*, jclass, jint kinds) {
81   Runtime::Current()->ResetStats(kinds);
82 }
83 
VMDebug_startMethodTracingDdmsImpl(JNIEnv *,jclass,jint bufferSize,jint flags,jboolean samplingEnabled,jint intervalUs)84 static void VMDebug_startMethodTracingDdmsImpl(JNIEnv*, jclass, jint bufferSize, jint flags,
85                                                jboolean samplingEnabled, jint intervalUs) {
86   Trace::Start("[DDMS]", -1, bufferSize, flags, Trace::TraceOutputMode::kDDMS,
87                samplingEnabled ? Trace::TraceMode::kSampling : Trace::TraceMode::kMethodTracing,
88                intervalUs);
89 }
90 
VMDebug_startMethodTracingFd(JNIEnv * env,jclass,jstring javaTraceFilename,jobject javaFd,jint bufferSize,jint flags,jboolean samplingEnabled,jint intervalUs)91 static void VMDebug_startMethodTracingFd(JNIEnv* env, jclass, jstring javaTraceFilename,
92                                          jobject javaFd, jint bufferSize, jint flags,
93                                          jboolean samplingEnabled, jint intervalUs) {
94   int originalFd = jniGetFDFromFileDescriptor(env, javaFd);
95   if (originalFd < 0) {
96     return;
97   }
98 
99   int fd = dup(originalFd);
100   if (fd < 0) {
101     ScopedObjectAccess soa(env);
102     soa.Self()->ThrowNewExceptionF("Ljava/lang/RuntimeException;",
103                                    "dup(%d) failed: %s", originalFd, strerror(errno));
104     return;
105   }
106 
107   ScopedUtfChars traceFilename(env, javaTraceFilename);
108   if (traceFilename.c_str() == nullptr) {
109     return;
110   }
111   Trace::Start(traceFilename.c_str(), fd, bufferSize, flags, Trace::TraceOutputMode::kFile,
112                samplingEnabled ? Trace::TraceMode::kSampling : Trace::TraceMode::kMethodTracing,
113                intervalUs);
114 }
115 
VMDebug_startMethodTracingFilename(JNIEnv * env,jclass,jstring javaTraceFilename,jint bufferSize,jint flags,jboolean samplingEnabled,jint intervalUs)116 static void VMDebug_startMethodTracingFilename(JNIEnv* env, jclass, jstring javaTraceFilename,
117                                                jint bufferSize, jint flags,
118                                                jboolean samplingEnabled, jint intervalUs) {
119   ScopedUtfChars traceFilename(env, javaTraceFilename);
120   if (traceFilename.c_str() == nullptr) {
121     return;
122   }
123   Trace::Start(traceFilename.c_str(), -1, bufferSize, flags, Trace::TraceOutputMode::kFile,
124                samplingEnabled ? Trace::TraceMode::kSampling : Trace::TraceMode::kMethodTracing,
125                intervalUs);
126 }
127 
VMDebug_getMethodTracingMode(JNIEnv *,jclass)128 static jint VMDebug_getMethodTracingMode(JNIEnv*, jclass) {
129   return Trace::GetMethodTracingMode();
130 }
131 
VMDebug_stopMethodTracing(JNIEnv *,jclass)132 static void VMDebug_stopMethodTracing(JNIEnv*, jclass) {
133   Trace::Stop();
134 }
135 
VMDebug_startEmulatorTracing(JNIEnv *,jclass)136 static void VMDebug_startEmulatorTracing(JNIEnv*, jclass) {
137   UNIMPLEMENTED(WARNING);
138   // dvmEmulatorTraceStart();
139 }
140 
VMDebug_stopEmulatorTracing(JNIEnv *,jclass)141 static void VMDebug_stopEmulatorTracing(JNIEnv*, jclass) {
142   UNIMPLEMENTED(WARNING);
143   // dvmEmulatorTraceStop();
144 }
145 
VMDebug_isDebuggerConnected(JNIEnv *,jclass)146 static jboolean VMDebug_isDebuggerConnected(JNIEnv*, jclass) {
147   return Dbg::IsDebuggerActive();
148 }
149 
VMDebug_isDebuggingEnabled(JNIEnv *,jclass)150 static jboolean VMDebug_isDebuggingEnabled(JNIEnv*, jclass) {
151   return Dbg::IsJdwpConfigured();
152 }
153 
VMDebug_lastDebuggerActivity(JNIEnv *,jclass)154 static jlong VMDebug_lastDebuggerActivity(JNIEnv*, jclass) {
155   return Dbg::LastDebuggerActivity();
156 }
157 
ThrowUnsupportedOperationException(JNIEnv * env)158 static void ThrowUnsupportedOperationException(JNIEnv* env) {
159   ScopedObjectAccess soa(env);
160   soa.Self()->ThrowNewException("Ljava/lang/UnsupportedOperationException;", nullptr);
161 }
162 
VMDebug_startInstructionCounting(JNIEnv * env,jclass)163 static void VMDebug_startInstructionCounting(JNIEnv* env, jclass) {
164   ThrowUnsupportedOperationException(env);
165 }
166 
VMDebug_stopInstructionCounting(JNIEnv * env,jclass)167 static void VMDebug_stopInstructionCounting(JNIEnv* env, jclass) {
168   ThrowUnsupportedOperationException(env);
169 }
170 
VMDebug_getInstructionCount(JNIEnv * env,jclass,jintArray)171 static void VMDebug_getInstructionCount(JNIEnv* env, jclass, jintArray /*javaCounts*/) {
172   ThrowUnsupportedOperationException(env);
173 }
174 
VMDebug_resetInstructionCount(JNIEnv * env,jclass)175 static void VMDebug_resetInstructionCount(JNIEnv* env, jclass) {
176   ThrowUnsupportedOperationException(env);
177 }
178 
VMDebug_printLoadedClasses(JNIEnv * env,jclass,jint flags)179 static void VMDebug_printLoadedClasses(JNIEnv* env, jclass, jint flags) {
180   ScopedFastNativeObjectAccess soa(env);
181   return Runtime::Current()->GetClassLinker()->DumpAllClasses(flags);
182 }
183 
VMDebug_getLoadedClassCount(JNIEnv * env,jclass)184 static jint VMDebug_getLoadedClassCount(JNIEnv* env, jclass) {
185   ScopedFastNativeObjectAccess soa(env);
186   return Runtime::Current()->GetClassLinker()->NumLoadedClasses();
187 }
188 
189 /*
190  * Returns the thread-specific CPU-time clock value for the current thread,
191  * or -1 if the feature isn't supported.
192  */
VMDebug_threadCpuTimeNanos(JNIEnv *,jclass)193 static jlong VMDebug_threadCpuTimeNanos(JNIEnv*, jclass) {
194   return ThreadCpuNanoTime();
195 }
196 
197 /*
198  * static void dumpHprofData(String fileName, FileDescriptor fd)
199  *
200  * Cause "hprof" data to be dumped.  We can throw an IOException if an
201  * error occurs during file handling.
202  */
VMDebug_dumpHprofData(JNIEnv * env,jclass,jstring javaFilename,jobject javaFd)203 static void VMDebug_dumpHprofData(JNIEnv* env, jclass, jstring javaFilename, jobject javaFd) {
204   // Only one of these may be null.
205   if (javaFilename == nullptr && javaFd == nullptr) {
206     ScopedObjectAccess soa(env);
207     ThrowNullPointerException("fileName == null && fd == null");
208     return;
209   }
210 
211   std::string filename;
212   if (javaFilename != nullptr) {
213     ScopedUtfChars chars(env, javaFilename);
214     if (env->ExceptionCheck()) {
215       return;
216     }
217     filename = chars.c_str();
218   } else {
219     filename = "[fd]";
220   }
221 
222   int fd = -1;
223   if (javaFd != nullptr) {
224     fd = jniGetFDFromFileDescriptor(env, javaFd);
225     if (fd < 0) {
226       ScopedObjectAccess soa(env);
227       ThrowRuntimeException("Invalid file descriptor");
228       return;
229     }
230   }
231 
232   hprof::DumpHeap(filename.c_str(), fd, false);
233 }
234 
VMDebug_dumpHprofDataDdms(JNIEnv *,jclass)235 static void VMDebug_dumpHprofDataDdms(JNIEnv*, jclass) {
236   hprof::DumpHeap("[DDMS]", -1, true);
237 }
238 
VMDebug_dumpReferenceTables(JNIEnv * env,jclass)239 static void VMDebug_dumpReferenceTables(JNIEnv* env, jclass) {
240   ScopedObjectAccess soa(env);
241   LOG(INFO) << "--- reference table dump ---";
242 
243   soa.Env()->DumpReferenceTables(LOG(INFO));
244   soa.Vm()->DumpReferenceTables(LOG(INFO));
245 
246   LOG(INFO) << "---";
247 }
248 
VMDebug_crash(JNIEnv *,jclass)249 static void VMDebug_crash(JNIEnv*, jclass) {
250   LOG(FATAL) << "Crashing runtime on request";
251 }
252 
VMDebug_infopoint(JNIEnv *,jclass,jint id)253 static void VMDebug_infopoint(JNIEnv*, jclass, jint id) {
254   LOG(INFO) << "VMDebug infopoint " << id << " hit";
255 }
256 
VMDebug_countInstancesOfClass(JNIEnv * env,jclass,jclass javaClass,jboolean countAssignable)257 static jlong VMDebug_countInstancesOfClass(JNIEnv* env, jclass, jclass javaClass,
258                                            jboolean countAssignable) {
259   ScopedObjectAccess soa(env);
260   gc::Heap* heap = Runtime::Current()->GetHeap();
261   // We only want reachable instances, so do a GC. Heap::VisitObjects visits all of the heap
262   // objects in the all spaces and the allocation stack.
263   heap->CollectGarbage(false);
264   mirror::Class* c = soa.Decode<mirror::Class*>(javaClass);
265   if (c == nullptr) {
266     return 0;
267   }
268   std::vector<mirror::Class*> classes;
269   classes.push_back(c);
270   uint64_t count = 0;
271   heap->CountInstances(classes, countAssignable, &count);
272   return count;
273 }
274 
275 // We export the VM internal per-heap-space size/alloc/free metrics
276 // for the zygote space, alloc space (application heap), and the large
277 // object space for dumpsys meminfo. The other memory region data such
278 // as PSS, private/shared dirty/shared data are available via
279 // /proc/<pid>/smaps.
VMDebug_getHeapSpaceStats(JNIEnv * env,jclass,jlongArray data)280 static void VMDebug_getHeapSpaceStats(JNIEnv* env, jclass, jlongArray data) {
281   jlong* arr = reinterpret_cast<jlong*>(env->GetPrimitiveArrayCritical(data, 0));
282   if (arr == nullptr || env->GetArrayLength(data) < 9) {
283     return;
284   }
285 
286   size_t allocSize = 0;
287   size_t allocUsed = 0;
288   size_t zygoteSize = 0;
289   size_t zygoteUsed = 0;
290   size_t largeObjectsSize = 0;
291   size_t largeObjectsUsed = 0;
292   gc::Heap* heap = Runtime::Current()->GetHeap();
293   for (gc::space::ContinuousSpace* space : heap->GetContinuousSpaces()) {
294     if (space->IsImageSpace()) {
295       // Currently don't include the image space.
296     } else if (space->IsZygoteSpace()) {
297       gc::space::ZygoteSpace* zygote_space = space->AsZygoteSpace();
298       zygoteSize += zygote_space->Size();
299       zygoteUsed += zygote_space->GetBytesAllocated();
300     } else if (space->IsMallocSpace()) {
301       // This is a malloc space.
302       gc::space::MallocSpace* malloc_space = space->AsMallocSpace();
303       allocSize += malloc_space->GetFootprint();
304       allocUsed += malloc_space->GetBytesAllocated();
305     } else if (space->IsBumpPointerSpace()) {
306       ScopedObjectAccess soa(env);
307       gc::space::BumpPointerSpace* bump_pointer_space = space->AsBumpPointerSpace();
308       allocSize += bump_pointer_space->Size();
309       allocUsed += bump_pointer_space->GetBytesAllocated();
310     }
311   }
312   for (gc::space::DiscontinuousSpace* space : heap->GetDiscontinuousSpaces()) {
313     if (space->IsLargeObjectSpace()) {
314       largeObjectsSize += space->AsLargeObjectSpace()->GetBytesAllocated();
315       largeObjectsUsed += largeObjectsSize;
316     }
317   }
318 
319   size_t allocFree = allocSize - allocUsed;
320   size_t zygoteFree = zygoteSize - zygoteUsed;
321   size_t largeObjectsFree = largeObjectsSize - largeObjectsUsed;
322 
323   int j = 0;
324   arr[j++] = allocSize;
325   arr[j++] = allocUsed;
326   arr[j++] = allocFree;
327   arr[j++] = zygoteSize;
328   arr[j++] = zygoteUsed;
329   arr[j++] = zygoteFree;
330   arr[j++] = largeObjectsSize;
331   arr[j++] = largeObjectsUsed;
332   arr[j++] = largeObjectsFree;
333   env->ReleasePrimitiveArrayCritical(data, arr, 0);
334 }
335 
336 // The runtime stat names for VMDebug.getRuntimeStat().
337 enum class VMDebugRuntimeStatId {
338   kArtGcGcCount = 0,
339   kArtGcGcTime,
340   kArtGcBytesAllocated,
341   kArtGcBytesFreed,
342   kArtGcBlockingGcCount,
343   kArtGcBlockingGcTime,
344   kArtGcGcCountRateHistogram,
345   kArtGcBlockingGcCountRateHistogram,
346   kNumRuntimeStats,
347 };
348 
VMDebug_getRuntimeStatInternal(JNIEnv * env,jclass,jint statId)349 static jobject VMDebug_getRuntimeStatInternal(JNIEnv* env, jclass, jint statId) {
350   gc::Heap* heap = Runtime::Current()->GetHeap();
351   switch (static_cast<VMDebugRuntimeStatId>(statId)) {
352     case VMDebugRuntimeStatId::kArtGcGcCount: {
353       std::string output = std::to_string(heap->GetGcCount());
354       return env->NewStringUTF(output.c_str());
355     }
356     case VMDebugRuntimeStatId::kArtGcGcTime: {
357       std::string output = std::to_string(NsToMs(heap->GetGcTime()));
358       return env->NewStringUTF(output.c_str());
359     }
360     case VMDebugRuntimeStatId::kArtGcBytesAllocated: {
361       std::string output = std::to_string(heap->GetBytesAllocatedEver());
362       return env->NewStringUTF(output.c_str());
363     }
364     case VMDebugRuntimeStatId::kArtGcBytesFreed: {
365       std::string output = std::to_string(heap->GetBytesFreedEver());
366       return env->NewStringUTF(output.c_str());
367     }
368     case VMDebugRuntimeStatId::kArtGcBlockingGcCount: {
369       std::string output = std::to_string(heap->GetBlockingGcCount());
370       return env->NewStringUTF(output.c_str());
371     }
372     case VMDebugRuntimeStatId::kArtGcBlockingGcTime: {
373       std::string output = std::to_string(NsToMs(heap->GetBlockingGcTime()));
374       return env->NewStringUTF(output.c_str());
375     }
376     case VMDebugRuntimeStatId::kArtGcGcCountRateHistogram: {
377       std::ostringstream output;
378       heap->DumpGcCountRateHistogram(output);
379       return env->NewStringUTF(output.str().c_str());
380     }
381     case VMDebugRuntimeStatId::kArtGcBlockingGcCountRateHistogram: {
382       std::ostringstream output;
383       heap->DumpBlockingGcCountRateHistogram(output);
384       return env->NewStringUTF(output.str().c_str());
385     }
386     default:
387       return nullptr;
388   }
389 }
390 
SetRuntimeStatValue(JNIEnv * env,jobjectArray result,VMDebugRuntimeStatId id,std::string value)391 static bool SetRuntimeStatValue(JNIEnv* env, jobjectArray result, VMDebugRuntimeStatId id,
392                                 std::string value) {
393   ScopedLocalRef<jstring> jvalue(env, env->NewStringUTF(value.c_str()));
394   if (jvalue.get() == nullptr) {
395     return false;
396   }
397   env->SetObjectArrayElement(result, static_cast<jint>(id), jvalue.get());
398   return true;
399 }
400 
VMDebug_getRuntimeStatsInternal(JNIEnv * env,jclass)401 static jobjectArray VMDebug_getRuntimeStatsInternal(JNIEnv* env, jclass) {
402   jobjectArray result = env->NewObjectArray(
403       static_cast<jint>(VMDebugRuntimeStatId::kNumRuntimeStats),
404       WellKnownClasses::java_lang_String,
405       nullptr);
406   if (result == nullptr) {
407     return nullptr;
408   }
409   gc::Heap* heap = Runtime::Current()->GetHeap();
410   if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcGcCount,
411                            std::to_string(heap->GetGcCount()))) {
412     return nullptr;
413   }
414   if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcGcTime,
415                            std::to_string(NsToMs(heap->GetGcTime())))) {
416     return nullptr;
417   }
418   if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcBytesAllocated,
419                            std::to_string(heap->GetBytesAllocatedEver()))) {
420     return nullptr;
421   }
422   if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcBytesFreed,
423                            std::to_string(heap->GetBytesFreedEver()))) {
424     return nullptr;
425   }
426   if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcBlockingGcCount,
427                            std::to_string(heap->GetBlockingGcCount()))) {
428     return nullptr;
429   }
430   if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcBlockingGcTime,
431                            std::to_string(NsToMs(heap->GetBlockingGcTime())))) {
432     return nullptr;
433   }
434   {
435     std::ostringstream output;
436     heap->DumpGcCountRateHistogram(output);
437     if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcGcCountRateHistogram,
438                              output.str())) {
439       return nullptr;
440     }
441   }
442   {
443     std::ostringstream output;
444     heap->DumpBlockingGcCountRateHistogram(output);
445     if (!SetRuntimeStatValue(env, result, VMDebugRuntimeStatId::kArtGcBlockingGcCountRateHistogram,
446                              output.str())) {
447       return nullptr;
448     }
449   }
450   return result;
451 }
452 
453 static JNINativeMethod gMethods[] = {
454   NATIVE_METHOD(VMDebug, countInstancesOfClass, "(Ljava/lang/Class;Z)J"),
455   NATIVE_METHOD(VMDebug, crash, "()V"),
456   NATIVE_METHOD(VMDebug, dumpHprofData, "(Ljava/lang/String;Ljava/io/FileDescriptor;)V"),
457   NATIVE_METHOD(VMDebug, dumpHprofDataDdms, "()V"),
458   NATIVE_METHOD(VMDebug, dumpReferenceTables, "()V"),
459   NATIVE_METHOD(VMDebug, getAllocCount, "(I)I"),
460   NATIVE_METHOD(VMDebug, getHeapSpaceStats, "([J)V"),
461   NATIVE_METHOD(VMDebug, getInstructionCount, "([I)V"),
462   NATIVE_METHOD(VMDebug, getLoadedClassCount, "!()I"),
463   NATIVE_METHOD(VMDebug, getVmFeatureList, "()[Ljava/lang/String;"),
464   NATIVE_METHOD(VMDebug, infopoint, "(I)V"),
465   NATIVE_METHOD(VMDebug, isDebuggerConnected, "!()Z"),
466   NATIVE_METHOD(VMDebug, isDebuggingEnabled, "!()Z"),
467   NATIVE_METHOD(VMDebug, getMethodTracingMode, "()I"),
468   NATIVE_METHOD(VMDebug, lastDebuggerActivity, "!()J"),
469   NATIVE_METHOD(VMDebug, printLoadedClasses, "!(I)V"),
470   NATIVE_METHOD(VMDebug, resetAllocCount, "(I)V"),
471   NATIVE_METHOD(VMDebug, resetInstructionCount, "()V"),
472   NATIVE_METHOD(VMDebug, startAllocCounting, "()V"),
473   NATIVE_METHOD(VMDebug, startEmulatorTracing, "()V"),
474   NATIVE_METHOD(VMDebug, startInstructionCounting, "()V"),
475   NATIVE_METHOD(VMDebug, startMethodTracingDdmsImpl, "(IIZI)V"),
476   NATIVE_METHOD(VMDebug, startMethodTracingFd, "(Ljava/lang/String;Ljava/io/FileDescriptor;IIZI)V"),
477   NATIVE_METHOD(VMDebug, startMethodTracingFilename, "(Ljava/lang/String;IIZI)V"),
478   NATIVE_METHOD(VMDebug, stopAllocCounting, "()V"),
479   NATIVE_METHOD(VMDebug, stopEmulatorTracing, "()V"),
480   NATIVE_METHOD(VMDebug, stopInstructionCounting, "()V"),
481   NATIVE_METHOD(VMDebug, stopMethodTracing, "()V"),
482   NATIVE_METHOD(VMDebug, threadCpuTimeNanos, "!()J"),
483   NATIVE_METHOD(VMDebug, getRuntimeStatInternal, "(I)Ljava/lang/String;"),
484   NATIVE_METHOD(VMDebug, getRuntimeStatsInternal, "()[Ljava/lang/String;")
485 };
486 
register_dalvik_system_VMDebug(JNIEnv * env)487 void register_dalvik_system_VMDebug(JNIEnv* env) {
488   REGISTER_NATIVE_METHODS("dalvik/system/VMDebug");
489 }
490 
491 }  // namespace art
492