diff options
author | 2019-05-02 11:04:13 -0700 | |
---|---|---|
committer | 2019-05-03 19:46:42 +0000 | |
commit | 765b2a04576f4e985a88165456f5ee55cdfe56b8 (patch) | |
tree | 1eb91d1e6dcdee31b5b396ee0ed8baf8c94aca96 | |
parent | 023533677989028d48f4e64dad0a5b3b4e59b726 (diff) |
Add -verbose:interpreter
Adds a mode to track what methods are being interpreted. Good
for debugging interpreter usage during app startup.
Bug: 130185360
Test: test-art-host
Change-Id: I8119f79e534cdad7d6a72d4f01115a288e9c8d9a
-rw-r--r-- | cmdline/cmdline_parser_test.cc | 3 | ||||
-rw-r--r-- | cmdline/cmdline_types.h | 2 | ||||
-rw-r--r-- | libartbase/base/logging.h | 1 | ||||
-rw-r--r-- | openjdkjvmti/OpenjdkJvmTi.cc | 1 | ||||
-rw-r--r-- | runtime/interpreter/interpreter.cc | 1 | ||||
-rw-r--r-- | runtime/interpreter/interpreter_common.h | 3 | ||||
-rw-r--r-- | runtime/parsed_options.cc | 1 | ||||
-rw-r--r-- | runtime/parsed_options_test.cc | 1 |
8 files changed, 12 insertions, 1 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index 101e5c42cd..052d9ecac4 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -257,7 +257,7 @@ TEST_F(CmdlineParserTest, TestSimpleFailures) { TEST_F(CmdlineParserTest, TestLogVerbosity) { { const char* log_args = "-verbose:" - "class,compiler,gc,heap,jdwp,jni,monitor,profiler,signals,simulator,startup," + "class,compiler,gc,heap,interpreter,jdwp,jni,monitor,profiler,signals,simulator,startup," "third-party-jni,threads,verifier,verifier-debug"; LogVerbosity log_verbosity = LogVerbosity(); @@ -265,6 +265,7 @@ TEST_F(CmdlineParserTest, TestLogVerbosity) { log_verbosity.compiler = true; log_verbosity.gc = true; log_verbosity.heap = true; + log_verbosity.interpreter = true; log_verbosity.jdwp = true; log_verbosity.jni = true; log_verbosity.monitor = true; diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h index a757c91089..a83a0dcd00 100644 --- a/cmdline/cmdline_types.h +++ b/cmdline/cmdline_types.h @@ -565,6 +565,8 @@ struct CmdlineType<LogVerbosity> : CmdlineTypeParser<LogVerbosity> { log_verbosity.gc = true; } else if (verbose_options[j] == "heap") { log_verbosity.heap = true; + } else if (verbose_options[j] == "interpreter") { + log_verbosity.interpreter = true; } else if (verbose_options[j] == "jdwp") { log_verbosity.jdwp = true; } else if (verbose_options[j] == "jit") { diff --git a/libartbase/base/logging.h b/libartbase/base/logging.h index 484db87b9a..68ad9fcfa3 100644 --- a/libartbase/base/logging.h +++ b/libartbase/base/logging.h @@ -38,6 +38,7 @@ struct LogVerbosity { bool deopt; bool gc; bool heap; + bool interpreter; // Enabled with "-verbose:interpreter". bool jdwp; bool jit; bool jni; diff --git a/openjdkjvmti/OpenjdkJvmTi.cc b/openjdkjvmti/OpenjdkJvmTi.cc index ffa1bd3faf..e889f9872c 100644 --- a/openjdkjvmti/OpenjdkJvmTi.cc +++ b/openjdkjvmti/OpenjdkJvmTi.cc @@ -1414,6 +1414,7 @@ class JvmtiFunctions { art::gLogVerbosity.compiler = val; art::gLogVerbosity.deopt = val; art::gLogVerbosity.heap = val; + art::gLogVerbosity.interpreter = val; art::gLogVerbosity.jdwp = val; art::gLogVerbosity.jit = val; art::gLogVerbosity.monitor = val; diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index db116f5a63..ce242a74c7 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -321,6 +321,7 @@ static inline JValue Execute( DCHECK(!method->SkipAccessChecks() || !method->MustCountLocks()); bool transaction_active = Runtime::Current()->IsActiveTransaction(); + VLOG(interpreter) << "Interpreting " << method->PrettyMethod(); if (LIKELY(method->SkipAccessChecks())) { // Enter the "without access check" interpreter. if (kInterpreterImplKind == kMterpImplKind) { diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index 6366035a4c..19da77dd3a 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -33,6 +33,7 @@ #include "art_method-inl.h" #include "base/enums.h" #include "base/locks.h" +#include "base/logging.h" #include "base/macros.h" #include "class_linker-inl.h" #include "class_root.h" @@ -278,6 +279,8 @@ static ALWAYS_INLINE bool DoInvoke(Thread* self, self->PushShadowFrame(new_shadow_frame); self->EndAssertNoThreadSuspension(old_cause); + VLOG(interpreter) << "Interpreting " << called_method->PrettyMethod(); + DCheckStaticState(self, called_method); while (true) { // Mterp does not support all instrumentation/debugging. diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index 346ae26754..2f8ee02f68 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -481,6 +481,7 @@ static void MaybeOverrideVerbosity() { // gLogVerbosity.deopt = true; // TODO: don't check this in! // gLogVerbosity.gc = true; // TODO: don't check this in! // gLogVerbosity.heap = true; // TODO: don't check this in! + // gLogVerbosity.interpreter = true; // TODO: don't check this in! // gLogVerbosity.jdwp = true; // TODO: don't check this in! // gLogVerbosity.jit = true; // TODO: don't check this in! // gLogVerbosity.jni = true; // TODO: don't check this in! diff --git a/runtime/parsed_options_test.cc b/runtime/parsed_options_test.cc index 75952bbc66..dd9ca23241 100644 --- a/runtime/parsed_options_test.cc +++ b/runtime/parsed_options_test.cc @@ -100,6 +100,7 @@ TEST_F(ParsedOptionsTest, ParsedOptions) { EXPECT_FALSE(VLOG_IS_ON(compiler)); EXPECT_FALSE(VLOG_IS_ON(heap)); EXPECT_TRUE(VLOG_IS_ON(gc)); + EXPECT_FALSE(VLOG_IS_ON(interpreter)); EXPECT_FALSE(VLOG_IS_ON(jdwp)); EXPECT_TRUE(VLOG_IS_ON(jni)); EXPECT_FALSE(VLOG_IS_ON(monitor)); |