From aee2156e308f3f346ac4df76ba1d33ee9b11be84 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 15 Dec 2015 16:39:44 +0000 Subject: Add some dumping when SIGQUIT for the JIT. Change-Id: Iad68bdc8a4ab53e810feb3bc8507b7f42e79b1f7 --- runtime/jit/jit.cc | 8 ++++---- runtime/jit/jit.h | 4 ++++ runtime/jit/jit_code_cache.h | 5 +++++ runtime/runtime.cc | 5 +++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc index a653440b5f..4b39c03e0c 100644 --- a/runtime/jit/jit.cc +++ b/runtime/jit/jit.cc @@ -52,10 +52,10 @@ JitOptions* JitOptions::CreateFromRuntimeArguments(const RuntimeArgumentMap& opt } void Jit::DumpInfo(std::ostream& os) { - os << "Code cache size=" << PrettySize(code_cache_->CodeCacheSize()) - << " data cache size=" << PrettySize(code_cache_->DataCacheSize()) - << " number of compiled code=" << code_cache_->NumberOfCompiledCode() - << "\n"; + os << "JIT code cache size=" << PrettySize(code_cache_->CodeCacheSize()) << "\n" + << "JIT data cache size=" << PrettySize(code_cache_->DataCacheSize()) << "\n" + << "JIT current capacity=" << PrettySize(code_cache_->GetCurrentCapacity()) << "\n" + << "JIT number of compiled code=" << code_cache_->NumberOfCompiledCode() << "\n"; cumulative_timings_.Dump(os); } diff --git a/runtime/jit/jit.h b/runtime/jit/jit.h index 630eba34af..e80a376349 100644 --- a/runtime/jit/jit.h +++ b/runtime/jit/jit.h @@ -74,6 +74,10 @@ class Jit { void SaveProfilingInfo(const std::string& filename); + void DumpForSigQuit(std::ostream& os) { + DumpInfo(os); + } + private: Jit(); bool LoadCompiler(std::string* error_msg); diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h index 4032c7b832..205a3ed49f 100644 --- a/runtime/jit/jit_code_cache.h +++ b/runtime/jit/jit_code_cache.h @@ -154,6 +154,11 @@ class JitCodeCache { uint64_t GetLastUpdateTimeNs() REQUIRES(!lock_); + size_t GetCurrentCapacity() REQUIRES(!lock_) { + MutexLock lock(Thread::Current(), lock_); + return current_capacity_; + } + private: // Take ownership of maps. JitCodeCache(MemMap* code_map, diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 93ca347b49..02747d0d4d 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1300,6 +1300,11 @@ void Runtime::DumpForSigQuit(std::ostream& os) { GetInternTable()->DumpForSigQuit(os); GetJavaVM()->DumpForSigQuit(os); GetHeap()->DumpForSigQuit(os); + if (GetJit() != nullptr) { + GetJit()->DumpForSigQuit(os); + } else { + os << "Running non JIT\n"; + } TrackedAllocators::Dump(os); os << "\n"; -- cgit v1.2.3-59-g8ed1b