diff options
| -rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 6 | ||||
| -rw-r--r-- | cmds/installd/InstalldNativeService.h | 3 | ||||
| -rw-r--r-- | cmds/installd/binder/android/os/IInstalld.aidl | 2 | ||||
| -rw-r--r-- | cmds/installd/dexopt.cpp | 16 | ||||
| -rw-r--r-- | cmds/installd/dexopt.h | 6 |
5 files changed, 19 insertions, 14 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index 397d4326d6..b4aa88ee78 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -2976,13 +2976,15 @@ binder::Status InstalldNativeService::setAppQuota(const std::optional<std::strin // 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(); } diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h index 0432222433..521afc3f97 100644 --- a/cmds/installd/InstalldNativeService.h +++ b/cmds/installd/InstalldNativeService.h @@ -134,7 +134,8 @@ public: binder::Status mergeProfiles(int32_t uid, const std::string& packageName, const std::string& profileName, int* _aidl_return); binder::Status 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); binder::Status copySystemProfile(const std::string& systemProfile, int32_t uid, const std::string& packageName, const std::string& profileName, bool* _aidl_return); diff --git a/cmds/installd/binder/android/os/IInstalld.aidl b/cmds/installd/binder/android/os/IInstalld.aidl index db03411e20..9ad853b1df 100644 --- a/cmds/installd/binder/android/os/IInstalld.aidl +++ b/cmds/installd/binder/android/os/IInstalld.aidl @@ -77,7 +77,7 @@ interface IInstalld { int mergeProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName); boolean dumpProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName, - @utf8InCpp String codePath); + @utf8InCpp String codePath, boolean dumpClassesAndMethods); boolean copySystemProfile(@utf8InCpp String systemProfile, int uid, @utf8InCpp String packageName, @utf8InCpp String profileName); void clearAppProfiles(@utf8InCpp String packageName, @utf8InCpp String profileName); diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp index 894c7d34bd..ebb78913b1 100644 --- a/cmds/installd/dexopt.cpp +++ b/cmds/installd/dexopt.cpp @@ -624,12 +624,15 @@ class RunProfman : public ExecVHelper { /*for_boot_image*/false); } - void SetupDump(const std::vector<unique_fd>& profiles_fd, - const unique_fd& reference_profile_fd, + void SetupDump(const std::vector<unique_fd>& profiles_fd, const unique_fd& reference_profile_fd, const std::vector<std::string>& dex_locations, - const std::vector<unique_fd>& apk_fds, + const std::vector<unique_fd>& apk_fds, bool dump_classes_and_methods, const unique_fd& output_fd) { - AddArg("--dump-only"); + if (dump_classes_and_methods) { + AddArg("--dump-classes-and-methods"); + } else { + AddArg("--dump-only"); + } AddArg(StringPrintf("--dump-output-to-fd=%d", output_fd.get())); SetupArgs(profiles_fd, reference_profile_fd, @@ -772,7 +775,7 @@ int analyze_primary_profiles(uid_t uid, const std::string& package_name, } bool dump_profiles(int32_t uid, const std::string& pkgname, const std::string& profile_name, - const std::string& code_path) { + const std::string& code_path, bool dump_classes_and_methods) { std::vector<unique_fd> profile_fds; unique_fd reference_profile_fd; std::string out_file_name = StringPrintf("/data/misc/profman/%s-%s.txt", @@ -808,7 +811,8 @@ bool dump_profiles(int32_t uid, const std::string& pkgname, const std::string& p RunProfman profman_dump; - profman_dump.SetupDump(profile_fds, reference_profile_fd, dex_locations, apk_fds, output_fd); + profman_dump.SetupDump(profile_fds, reference_profile_fd, dex_locations, apk_fds, + dump_classes_and_methods, output_fd); pid_t pid = fork(); if (pid == 0) { /* child -- drop privileges before continuing */ diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h index f7af929e6d..5cf402c54c 100644 --- a/cmds/installd/dexopt.h +++ b/cmds/installd/dexopt.h @@ -88,10 +88,8 @@ bool create_profile_snapshot(int32_t app_id, const std::string& profile_name, const std::string& classpath); -bool dump_profiles(int32_t uid, - const std::string& pkgname, - const std::string& profile_name, - const std::string& code_path); +bool dump_profiles(int32_t uid, const std::string& pkgname, const std::string& profile_name, + const std::string& code_path, bool dump_classes_and_methods); bool copy_system_profile(const std::string& system_profile, uid_t packageUid, |