OSDN Git Service

Generate SHA-1 build ID for host-generated *.oat files (2/2).
authorAlexey Alexandrov <aalexand@google.com>
Mon, 19 Sep 2016 17:54:21 +0000 (10:54 -0700)
committerAlexey Alexandrov <aalexand@google.com>
Thu, 6 Oct 2016 02:20:36 +0000 (19:20 -0700)
For host-generated *.oat files, generate a SHA-1 build ID based on the
file content and write it to .note.gnu.build-id ELF section.  This
should allow various developer tools like profilers correlate the data
captured for files like boot.oat on the device with the corresponding
known version of the file during an offline analysis.

Test: Verified that boot.oat contains the build ID section now.
Test: make test-art-host
Bug: 31292208
Change-Id: Iee48e437009488f20995e73868d5059d349701c0

core/dex_preopt_libart.mk
core/dex_preopt_libart_boot.mk

index ab54b1d..7a0fb95 100644 (file)
@@ -104,7 +104,8 @@ $(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) \
        --instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \
        --instruction-set-variant=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) \
        --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \
-       --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info \
+       --include-patch-information --runtime-arg -Xnorelocate \
+       --no-generate-debug-info --generate-build-id \
        --abort-on-hard-verifier-error \
        --no-inline-from=core-oj.jar \
        $(PRIVATE_DEX_PREOPT_FLAGS) \
index 1a0dc5b..9f27db7 100644 (file)
@@ -71,6 +71,7 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE
                --instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \
                --instruction-set-variant=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) \
                --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \
-               --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info \
+               --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate \
+               --no-generate-debug-info --generate-build-id \
                --multi-image --no-inline-from=core-oj.jar \
                $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(GLOBAL_DEXPREOPT_FLAGS) $(COMPILED_CLASSES_FLAGS) $(ART_BOOT_IMAGE_EXTRA_ARGS)