diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-02-11 10:35:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-02-11 10:35:36 +0000 |
commit | abaf927f29f6feceb3df3e6ced7d01970ba0dbe9 (patch) | |
tree | 245cb514e070eea6fd48dba6d1e5d85fcd9146c5 /dex2oat | |
parent | 9e36e4c3abdc5f101a2ce2beb3681a941f9d4be5 (diff) | |
parent | ea3fa0b4ba13d7bd7f7c1cd85202ccbe141a35ae (diff) | |
download | art-abaf927f29f6feceb3df3e6ced7d01970ba0dbe9.zip art-abaf927f29f6feceb3df3e6ced7d01970ba0dbe9.tar.gz art-abaf927f29f6feceb3df3e6ced7d01970ba0dbe9.tar.bz2 |
Merge "Re-apply: Implement cumulative timings for CompilerDriver."
Diffstat (limited to 'dex2oat')
-rw-r--r-- | dex2oat/dex2oat.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 90eea5e..98c64aa 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -253,7 +253,9 @@ class Dex2Oat { bool image, UniquePtr<CompilerDriver::DescriptorSet>& image_classes, bool dump_stats, - TimingLogger& timings) { + bool dump_passes, + TimingLogger& timings, + CumulativeLogger& compiler_phases_timings) { // SirtRef and ClassLoader creation needs to come after Runtime::Create jobject class_loader = NULL; Thread* self = Thread::Current(); @@ -280,7 +282,9 @@ class Dex2Oat { image, image_classes.release(), thread_count_, - dump_stats)); + dump_stats, + dump_passes, + &compiler_phases_timings)); if (compiler_backend_ == kPortable) { driver->SetBitcodeFileName(bitcode_filename); @@ -654,6 +658,7 @@ static InstructionSetFeatures ParseFeatureList(std::string str) { static int dex2oat(int argc, char** argv) { TimingLogger timings("compiler", false, false); + CumulativeLogger compiler_phases_timings("compilation times"); InitLogging(argv); @@ -703,6 +708,7 @@ static int dex2oat(int argc, char** argv) { bool is_host = false; bool dump_stats = false; bool dump_timing = false; + bool dump_passes = false; bool dump_slow_timing = kIsDebugBuild; bool watch_dog_enabled = !kIsTargetBuild; @@ -798,6 +804,8 @@ static int dex2oat(int argc, char** argv) { runtime_args.push_back(argv[i]); } else if (option == "--dump-timing") { dump_timing = true; + } else if (option == "--dump-passes") { + dump_passes = true; } else if (option == "--dump-stats") { dump_stats = true; } else { @@ -1069,7 +1077,9 @@ static int dex2oat(int argc, char** argv) { image, image_classes, dump_stats, - timings)); + dump_passes, + timings, + compiler_phases_timings)); if (compiler.get() == NULL) { LOG(ERROR) << "Failed to create oat file: " << oat_location; @@ -1145,6 +1155,9 @@ static int dex2oat(int argc, char** argv) { if (dump_timing || (dump_slow_timing && timings.GetTotalNs() > MsToNs(1000))) { LOG(INFO) << Dumpable<TimingLogger>(timings); } + if (dump_passes) { + LOG(INFO) << Dumpable<CumulativeLogger>(compiler.get()->GetTimingsLogger()); + } return EXIT_SUCCESS; } @@ -1187,6 +1200,9 @@ static int dex2oat(int argc, char** argv) { if (dump_timing || (dump_slow_timing && timings.GetTotalNs() > MsToNs(1000))) { LOG(INFO) << Dumpable<TimingLogger>(timings); } + if (dump_passes) { + LOG(INFO) << Dumpable<CumulativeLogger>(compiler_phases_timings); + } // Everything was successfully written, do an explicit exit here to avoid running Runtime // destructors that take time (bug 10645725) unless we're a debug build or running on valgrind. |