ART: Print and dump functionalities per pass
LOG is a great logging tool but sometimes a pass has some debugging text it
want to be able to turn on/off easily.
By going via a print_pass flag, we can actually turn it on/off easily per pass
when debugging/instrumenting.
- Added a pass printer to help debug messages for future passes.
- Added a print_pass flag in CompilationUnit to filter out messages.
At the same time, did a similar system for dumping the CFG.
- Also moved some API into public from protected.
Change-Id: Ie0e89a8fc773e8583f3e4ffd6e4bd2eebdbb2bf4
Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Signed-off-by: Yixin Shou <yixin.shou@intel.com>
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Signed-off-by: Udayan Banerji <udayan.banerji@intel.com>
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index f0b5750..6d05e5e 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -922,6 +922,20 @@
} else if (option.starts_with("--disable-passes=")) {
std::string disable_passes = option.substr(strlen("--disable-passes=")).data();
PassDriverME::CreateDefaultPassList(disable_passes);
+ } else if (option.starts_with("--print-passes=")) {
+ std::string print_passes = option.substr(strlen("--print-passes=")).data();
+ size_t len = print_passes.length() + 1;
+ char* duplicate = new char[len];
+ strncpy(duplicate, print_passes.c_str(), len);
+ PassDriverME::SetPrintPassList(duplicate);
+ } else if (option == "--print-all-passes") {
+ PassDriverME::SetPrintAllPasses();
+ } else if (option.starts_with("--dump-cfg-passes=")) {
+ std::string dump_passes = option.substr(strlen("--dump-cfg-passes=")).data();
+ size_t len = dump_passes.length() + 1;
+ char* duplicate = new char[len];
+ strncpy(duplicate, dump_passes.c_str(), len);
+ PassDriverME::SetDumpPassList(duplicate);
} else {
Usage("Unknown argument %s", option.data());
}