summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Balsini <balsini@google.com>2020-05-26 22:17:03 +0100
committerAlessio Balsini <balsini@google.com>2020-05-29 20:14:06 +0100
commit4ed0512acc3a2f854256abac1a856aed705642d3 (patch)
tree32c83eb299bda04901d1a637e3748205f76d8394
parent46aa61ec5917fc5339fce61e21dd4a0980eb63ef (diff)
Report retrofit and COW image size
Add is_vab_retrofit (that tells if the device upgraded to Virtual A/B or was natively supporting the feature) and cow_file_size_bytes (the total size of the space allocated in /data for the dm-snapshot COW images). Bug: 154016862 Test: Manual OTA Signed-off-by: Alessio Balsini <balsini@google.com> Change-Id: I529028bc208b7dd12df0bc28974f65b821d14cd9
-rw-r--r--cleanup_previous_update_action.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/cleanup_previous_update_action.cc b/cleanup_previous_update_action.cc
index e43730d3..88dbc57e 100644
--- a/cleanup_previous_update_action.cc
+++ b/cleanup_previous_update_action.cc
@@ -343,7 +343,9 @@ void CleanupPreviousUpdateAction::InitiateMergeAndWait() {
return;
}
- if (snapshot_->InitiateMerge()) {
+ uint64_t cow_file_size;
+ if (snapshot_->InitiateMerge(&cow_file_size)) {
+ merge_stats_->set_cow_file_size(cow_file_size);
WaitForMergeOrSchedule();
return;
}
@@ -399,14 +401,22 @@ void CleanupPreviousUpdateAction::ReportMergeStats() {
auto passed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
result->merge_time());
+
+ bool vab_retrofit = boot_control_->GetDynamicPartitionControl()
+ ->GetVirtualAbFeatureFlag()
+ .IsRetrofit();
+
LOG(INFO) << "Reporting merge stats: "
<< android::snapshot::UpdateState_Name(report.state()) << " in "
<< passed_ms.count() << "ms (resumed " << report.resume_count()
- << " times)";
+ << " times), using " << report.cow_file_size()
+ << " bytes of COW image.";
android::util::stats_write(android::util::SNAPSHOT_MERGE_REPORTED,
static_cast<int32_t>(report.state()),
static_cast<int64_t>(passed_ms.count()),
- static_cast<int32_t>(report.resume_count()));
+ static_cast<int32_t>(report.resume_count()),
+ vab_retrofit,
+ static_cast<int64_t>(report.cow_file_size()));
#endif
}