summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-08-31 21:31:47 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-01 11:16:25 -0700
commit3025ef332c29e255388f74b2afefe05f64bce07c (patch)
treeb7982d9ebe8a578b5b439c564c014a9af8be952f /core/jni
parentd9942b5cb1662638bb6fb57c12a06976e3c34651 (diff)
downloadframeworks_base-3025ef332c29e255388f74b2afefe05f64bce07c.zip
frameworks_base-3025ef332c29e255388f74b2afefe05f64bce07c.tar.gz
frameworks_base-3025ef332c29e255388f74b2afefe05f64bce07c.tar.bz2
Various infrastructure to support a running services UI.
Some of this is temporary (in particular the two approaches for getting process memory, one working but horrible, the other not working but preferred) until I figure out the best way to do it. Change-Id: I8c8f25062d481fcea22a47d459b083d2fd8a5040
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_os_Debug.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index b4c60f1..3ee404a 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -200,12 +200,13 @@ static void load_maps(int pid, stats_t* stats)
fclose(fp);
}
-static void android_os_Debug_getDirtyPages(JNIEnv *env, jobject clazz, jobject object)
+static void android_os_Debug_getDirtyPagesPid(JNIEnv *env, jobject clazz,
+ jint pid, jobject object)
{
stats_t stats;
memset(&stats, 0, sizeof(stats_t));
- load_maps(getpid(), &stats);
+ load_maps(pid, &stats);
env->SetIntField(object, dalvikPss_field, stats.dalvikPss);
env->SetIntField(object, dalvikPrivateDirty_field, stats.dalvikPrivateDirty);
@@ -220,6 +221,11 @@ static void android_os_Debug_getDirtyPages(JNIEnv *env, jobject clazz, jobject o
env->SetIntField(object, otherSharedDirty_field, stats.otherSharedDirty);
}
+static void android_os_Debug_getDirtyPages(JNIEnv *env, jobject clazz, jobject object)
+{
+ android_os_Debug_getDirtyPagesPid(env, clazz, getpid(), object);
+}
+
static jint read_binder_stat(const char* stat)
{
FILE* fp = fopen(BINDER_STATS, "r");
@@ -281,6 +287,8 @@ static JNINativeMethod gMethods[] = {
(void*) android_os_Debug_getNativeHeapFreeSize },
{ "getMemoryInfo", "(Landroid/os/Debug$MemoryInfo;)V",
(void*) android_os_Debug_getDirtyPages },
+ { "getMemoryInfo", "(ILandroid/os/Debug$MemoryInfo;)V",
+ (void*) android_os_Debug_getDirtyPagesPid },
{ "getBinderSentTransactions", "()I",
(void*) android_os_Debug_getBinderSentTransactions },
{ "getBinderReceivedTransactions", "()I",