OSDN Git Service

ART: Make dex2oat timing a bit more granular
authorAndreas Gampe <agampe@google.com>
Wed, 16 Sep 2015 03:04:54 +0000 (20:04 -0700)
committerAndreas Gampe <agampe@google.com>
Wed, 16 Sep 2015 03:04:54 +0000 (20:04 -0700)
Add scoped timing for runtime creation and dex file opening. Allows
comparing (JIT) compile time to specific overhead inherent to all
compilations.

Bug: 24103765
Change-Id: I1f83daa7015745bffa0cec3a3357b045c8493d6a

dex2oat/dex2oat.cc

index f9520be..10ae1ca 100644 (file)
@@ -1258,8 +1258,11 @@ class Dex2Oat FINAL {
     // from getting a statically linked version of dex2oat (because of dlsym and RTLD_NEXT).
     runtime_options.push_back(std::make_pair("-Xno-sig-chain", nullptr));
 
-    if (!CreateRuntime(runtime_options)) {
-      return false;
+    {
+      TimingLogger::ScopedTiming t_runtime("Create runtime", timings_);
+      if (!CreateRuntime(runtime_options)) {
+        return false;
+      }
     }
 
     // Runtime::Create acquired the mutator_lock_ that is normally given away when we
@@ -1334,6 +1337,7 @@ class Dex2Oat FINAL {
     if (boot_image_option_.empty()) {
       dex_files_ = class_linker->GetBootClassPath();
     } else {
+      TimingLogger::ScopedTiming t_dex("Opening dex files", timings_);
       if (dex_filenames_.empty()) {
         ATRACE_BEGIN("Opening zip archive from file descriptor");
         std::string error_msg;