summaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-05-13 21:13:15 +0200
committerTianjie Xu <xunchang@google.com>2016-05-16 23:54:37 +0200
commitdd874b1c87eb04f28db0db2629df0adde568a74c (patch)
tree9d62a7c64f5e383021178dfefaad5163d2decf26 /updater
parentMake text for recovery larger on angler (diff)
downloadandroid_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.tar
android_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.tar.gz
android_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.tar.bz2
android_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.tar.lz
android_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.tar.xz
android_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.tar.zst
android_bootable_recovery-dd874b1c87eb04f28db0db2629df0adde568a74c.zip
Diffstat (limited to '')
-rw-r--r--updater/blockimg.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index c20bad904..d67af664a 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -373,6 +373,7 @@ struct CommandParameters {
bool isunresumable;
int version;
size_t written;
+ size_t stashed;
NewThreadInfo nti;
pthread_t thread;
std::vector<uint8_t> buffer;
@@ -777,6 +778,7 @@ static int SaveStash(CommandParameters& params, const std::string& base,
}
fprintf(stderr, "stashing %zu blocks to %s\n", blocks, id.c_str());
+ params.stashed += blocks;
return WriteStash(base, id, blocks, buffer, false, nullptr);
}
@@ -973,6 +975,7 @@ static int LoadSrcTgtVersion3(CommandParameters& params, RangeSet& tgt, size_t&
return -1;
}
+ params.stashed += src_blocks;
// Can be deleted when the write has completed
if (!stash_exists) {
params.freestash = srchash;
@@ -1517,8 +1520,17 @@ static Value* PerformBlockImageUpdate(const char* name, State* state, int /* arg
pthread_join(params.thread, nullptr);
fprintf(stderr, "wrote %zu blocks; expected %d\n", params.written, total_blocks);
+ fprintf(stderr, "stashed %zu blocks\n", params.stashed);
fprintf(stderr, "max alloc needed was %zu\n", params.buffer.size());
+ const char* partition = strrchr(blockdev_filename->data, '/');
+ if (partition != nullptr && *(partition+1) != 0) {
+ fprintf(cmd_pipe, "log bytes_written_%s: %zu\n", partition + 1,
+ params.written * BLOCKSIZE);
+ fprintf(cmd_pipe, "log bytes_stashed_%s: %zu\n", partition + 1,
+ params.stashed * BLOCKSIZE);
+ fflush(cmd_pipe);
+ }
// Delete stash only after successfully completing the update, as it
// may contain blocks needed to complete the update later.
DeleteStash(params.stashbase);