Use nativePostForkSystemServer for system server profiling
Need to use nativePostForkSystemServer instead of nativePostForkChild
since nativePostForkChild is called after the class loader is created.
(cherry-picked from commit 0712f2969c0f19fa2cc41f99751d39ee1852ebbc)
Bug: 139883463
Bug: 144383344
Test: showmap `pid system_server` and verify
Test: atest BootImageProfileTest
Merged-In: I7c4f61b08d286ef6056931231f6b835749092720
Change-Id: I7c4f61b08d286ef6056931231f6b835749092720
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 3d4116b..135ee63 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -994,16 +994,13 @@
}
}
- if (is_system_server) {
- jit_options_->SetSaveProfilingInfo(profile_system_server);
- if (profile_system_server) {
- // Set the system server package name to "android".
- // This is used to tell the difference between samples provided by system server
- // and samples generated by other apps when processing boot image profiles.
- SetProcessPackageName("android");
- jit_options_->SetWaitForJitNotificationsToSaveProfile(false);
- VLOG(profiler) << "Enabling system server profiles";
- }
+ if (is_system_server && profile_system_server) {
+ // Set the system server package name to "android".
+ // This is used to tell the difference between samples provided by system server
+ // and samples generated by other apps when processing boot image profiles.
+ SetProcessPackageName("android");
+ jit_options_->SetWaitForJitNotificationsToSaveProfile(false);
+ VLOG(profiler) << "Enabling system server profiles";
}
// Create the thread pools.