[installd] Create profile snaphots for boot image
Create the profile snapshot for the boot image by aggregating all primary
profiles. During aggregation data that does not belong to the boot image
is filtered out. The matching is done based on the dex files provided in
the classpath argument.
(cherry picked from commit e61189e0ad2104360a188d36210bd1ee43803a64)
Test: installd_dexopt_test
Bug: 30934496
Merged-In: Ib980ab3feb9f9838dff81a3861693cd08b1df9ab
Change-Id: Ib980ab3feb9f9838dff81a3861693cd08b1df9ab
diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h
index b96351b..93cf545 100644
--- a/cmds/installd/dexopt.h
+++ b/cmds/installd/dexopt.h
@@ -52,6 +52,8 @@
const std::string& profile_name);
// Create a snapshot of the profile information for the given package profile.
+// If appId is -1, the method creates the profile snapshot for the boot image.
+//
// The profile snapshot is the aggregation of all existing profiles (all current user
// profiles & the reference profile) and is meant to capture the all the profile information
// without performing a merge into the reference profile which might impact future dex2oat
@@ -60,8 +62,13 @@
// ownership is assigned to AID_SYSTEM.
// The snapshot location is reference_profile_location.snapshot. If a snapshot is already
// there, it will be truncated and overwritten.
-bool create_profile_snapshot(int32_t app_id, const std::string& package,
- const std::string& profile_name);
+//
+// The classpath acts as filter: only profiling data belonging to elements of the classpath
+// will end up in the snapshot.
+bool create_profile_snapshot(int32_t app_id,
+ const std::string& package,
+ const std::string& profile_name,
+ const std::string& classpath);
bool dump_profiles(int32_t uid,
const std::string& pkgname,