2 * Copyright (C) 2007 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.apache.harmony.dalvik.ddmc;
20 * Declarations for some VM-internal DDM stuff.
22 public class DdmVmInternal {
24 /* do not instantiate */
25 private DdmVmInternal() {}
28 * Enable thread notification.
30 * This is built into the VM, since that's where threads get managed.
32 native public static void threadNotify(boolean enable);
35 * Enable heap info updates.
37 * This is built into the VM, since that's where the heap is managed.
39 * @param when when to send the next HPIF chunk
40 * @return true on success. false if 'when' is bad or if there was
43 native public static boolean heapInfoNotify(int when);
46 * Enable heap segment updates for the java (isNative == false) or
47 * native (isNative == true) heap.
49 * This is built into the VM, since that's where the heap is managed.
51 native public static boolean heapSegmentNotify(int when, int what,
55 * Get status info for all threads. This is for the THST chunk.
57 * Returns a byte array with the THST data, or null if something
60 native public static byte[] getThreadStats();
63 * Get a stack trace for the specified thread ID. The ID can be found
64 * in the data from getThreadStats.
66 native public static StackTraceElement[] getStackTraceById(int threadId);
69 * Enable or disable "recent allocation" tracking.
71 native public static void enableRecentAllocations(boolean enable);
74 * Return a boolean indicating whether or not the "recent allocation"
75 * feature is currently enabled.
77 native public static boolean getRecentAllocationStatus();
80 * Fill a buffer with data on recent heap allocations.
82 native public static byte[] getRecentAllocations();