Set system server package name to "android" when profiling
System server does not set a value for it's runtime package name.
Configure it before we start the profile saver so that we can annotate the
samples with a proper name.
Test: manual
Bug: 139884006
Change-Id: Id09cf493b9e7227f85d0c7554aef248253f2a44d
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 6d17204..3d4116b 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -997,6 +997,10 @@
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";
}