OSDN Git Service

otapreopt: Collect and print size of artifacts
authorAndreas Gampe <agampe@google.com>
Sat, 13 Aug 2016 02:35:57 +0000 (19:35 -0700)
committerAndreas Gampe <agampe@google.com>
Sat, 13 Aug 2016 02:35:57 +0000 (19:35 -0700)
Collect and print the size of artifacts when moving after a reboot.
This helps in diagnosing issues after the fact.

Bug: 30832951
Change-Id: Iee410adf59dcbb74fa4b49edb27d028025cd8bf9

cmds/installd/otapreopt_slot.sh

index d51ab70..b5786e9 100644 (file)
@@ -22,10 +22,13 @@ SLOT_SUFFIX=$(getprop ro.boot.slot_suffix)
 if test -n "$SLOT_SUFFIX" ; then
   if test -d /data/ota/$SLOT_SUFFIX/dalvik-cache ; then
     log -p i -t otapreopt_slot "Moving A/B artifacts for slot ${SLOT_SUFFIX}."
+    OLD_SIZE=$(du -h -s /data/dalvik-cache)
     rm -rf /data/dalvik-cache/*
+    NEW_SIZE=$(du -h -s /data/ota/$SLOT_SUFFIX/dalvik-cache)
     mv /data/ota/$SLOT_SUFFIX/dalvik-cache/* /data/dalvik-cache/
     rmdir /data/ota/$SLOT_SUFFIX/dalvik-cache
     rmdir /data/ota/$SLOT_SUFFIX
+    log -p i -t otapreopt_slot "Moved ${NEW_SIZE} over ${OLD_SIZE}"
   else
     log -p i -t otapreopt_slot "No A/B artifacts found for slot ${SLOT_SUFFIX}."
   fi