Add a flag to dumpProfiles to send --dump-classes-and-methods to profman.
Test: adb root
adb shell kill -SIGUSR1 '$(pidof com.android.systemui)' && \
sleep 1 && \
adb shell pm compile -m speed-profile com.android.systemui
adb unroot
adb shell pm dump-profiles --dump-classes-and-methods \
com.android.systemui && \
adb pull data/misc/profman/com.android.systemui-primary.prof.txt
Check that the output is the same as:
adb root && adb shell profman --dump-classes-and-methods \
--reference-profile-file=data/misc/profiles/ref/com.android.systemui/primary.prof \
--profile-file=data/misc/profiles/cur/0/com.android.systemui/primary.prof \
--apk=system_ext/priv-app/SystemUI/SystemUI.apk
Test: adb shell pm dump-profiles \
com.android.systemui && \
adb pull data/misc/profman/com.android.systemui-primary.prof.txt
Check that the output is in the usual `profman --dump-only` format
Bug: 198506529
Ignore-AOSP-First: Goes together with a change in PackageManager which
is developed in internal.
Change-Id: I84ba3e3ee6c4077500d7cd5e077ac6a3bfeff265
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 397d432..b4aa88e 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -2976,13 +2976,15 @@
// Dumps the contents of a profile file, using pkgname's dex files for pretty
// printing the result.
binder::Status InstalldNativeService::dumpProfiles(int32_t uid, const std::string& packageName,
- const std::string& profileName, const std::string& codePath, bool* _aidl_return) {
+ const std::string& profileName,
+ const std::string& codePath,
+ bool dumpClassesAndMethods, bool* _aidl_return) {
ENFORCE_UID(AID_SYSTEM);
CHECK_ARGUMENT_PACKAGE_NAME(packageName);
CHECK_ARGUMENT_PATH(codePath);
LOCK_PACKAGE();
- *_aidl_return = dump_profiles(uid, packageName, profileName, codePath);
+ *_aidl_return = dump_profiles(uid, packageName, profileName, codePath, dumpClassesAndMethods);
return ok();
}