2 * Copyright (C) 2008 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 * Dalvik Debug Monitor
23 * Handle a packet full of DDM goodness.
25 * Returns "true" if we have anything to say in return; in which case,
26 * "*pReplyBuf" and "*pReplyLen" will also be set.
28 bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
32 * Deal with the DDM server connecting and disconnecting.
34 void dvmDdmConnected(void);
35 void dvmDdmDisconnected(void);
38 * Turn thread notification on or off.
40 void dvmDdmSetThreadNotification(bool enable);
43 * If thread start/stop notification is enabled, call this when threads
46 void dvmDdmSendThreadNotification(Thread* thread, bool started);
49 * If thread start/stop notification is enabled, call this when the
50 * thread name changes.
52 void dvmDdmSendThreadNameChange(int threadId, StringObject* newName);
55 * Generate a byte[] full of thread stats for a THST packet.
57 ArrayObject* dvmDdmGenerateThreadStats(void);
60 * Let the heap know that the HPIF when value has changed.
62 * @return true iff the when value is supported by the VM.
64 bool dvmDdmHandleHpifChunk(int when);
67 * Let the heap know that the HPSG or NHSG what/when values have changed.
69 * @param native false for an HPSG chunk, true for an NHSG chunk
71 * @return true iff the what/when values are supported by the VM.
73 bool dvmDdmHandleHpsgNhsgChunk(int when, int what, bool native);
76 * Get an array of StackTraceElement objects for the specified thread.
78 ArrayObject* dvmDdmGetStackTraceById(u4 threadId);
81 * Gather up recent allocation data and return it in a byte[].
83 * Returns NULL on failure with an exception raised.
85 ArrayObject* dvmDdmGetRecentAllocations(void);
87 #endif /*_DALVIK_DDM*/