Loading core/java/android/app/ActivityThread.java +6 −0 Original line number Diff line number Diff line Loading @@ -5939,6 +5939,11 @@ public final class ActivityThread extends ClientTransactionHandler { Binder.enableTracing(); } // Initialize heap profiling. if (isAppProfileable || Build.IS_DEBUGGABLE) { nInitZygoteChildHeapProfiling(); } // Allow renderer debugging features if we're debuggable. boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); Loading Loading @@ -6965,4 +6970,5 @@ public final class ActivityThread extends ClientTransactionHandler { // ------------------ Regular JNI ------------------------ private native void nPurgePendingResources(); private native void nDumpGraphicsInfo(FileDescriptor fd); private native void nInitZygoteChildHeapProfiling(); } core/jni/android_app_ActivityThread.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ #include "core_jni_helpers.h" #include <unistd.h> #include <bionic_malloc.h> namespace android { static void android_app_ActivityThread_purgePendingResources(JNIEnv* env, jobject clazz) { Loading @@ -38,13 +40,18 @@ android_app_ActivityThread_dumpGraphics(JNIEnv* env, jobject clazz, jobject java minikin::Layout::dumpMinikinStats(fd); } static void android_app_ActivityThread_initZygoteChildHeapProfiling(JNIEnv* env, jobject clazz) { android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0); } static JNINativeMethod gActivityThreadMethods[] = { // ------------ Regular JNI ------------------ { "nPurgePendingResources", "()V", (void*) android_app_ActivityThread_purgePendingResources }, { "nDumpGraphicsInfo", "(Ljava/io/FileDescriptor;)V", (void*) android_app_ActivityThread_dumpGraphics } (void*) android_app_ActivityThread_dumpGraphics }, { "nInitZygoteChildHeapProfiling", "()V", (void*) android_app_ActivityThread_initZygoteChildHeapProfiling } }; int register_android_app_ActivityThread(JNIEnv* env) { Loading services/core/jni/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ cc_library_static { ], include_dirs: [ "bionic/libc/private", "frameworks/base/libs", "frameworks/native/services", "system/gatekeeper/include", Loading services/core/jni/com_android_server_SystemServer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ #include <sensorservice/SensorService.h> #include <sensorservicehidl/SensorManager.h> #include <bionic_malloc.h> #include <cutils/properties.h> #include <utils/Log.h> #include <utils/misc.h> Loading Loading @@ -64,6 +66,11 @@ static void android_server_SystemServer_startHidlServices(JNIEnv* env, jobject / ALOGE_IF(err != OK, "Cannot register %s: %d", ISchedulingPolicyService::descriptor, err); } static void android_server_SystemServer_initZygoteChildHeapProfiling(JNIEnv* /* env */, jobject /* clazz */) { android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0); } /* * JNI registration. */ Loading @@ -71,6 +78,8 @@ static const JNINativeMethod gMethods[] = { /* name, signature, funcPtr */ { "startSensorService", "()V", (void*) android_server_SystemServer_startSensorService }, { "startHidlServices", "()V", (void*) android_server_SystemServer_startHidlServices }, { "initZygoteChildHeapProfiling", "()V", (void*) android_server_SystemServer_initZygoteChildHeapProfiling }, }; int register_android_server_SystemServer(JNIEnv* env) Loading services/java/com/android/server/SystemServer.java +10 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,11 @@ public final class SystemServer { */ private static native void startHidlServices(); /** * Mark this process' heap as profileable. Only for debug builds. */ private static native void initZygoteChildHeapProfiling(); /** * The main entry point from zygote. */ Loading Loading @@ -448,6 +453,11 @@ public final class SystemServer { // Initialize native services. System.loadLibrary("android_servers"); // Debug builds - allow heap profiling. if (Build.IS_DEBUGGABLE) { initZygoteChildHeapProfiling(); } // Check whether we failed to shut down last time we tried. // This call may not return. performPendingShutdown(); Loading Loading
core/java/android/app/ActivityThread.java +6 −0 Original line number Diff line number Diff line Loading @@ -5939,6 +5939,11 @@ public final class ActivityThread extends ClientTransactionHandler { Binder.enableTracing(); } // Initialize heap profiling. if (isAppProfileable || Build.IS_DEBUGGABLE) { nInitZygoteChildHeapProfiling(); } // Allow renderer debugging features if we're debuggable. boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); Loading Loading @@ -6965,4 +6970,5 @@ public final class ActivityThread extends ClientTransactionHandler { // ------------------ Regular JNI ------------------------ private native void nPurgePendingResources(); private native void nDumpGraphicsInfo(FileDescriptor fd); private native void nInitZygoteChildHeapProfiling(); }
core/jni/android_app_ActivityThread.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ #include "core_jni_helpers.h" #include <unistd.h> #include <bionic_malloc.h> namespace android { static void android_app_ActivityThread_purgePendingResources(JNIEnv* env, jobject clazz) { Loading @@ -38,13 +40,18 @@ android_app_ActivityThread_dumpGraphics(JNIEnv* env, jobject clazz, jobject java minikin::Layout::dumpMinikinStats(fd); } static void android_app_ActivityThread_initZygoteChildHeapProfiling(JNIEnv* env, jobject clazz) { android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0); } static JNINativeMethod gActivityThreadMethods[] = { // ------------ Regular JNI ------------------ { "nPurgePendingResources", "()V", (void*) android_app_ActivityThread_purgePendingResources }, { "nDumpGraphicsInfo", "(Ljava/io/FileDescriptor;)V", (void*) android_app_ActivityThread_dumpGraphics } (void*) android_app_ActivityThread_dumpGraphics }, { "nInitZygoteChildHeapProfiling", "()V", (void*) android_app_ActivityThread_initZygoteChildHeapProfiling } }; int register_android_app_ActivityThread(JNIEnv* env) { Loading
services/core/jni/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ cc_library_static { ], include_dirs: [ "bionic/libc/private", "frameworks/base/libs", "frameworks/native/services", "system/gatekeeper/include", Loading
services/core/jni/com_android_server_SystemServer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ #include <sensorservice/SensorService.h> #include <sensorservicehidl/SensorManager.h> #include <bionic_malloc.h> #include <cutils/properties.h> #include <utils/Log.h> #include <utils/misc.h> Loading Loading @@ -64,6 +66,11 @@ static void android_server_SystemServer_startHidlServices(JNIEnv* env, jobject / ALOGE_IF(err != OK, "Cannot register %s: %d", ISchedulingPolicyService::descriptor, err); } static void android_server_SystemServer_initZygoteChildHeapProfiling(JNIEnv* /* env */, jobject /* clazz */) { android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0); } /* * JNI registration. */ Loading @@ -71,6 +78,8 @@ static const JNINativeMethod gMethods[] = { /* name, signature, funcPtr */ { "startSensorService", "()V", (void*) android_server_SystemServer_startSensorService }, { "startHidlServices", "()V", (void*) android_server_SystemServer_startHidlServices }, { "initZygoteChildHeapProfiling", "()V", (void*) android_server_SystemServer_initZygoteChildHeapProfiling }, }; int register_android_server_SystemServer(JNIEnv* env) Loading
services/java/com/android/server/SystemServer.java +10 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,11 @@ public final class SystemServer { */ private static native void startHidlServices(); /** * Mark this process' heap as profileable. Only for debug builds. */ private static native void initZygoteChildHeapProfiling(); /** * The main entry point from zygote. */ Loading Loading @@ -448,6 +453,11 @@ public final class SystemServer { // Initialize native services. System.loadLibrary("android_servers"); // Debug builds - allow heap profiling. if (Build.IS_DEBUGGABLE) { initZygoteChildHeapProfiling(); } // Check whether we failed to shut down last time we tried. // This call may not return. performPendingShutdown(); Loading