diff options
| -rw-r--r-- | compiler/dex/frontend.cc | 16 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 4 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.h | 15 | ||||
| -rw-r--r-- | compiler/oat_test.cc | 3 | ||||
| -rw-r--r-- | dex2oat/dex2oat.cc | 22 | ||||
| -rw-r--r-- | runtime/common_test.h | 3 |
6 files changed, 13 insertions, 50 deletions
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc index 364a8bc55b..f5bb85a910 100644 --- a/compiler/dex/frontend.cc +++ b/compiler/dex/frontend.cc @@ -141,25 +141,24 @@ CompilationUnit::CompilationUnit(ArenaPool* pool) CompilationUnit::~CompilationUnit() { } +// TODO: Add a cumulative version of logging, and combine with dex2oat --dump-timing void CompilationUnit::StartTimingSplit(const char* label) { - if (compiler_driver->GetDumpPasses()) { + if (enable_debug & (1 << kDebugTimings)) { timings.StartSplit(label); } } void CompilationUnit::NewTimingSplit(const char* label) { - if (compiler_driver->GetDumpPasses()) { + if (enable_debug & (1 << kDebugTimings)) { timings.NewSplit(label); } } void CompilationUnit::EndTiming() { - if (compiler_driver->GetDumpPasses()) { + if (enable_debug & (1 << kDebugTimings)) { timings.EndSplit(); - if (enable_debug & (1 << kDebugTimings)) { - LOG(INFO) << "TIMINGS " << PrettyMethod(method_idx, *dex_file); - LOG(INFO) << Dumpable<TimingLogger>(timings); - } + LOG(INFO) << "TIMINGS " << PrettyMethod(method_idx, *dex_file); + LOG(INFO) << Dumpable<TimingLogger>(timings); } } @@ -317,9 +316,6 @@ static CompiledMethod* CompileMethod(CompilerDriver& compiler, } cu.EndTiming(); - compiler.GetTimingsLogger().Start(); - compiler.GetTimingsLogger().AddLogger(cu.timings); - compiler.GetTimingsLogger().End(); return result; } diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 714dc4cb5e..5edc8b6771 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -341,7 +341,7 @@ CompilerDriver::CompilerDriver(VerifiedMethodsData* verified_methods_data, CompilerBackend compiler_backend, InstructionSet instruction_set, InstructionSetFeatures instruction_set_features, bool image, DescriptorSet* image_classes, size_t thread_count, - bool dump_stats, bool dump_passes, CumulativeLogger* timer) + bool dump_stats) : verified_methods_data_(verified_methods_data), method_inliner_map_(method_inliner_map), compiler_backend_(compiler_backend), @@ -356,8 +356,6 @@ CompilerDriver::CompilerDriver(VerifiedMethodsData* verified_methods_data, start_ns_(0), stats_(new AOTCompilationStats), dump_stats_(dump_stats), - dump_passes_(dump_passes), - timings_logger_(timer), compiler_library_(NULL), compiler_(NULL), compiler_context_(NULL), diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index aabdf2f9f6..9e316242ba 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -22,7 +22,6 @@ #include <vector> #include "base/mutex.h" -#include "base/timing_logger.h" #include "class_reference.h" #include "compiled_class.h" #include "compiled_method.h" @@ -98,8 +97,7 @@ class CompilerDriver { CompilerBackend compiler_backend, InstructionSet instruction_set, InstructionSetFeatures instruction_set_features, bool image, DescriptorSet* image_classes, - size_t thread_count, bool dump_stats, bool dump_passes, - CumulativeLogger* timer); + size_t thread_count, bool dump_stats); ~CompilerDriver(); @@ -269,14 +267,6 @@ class CompilerDriver { return thread_count_; } - bool GetDumpPasses() const { - return dump_passes_; - } - - CumulativeLogger& GetTimingsLogger() const { - return *timings_logger_; - } - class PatchInformation { public: const DexFile& GetDexFile() const { @@ -446,9 +436,6 @@ class CompilerDriver { UniquePtr<AOTCompilationStats> stats_; bool dump_stats_; - const bool dump_passes_; - - CumulativeLogger* const timings_logger_; typedef void (*CompilerCallbackFn)(CompilerDriver& driver); typedef MutexLock* (*CompilerMutexLockFn)(CompilerDriver& driver); diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index 12d821239f..2434262279 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -82,11 +82,10 @@ TEST_F(OatTest, WriteRead) { verified_methods_data_.reset(new VerifiedMethodsData); method_inliner_map_.reset(compiler_backend == kQuick ? new DexFileToMethodInlinerMap : nullptr); callbacks_.Reset(verified_methods_data_.get(), method_inliner_map_.get()); - CumulativeLogger timer("Compilation times"); compiler_driver_.reset(new CompilerDriver(verified_methods_data_.get(), method_inliner_map_.get(), compiler_backend, insn_set, - insn_features, false, NULL, 2, true, true, &timer)); + insn_features, false, NULL, 2, true)); jobject class_loader = NULL; if (kCompile) { TimingLogger timings("OatTest::WriteRead", false, false); diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 20fafe2c27..26fac2370d 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -249,9 +249,7 @@ class Dex2Oat { bool image, UniquePtr<CompilerDriver::DescriptorSet>& image_classes, bool dump_stats, - bool dump_passes, - TimingLogger& timings, - CumulativeLogger& compiler_phases_timings) { + TimingLogger& timings) { // SirtRef and ClassLoader creation needs to come after Runtime::Create jobject class_loader = NULL; Thread* self = Thread::Current(); @@ -278,9 +276,7 @@ class Dex2Oat { image, image_classes.release(), thread_count_, - dump_stats, - dump_passes, - &compiler_phases_timings)); + dump_stats)); if (compiler_backend_ == kPortable) { driver->SetBitcodeFileName(bitcode_filename); @@ -654,7 +650,6 @@ 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); @@ -708,7 +703,6 @@ 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; @@ -802,8 +796,6 @@ 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 { @@ -1075,9 +1067,7 @@ static int dex2oat(int argc, char** argv) { image, image_classes, dump_stats, - dump_passes, - timings, - compiler_phases_timings)); + timings)); if (compiler.get() == NULL) { LOG(ERROR) << "Failed to create oat file: " << oat_location; @@ -1153,9 +1143,6 @@ 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; } @@ -1198,9 +1185,6 @@ 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. diff --git a/runtime/common_test.h b/runtime/common_test.h index a75a513ab8..ee95d5bbbd 100644 --- a/runtime/common_test.h +++ b/runtime/common_test.h @@ -474,13 +474,12 @@ class CommonTest : public testing::Test { } } class_linker_->FixupDexCaches(runtime_->GetResolutionMethod()); - CumulativeLogger timer("Compilation times"); compiler_driver_.reset(new CompilerDriver(verified_methods_data_.get(), method_inliner_map_.get(), compiler_backend, instruction_set, instruction_set_features, true, new CompilerDriver::DescriptorSet, - 2, true, true, &timer)); + 2, true)); } // We typically don't generate an image in unit tests, disable this optimization by default. compiler_driver_->SetSupportBootImageFixup(false); |