summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mingyao Yang <mingyao@google.com> 2014-04-21 21:50:49 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-04-21 21:50:51 +0000
commit63da330fa097aedc97e40ded054106a7168ea116 (patch)
treeb400542ce3b92a255320219225fcfe108528162f
parentb0618ae005f2ae5bbdd5bcf4279ede2deb6d62ef (diff)
parent42d65c52bbf4a354605389a759190e793787f692 (diff)
Merge "Add an option to specify a list of methods for LIR dumping."
-rw-r--r--compiler/dex/frontend.cc11
-rw-r--r--runtime/base/logging.cc2
-rw-r--r--runtime/base/logging.h3
-rw-r--r--runtime/parsed_options.cc3
4 files changed, 19 insertions, 0 deletions
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index 1bf5fce989..ed2ecace36 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -181,6 +181,17 @@ static CompiledMethod* CompileMethod(CompilerDriver& driver,
(cu.enable_debug & (1 << kDebugVerbose));
}
+ if (gVerboseMethods.size() != 0) {
+ cu.verbose = false;
+ for (size_t i = 0; i < gVerboseMethods.size(); ++i) {
+ if (PrettyMethod(method_idx, dex_file).find(gVerboseMethods[i])
+ != std::string::npos) {
+ cu.verbose = true;
+ break;
+ }
+ }
+ }
+
/*
* TODO: rework handling of optimization and debug flags. Should we split out
* MIR and backend flags? Need command-line setting as well.
diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc
index 46b8ff28fe..730a2c2cb4 100644
--- a/runtime/base/logging.cc
+++ b/runtime/base/logging.cc
@@ -26,6 +26,8 @@ namespace art {
LogVerbosity gLogVerbosity;
+std::vector<std::string> gVerboseMethods;
+
unsigned int gAborting = 0;
static LogSeverity gMinimumLogSeverity = INFO;
diff --git a/runtime/base/logging.h b/runtime/base/logging.h
index fcec733868..bd5ae85f5c 100644
--- a/runtime/base/logging.h
+++ b/runtime/base/logging.h
@@ -22,6 +22,7 @@
#include <iostream> // NOLINT
#include <sstream>
#include <signal.h>
+#include <vector>
#include "base/macros.h"
#include "log_severity.h"
#include "UniquePtr.h"
@@ -299,6 +300,8 @@ struct LogVerbosity {
extern LogVerbosity gLogVerbosity;
+extern std::vector<std::string> gVerboseMethods;
+
// Used on fatal exit. Prevents recursive aborts. Allows us to disable
// some error checking to ensure fatal shutdown makes forward progress.
extern unsigned int gAborting;
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index d4e64b86e5..084e8f6a0e 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -447,6 +447,9 @@ bool ParsedOptions::Parse(const Runtime::Options& options, bool ignore_unrecogni
return false;
}
}
+ } else if (StartsWith(option, "-verbose-methods:")) {
+ gLogVerbosity.compiler = false;
+ Split(option.substr(strlen("-verbose-methods:")), ',', gVerboseMethods);
} else if (StartsWith(option, "-Xlockprofthreshold:")) {
if (!ParseUnsignedInteger(option, ':', &lock_profiling_threshold_)) {
return false;