diff options
author | 2020-09-30 11:42:34 -0700 | |
---|---|---|
committer | 2020-10-12 18:12:00 +0000 | |
commit | 4bb09001683e00a9d0d34f685f2ec60004c0c1ef (patch) | |
tree | 283e8c3c77c34a13b020275b031148cd46f1de9b /compiler/jit/jit_compiler.cc | |
parent | ae7168e19f886ed43ed200f9b0e769613df485f9 (diff) |
[metrics] Implement JitMethodCompileTime histogram
JitMethodCompileTime keeps track of how long methods take to compile in
JIT mode.
Test: m test-art-host-gtest-art_libartbase_tests
Bug: 170149255
Change-Id: Ic0e5f365d9e7eb7bc0ebcf49d23972adcd6dfb36
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
-rw-r--r-- | compiler/jit/jit_compiler.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index b254c57fa6..10aa306647 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -188,14 +188,12 @@ bool JitCompiler::CompileMethod( : "Compiling baseline", &logger); JitCodeCache* const code_cache = runtime->GetJit()->GetCodeCache(); - uint64_t start_ns = NanoTime(); + metrics::AutoTimer timer{runtime->GetMetrics()->JitMethodCompileTime()}; success = compiler_->JitCompile( self, code_cache, region, method, compilation_kind, jit_logger_.get()); - uint64_t duration_ns = NanoTime() - start_ns; - VLOG(jit) << "Compilation of " - << method->PrettyMethod() - << " took " - << PrettyDuration(duration_ns); + uint64_t duration_us = timer.Stop(); + VLOG(jit) << "Compilation of " << method->PrettyMethod() << " took " + << PrettyDuration(UsToNs(duration_us)); } // Trim maps to reduce memory usage. |