Add new --layout-profile compiler-filter for dex2oat.
New compiler filter makes dex2oat call into dexlayout.
Added basic test for --layout-profile filter to make sure dex2oat runs
to completion and file is valid. Contests of file are not checked.
Test: mm test-art-host-gtest-dexlayout_test
Bug: 29921113
Change-Id: I4bd0dea3d3f1284c155d1d9dea80a48062e67770
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 65703a2..e52e502 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -270,6 +270,7 @@
"|balanced"
"|speed-profile"
"|speed"
+ "|layout-profile"
"|everything-profile"
"|everything):");
UsageError(" select compiler filter.");
@@ -2273,7 +2274,9 @@
compiler_options_.get(),
oat_file.get()));
elf_writers_.back()->Start();
- oat_writers_.emplace_back(new OatWriter(IsBootImage(), timings_));
+ bool do_dexlayout = compiler_options_->GetCompilerFilter() == CompilerFilter::kLayoutProfile;
+ oat_writers_.emplace_back(new OatWriter(
+ IsBootImage(), timings_, do_dexlayout ? profile_compilation_info_.get() : nullptr));
}
}