summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2021-08-02 03:44:44 -0700
committerLinux Build Service Account <lnxbuild@localhost>2021-08-02 03:44:44 -0700
commitaaad8cbc25917013b728a7f60f6283dd274c5f73 (patch)
tree772e9b251dde5231a6f48300cca8b712a51264c5
parent0fd47fca5a505f1237854aaa468b11b17a969479 (diff)
parent6fd8fc1f60c58ac9d2639bd4cacb69afc168de62 (diff)
Merge 6fd8fc1f60c58ac9d2639bd4cacb69afc168de62 on remote branch
Change-Id: I2f1205dbb67470cbdf28b54c540cbc721f6f0aaa
-rw-r--r--aosp/cleanup_previous_update_action.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/aosp/cleanup_previous_update_action.cc b/aosp/cleanup_previous_update_action.cc
index dde6b89a..53cb9933 100644
--- a/aosp/cleanup_previous_update_action.cc
+++ b/aosp/cleanup_previous_update_action.cc
@@ -409,6 +409,14 @@ void CleanupPreviousUpdateAction::InitiateMergeAndWait() {
merge_stats_->set_boot_complete_to_merge_start_time_ms(
merge_start_time.count() - merge_stats_->boot_complete_time_ms());
+ auto source_build_fingerprint = snapshot_->ReadSourceBuildFingerprint();
+ merge_stats_->set_source_build_fingerprint(source_build_fingerprint);
+
+ if (!merge_stats_->WriteState()) {
+ LOG(ERROR) << "Failed to write merge stats; record may be unreliable if "
+ "merge is interrupted.";
+ }
+
if (snapshot_->InitiateMerge()) {
WaitForMergeOrSchedule();
return;
@@ -477,6 +485,9 @@ void CleanupPreviousUpdateAction::ReportMergeStats() {
// However, we have saved the flag in the snapshot report.
bool vab_compression_used = report.compression_enabled();
+ auto target_build_fingerprint =
+ android::base::GetProperty("ro.build.fingerprint", "");
+
LOG(INFO) << "Reporting merge stats: "
<< android::snapshot::UpdateState_Name(report.state()) << " in "
<< passed_ms.count() << "ms (resumed " << report.resume_count()
@@ -494,7 +505,9 @@ void CleanupPreviousUpdateAction::ReportMergeStats() {
report.estimated_cow_size_bytes(),
report.boot_complete_time_ms(),
report.boot_complete_to_merge_start_time_ms(),
- static_cast<int32_t>(report.merge_failure_code()));
+ static_cast<int32_t>(report.merge_failure_code()),
+ report.source_build_fingerprint().c_str(),
+ target_build_fingerprint.c_str());
#endif
}