diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-03-09 15:38:54 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-03-09 15:42:44 -0700 |
commit | a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66 (patch) | |
tree | 6afaa296fc2f6c4c7c1ce35a3d36ef911096764c /runtime/jit/jit.h | |
parent | 54a8cc689dc23f346c9aac0d5fc6f47e61df8cad (diff) | |
download | android_art-a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66.tar.gz android_art-a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66.tar.bz2 android_art-a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66.zip |
Add way to print JIT related info at shutdown
Added a runtime option called -XX:DumpJITInfoOnShutdown with prints
various interesting JIT statistics during the shutdown of the runtime
if enabled.
Example of running EvaluateAndApplyChanges with the option:
I art : Code cache size=427KB data cache size=84KB num methods=1598
I art : Start Dumping histograms for 1598 iterations for JIT timings
I art : Compiling: Sum: 727.850ms 99% C.I. 135us-4402us Avg: 455.475us Max: 15567us
I art : Verifying: Sum: 191.074ms 99% C.I. 19us-1450.500us Avg: 119.570us Max: 5142us
I art : TrimMaps: Sum: 62.053ms 99% C.I. 13us-199.374us Avg: 38.831us Max: 10058us
I art : MakeExecutable: Sum: 11.153ms 99% C.I. 4us-47us Avg: 6.979us Max: 47us
I art : Initializing: Sum: 7.991ms 99% C.I. 1us-49.781us Avg: 5us Max: 4852us
I art : Done Dumping histograms
Bug: 17950037
Change-Id: I23538b24f947e5f6934f55579b8baa9d806eb3d5
Diffstat (limited to 'runtime/jit/jit.h')
-rw-r--r-- | runtime/jit/jit.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/runtime/jit/jit.h b/runtime/jit/jit.h index b80015feca..6b206d15b8 100644 --- a/runtime/jit/jit.h +++ b/runtime/jit/jit.h @@ -24,6 +24,7 @@ #include "atomic.h" #include "base/macros.h" #include "base/mutex.h" +#include "base/timing_logger.h" #include "gc_root.h" #include "jni.h" #include "object_callbacks.h" @@ -61,6 +62,11 @@ class Jit { return code_cache_.get(); } void DeleteThreadPool(); + // Dump interesting info: #methods compiled, code vs data size, compile / verify cumulative + // loggers. + void DumpInfo(std::ostream& os); + // Add a timing logger to cumulative_timings_. + void AddTimingLogger(const TimingLogger& logger); private: Jit(); @@ -73,6 +79,10 @@ class Jit { void (*jit_unload_)(void*); bool (*jit_compile_method_)(void*, mirror::ArtMethod*, Thread*); + // Performance monitoring. + bool dump_info_on_shutdown_; + CumulativeLogger cumulative_timings_; + std::unique_ptr<jit::JitInstrumentationCache> instrumentation_cache_; std::unique_ptr<jit::JitCodeCache> code_cache_; CompilerCallbacks* compiler_callbacks_; // Owned by the jit compiler. @@ -87,12 +97,16 @@ class JitOptions { size_t GetCodeCacheCapacity() const { return code_cache_capacity_; } + bool DumpJitInfoOnShutdown() const { + return dump_info_on_shutdown_; + } private: size_t code_cache_capacity_; size_t compile_threshold_; + bool dump_info_on_shutdown_; - JitOptions() : code_cache_capacity_(0), compile_threshold_(0) { + JitOptions() : code_cache_capacity_(0), compile_threshold_(0), dump_info_on_shutdown_(false) { } }; |