Loading fs_mgr/libsnapshot/android/snapshot/snapshot.proto +7 −1 Original line number Diff line number Diff line Loading @@ -162,7 +162,7 @@ message SnapshotUpdateStatus { MergePhase merge_phase = 6; } // Next: 7 // Next: 9 message SnapshotMergeReport { // Status of the update after the merge attempts. UpdateState state = 1; Loading @@ -182,4 +182,10 @@ message SnapshotMergeReport { // Sum of the estimated COW fields in the OTA manifest. uint64 estimated_cow_size_bytes = 6; // Time from boot to sys.boot_completed, in milliseconds. uint32 boot_complete_time_ms = 7; // Time from sys.boot_completed to merge start, in milliseconds. uint32 boot_complete_to_merge_start_time_ms = 8; } fs_mgr/libsnapshot/include/libsnapshot/snapshot_stats.h +8 −0 Original line number Diff line number Diff line Loading @@ -32,9 +32,13 @@ class ISnapshotMergeStats { virtual void set_cow_file_size(uint64_t cow_file_size) = 0; virtual void set_total_cow_size_bytes(uint64_t bytes) = 0; virtual void set_estimated_cow_size_bytes(uint64_t bytes) = 0; virtual void set_boot_complete_time_ms(uint32_t ms) = 0; virtual void set_boot_complete_to_merge_start_time_ms(uint32_t ms) = 0; virtual uint64_t cow_file_size() = 0; virtual uint64_t total_cow_size_bytes() = 0; virtual uint64_t estimated_cow_size_bytes() = 0; virtual uint32_t boot_complete_time_ms() = 0; virtual uint32_t boot_complete_to_merge_start_time_ms() = 0; // Called when merge ends. Properly clean up permanent storage. class Result { Loading Loading @@ -62,6 +66,10 @@ class SnapshotMergeStats : public ISnapshotMergeStats { void set_estimated_cow_size_bytes(uint64_t bytes) override; uint64_t total_cow_size_bytes() override; uint64_t estimated_cow_size_bytes() override; void set_boot_complete_time_ms(uint32_t ms) override; uint32_t boot_complete_time_ms() override; void set_boot_complete_to_merge_start_time_ms(uint32_t ms) override; uint32_t boot_complete_to_merge_start_time_ms() override; std::unique_ptr<Result> Finish() override; private: Loading fs_mgr/libsnapshot/snapshot_stats.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,22 @@ uint64_t SnapshotMergeStats::estimated_cow_size_bytes() { return report_.estimated_cow_size_bytes(); } void SnapshotMergeStats::set_boot_complete_time_ms(uint32_t ms) { report_.set_boot_complete_time_ms(ms); } uint32_t SnapshotMergeStats::boot_complete_time_ms() { return report_.boot_complete_time_ms(); } void SnapshotMergeStats::set_boot_complete_to_merge_start_time_ms(uint32_t ms) { report_.set_boot_complete_to_merge_start_time_ms(ms); } uint32_t SnapshotMergeStats::boot_complete_to_merge_start_time_ms() { return report_.boot_complete_to_merge_start_time_ms(); } class SnapshotMergeStatsResultImpl : public SnapshotMergeStats::Result { public: SnapshotMergeStatsResultImpl(const SnapshotMergeReport& report, Loading fs_mgr/libsnapshot/snapshot_stub.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,10 @@ class SnapshotMergeStatsStub : public ISnapshotMergeStats { void set_estimated_cow_size_bytes(uint64_t) override {} uint64_t total_cow_size_bytes() override { return 0; } uint64_t estimated_cow_size_bytes() override { return 0; } void set_boot_complete_time_ms(uint32_t) override {} uint32_t boot_complete_time_ms() override { return 0; } void set_boot_complete_to_merge_start_time_ms(uint32_t) override {} uint32_t boot_complete_to_merge_start_time_ms() override { return 0; } }; ISnapshotMergeStats* SnapshotManagerStub::GetSnapshotMergeStatsInstance() { Loading Loading
fs_mgr/libsnapshot/android/snapshot/snapshot.proto +7 −1 Original line number Diff line number Diff line Loading @@ -162,7 +162,7 @@ message SnapshotUpdateStatus { MergePhase merge_phase = 6; } // Next: 7 // Next: 9 message SnapshotMergeReport { // Status of the update after the merge attempts. UpdateState state = 1; Loading @@ -182,4 +182,10 @@ message SnapshotMergeReport { // Sum of the estimated COW fields in the OTA manifest. uint64 estimated_cow_size_bytes = 6; // Time from boot to sys.boot_completed, in milliseconds. uint32 boot_complete_time_ms = 7; // Time from sys.boot_completed to merge start, in milliseconds. uint32 boot_complete_to_merge_start_time_ms = 8; }
fs_mgr/libsnapshot/include/libsnapshot/snapshot_stats.h +8 −0 Original line number Diff line number Diff line Loading @@ -32,9 +32,13 @@ class ISnapshotMergeStats { virtual void set_cow_file_size(uint64_t cow_file_size) = 0; virtual void set_total_cow_size_bytes(uint64_t bytes) = 0; virtual void set_estimated_cow_size_bytes(uint64_t bytes) = 0; virtual void set_boot_complete_time_ms(uint32_t ms) = 0; virtual void set_boot_complete_to_merge_start_time_ms(uint32_t ms) = 0; virtual uint64_t cow_file_size() = 0; virtual uint64_t total_cow_size_bytes() = 0; virtual uint64_t estimated_cow_size_bytes() = 0; virtual uint32_t boot_complete_time_ms() = 0; virtual uint32_t boot_complete_to_merge_start_time_ms() = 0; // Called when merge ends. Properly clean up permanent storage. class Result { Loading Loading @@ -62,6 +66,10 @@ class SnapshotMergeStats : public ISnapshotMergeStats { void set_estimated_cow_size_bytes(uint64_t bytes) override; uint64_t total_cow_size_bytes() override; uint64_t estimated_cow_size_bytes() override; void set_boot_complete_time_ms(uint32_t ms) override; uint32_t boot_complete_time_ms() override; void set_boot_complete_to_merge_start_time_ms(uint32_t ms) override; uint32_t boot_complete_to_merge_start_time_ms() override; std::unique_ptr<Result> Finish() override; private: Loading
fs_mgr/libsnapshot/snapshot_stats.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,22 @@ uint64_t SnapshotMergeStats::estimated_cow_size_bytes() { return report_.estimated_cow_size_bytes(); } void SnapshotMergeStats::set_boot_complete_time_ms(uint32_t ms) { report_.set_boot_complete_time_ms(ms); } uint32_t SnapshotMergeStats::boot_complete_time_ms() { return report_.boot_complete_time_ms(); } void SnapshotMergeStats::set_boot_complete_to_merge_start_time_ms(uint32_t ms) { report_.set_boot_complete_to_merge_start_time_ms(ms); } uint32_t SnapshotMergeStats::boot_complete_to_merge_start_time_ms() { return report_.boot_complete_to_merge_start_time_ms(); } class SnapshotMergeStatsResultImpl : public SnapshotMergeStats::Result { public: SnapshotMergeStatsResultImpl(const SnapshotMergeReport& report, Loading
fs_mgr/libsnapshot/snapshot_stub.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,10 @@ class SnapshotMergeStatsStub : public ISnapshotMergeStats { void set_estimated_cow_size_bytes(uint64_t) override {} uint64_t total_cow_size_bytes() override { return 0; } uint64_t estimated_cow_size_bytes() override { return 0; } void set_boot_complete_time_ms(uint32_t) override {} uint32_t boot_complete_time_ms() override { return 0; } void set_boot_complete_to_merge_start_time_ms(uint32_t) override {} uint32_t boot_complete_to_merge_start_time_ms() override { return 0; } }; ISnapshotMergeStats* SnapshotManagerStub::GetSnapshotMergeStatsInstance() { Loading