compiler_kind, instruction_set,
instruction_set_features_.get(),
true, new std::set<std::string>, nullptr,
- 2, true, true, timer_.get(), -1, ""));
+ 2, true, true, "", timer_.get(), -1, ""));
}
// We typically don't generate an image in unit tests, disable this optimization by default.
compiler_driver_->SetSupportBootImageFixup(false);
const InstructionSetFeatures* instruction_set_features,
bool image, std::set<std::string>* image_classes,
std::set<std::string>* compiled_classes, size_t thread_count,
- bool dump_stats, bool dump_passes, CumulativeLogger* timer,
+ bool dump_stats, bool dump_passes,
+ const std::string& dump_cfg_file_name, CumulativeLogger* timer,
int swap_fd, const std::string& profile_file)
: swap_space_(swap_fd == -1 ? nullptr : new SwapSpace(swap_fd, 10 * MB)),
swap_space_allocator_(new SwapAllocator<void>(swap_space_.get())),
stats_(new AOTCompilationStats),
dump_stats_(dump_stats),
dump_passes_(dump_passes),
+ dump_cfg_file_name_(dump_cfg_file_name),
timings_logger_(timer),
compiler_context_(nullptr),
support_boot_image_fixup_(instruction_set != kMips),
bool image, std::set<std::string>* image_classes,
std::set<std::string>* compiled_classes,
size_t thread_count, bool dump_stats, bool dump_passes,
+ const std::string& dump_cfg_file_name,
CumulativeLogger* timer, int swap_fd,
const std::string& profile_file);
return dump_passes_;
}
+ const std::string& GetDumpCfgFileName() const {
+ return dump_cfg_file_name_;
+ }
+
CumulativeLogger* GetTimingsLogger() const {
return timings_logger_;
}
bool dump_stats_;
const bool dump_passes_;
+ const std::string& dump_cfg_file_name_;
CumulativeLogger* const timings_logger_;
method_inliner_map_.get(),
compiler_kind, insn_set,
insn_features.get(), false, nullptr, nullptr, 2, true,
- true, timer_.get(), -1, ""));
+ true, "", timer_.get(), -1, ""));
jobject class_loader = nullptr;
if (kCompile) {
TimingLogger timings2("OatTest::WriteRead", false, false);
// Enable C1visualizer output. Must be done in Init() because the compiler
// driver is not fully initialized when passed to the compiler's constructor.
CompilerDriver* driver = GetCompilerDriver();
- if (driver->GetDumpPasses()) {
+ const std::string cfg_file_name = driver->GetDumpCfgFileName();
+ if (!cfg_file_name.empty()) {
CHECK_EQ(driver->GetThreadCount(), 1U)
<< "Graph visualizer requires the compiler to run single-threaded. "
<< "Invoke the compiler with '-j1'.";
- visualizer_output_.reset(new std::ofstream("art.cfg"));
+ visualizer_output_.reset(new std::ofstream(cfg_file_name));
}
}
dump_timing_ = true;
} else if (option == "--dump-passes") {
dump_passes_ = true;
+ } else if (option.starts_with("--dump-cfg=")) {
+ dump_cfg_file_name_ = option.substr(strlen("--dump-cfg=")).data();
} else if (option == "--dump-stats") {
dump_stats_ = true;
} else if (option == "--include-debug-symbols" || option == "--no-strip-symbols") {
thread_count_,
dump_stats_,
dump_passes_,
+ dump_cfg_file_name_,
compiler_phases_timings_.get(),
swap_fd_,
profile_file_));
bool dump_passes_;
bool dump_timing_;
bool dump_slow_timing_;
+ std::string dump_cfg_file_name_;
std::string swap_file_name_;
int swap_fd_;
std::string profile_file_; // Profile file to use
classFolder = tempFolder + "/classes"
dexFile = tempFolder + "/test.dex"
oatFile = tempFolder + "/test.oat"
- outputFile = tempFolder + "/art.cfg"
+ outputFile = tempFolder + "/test.cfg"
os.makedirs(classFolder)
# Build a DEX from the source file. We pass "--no-optimize" to dx to avoid
# Run dex2oat and export the HGraph. The output is stored into ${PWD}/art.cfg.
with cd(tempFolder):
- check_call(["dex2oat", "-j1", "--dump-passes", "--compiler-backend=Optimizing",
+ check_call(["dex2oat", "-j1", "--dump-cfg=" + outputFile, "--compiler-backend=Optimizing",
"--android-root=" + os.environ["ANDROID_HOST_OUT"],
"--boot-image=" + os.environ["ANDROID_HOST_OUT"] + "/framework/core-optimizing.art",
"--runtime-arg", "-Xnorelocate", "--dex-file=" + dexFile, "--oat-file=" + oatFile])