Merge "Allow profiling for standalone system server jars." am: bda789c641
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2257205 Change-Id: I28c7e16af0795ccd25850cc07beb7057af24cdd4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -517,7 +517,12 @@ public class ZygoteInit {
|
|||||||
if (shouldProfileSystemServer() && (Build.IS_USERDEBUG || Build.IS_ENG)) {
|
if (shouldProfileSystemServer() && (Build.IS_USERDEBUG || Build.IS_ENG)) {
|
||||||
try {
|
try {
|
||||||
Log.d(TAG, "Preparing system server profile");
|
Log.d(TAG, "Preparing system server profile");
|
||||||
prepareSystemServerProfile(systemServerClasspath);
|
final String standaloneSystemServerJars =
|
||||||
|
Os.getenv("STANDALONE_SYSTEMSERVER_JARS");
|
||||||
|
final String systemServerPaths = standaloneSystemServerJars != null
|
||||||
|
? String.join(":", systemServerClasspath, standaloneSystemServerJars)
|
||||||
|
: systemServerClasspath;
|
||||||
|
prepareSystemServerProfile(systemServerPaths);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.wtf(TAG, "Failed to set up system server profile", e);
|
Log.wtf(TAG, "Failed to set up system server profile", e);
|
||||||
}
|
}
|
||||||
@@ -603,12 +608,12 @@ public class ZygoteInit {
|
|||||||
* permissions. From the installer perspective the system server is a regular package which can
|
* permissions. From the installer perspective the system server is a regular package which can
|
||||||
* capture profile information.
|
* capture profile information.
|
||||||
*/
|
*/
|
||||||
private static void prepareSystemServerProfile(String systemServerClasspath)
|
private static void prepareSystemServerProfile(String systemServerPaths)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
if (systemServerClasspath.isEmpty()) {
|
if (systemServerPaths.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String[] codePaths = systemServerClasspath.split(":");
|
String[] codePaths = systemServerPaths.split(":");
|
||||||
|
|
||||||
final IInstalld installd = IInstalld.Stub
|
final IInstalld installd = IInstalld.Stub
|
||||||
.asInterface(ServiceManager.getService("installd"));
|
.asInterface(ServiceManager.getService("installd"));
|
||||||
|
|||||||
@@ -339,6 +339,11 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub {
|
|||||||
String classpath = String.join(":", Os.getenv("BOOTCLASSPATH"),
|
String classpath = String.join(":", Os.getenv("BOOTCLASSPATH"),
|
||||||
Os.getenv("SYSTEMSERVERCLASSPATH"));
|
Os.getenv("SYSTEMSERVERCLASSPATH"));
|
||||||
|
|
||||||
|
final String standaloneSystemServerJars = Os.getenv("STANDALONE_SYSTEMSERVER_JARS");
|
||||||
|
if (standaloneSystemServerJars != null) {
|
||||||
|
classpath = String.join(":", classpath, standaloneSystemServerJars);
|
||||||
|
}
|
||||||
|
|
||||||
// Create the snapshot.
|
// Create the snapshot.
|
||||||
createProfileSnapshot(BOOT_IMAGE_ANDROID_PACKAGE, BOOT_IMAGE_PROFILE_NAME, classpath,
|
createProfileSnapshot(BOOT_IMAGE_ANDROID_PACKAGE, BOOT_IMAGE_PROFILE_NAME, classpath,
|
||||||
/*appId*/ -1, callback);
|
/*appId*/ -1, callback);
|
||||||
|
|||||||
Reference in New Issue
Block a user