From 0462c4c87c39db6cfcd338f323844738109ac3c9 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Wed, 1 Apr 2015 16:34:17 +0200 Subject: Support multiple instrumentation clients Changes Instrumentation::ConfigureStubs to support multiple clients that need different levels of instrumenation. A client is identified by a string key used to save the desired instrumentation level. Also adds regression gtest instrumentation_test and some cleanup. Bug: 19829329 Change-Id: I1fc24a86fcb7cb46d4be806895376c25cc0a0b3c --- runtime/debugger.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/debugger.cc') diff --git a/runtime/debugger.cc b/runtime/debugger.cc index dc1b4f1dd5..d7363d8f0a 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -57,6 +57,9 @@ namespace art { +// The key identifying the debugger to update instrumentation. +static constexpr const char* kDbgInstrumentationKey = "Debugger"; + static const size_t kMaxAllocRecordStackDepth = 16; // Max 255. static const size_t kDefaultNumAllocRecords = 64*1024; // Must be a power of 2. 2BE can hold 64k-1. @@ -677,7 +680,7 @@ void Dbg::Disconnected() { instrumentation_events_ = 0; } if (RequiresDeoptimization()) { - runtime->GetInstrumentation()->DisableDeoptimization(); + runtime->GetInstrumentation()->DisableDeoptimization(kDbgInstrumentationKey); } gDebuggerActive = false; } @@ -2998,12 +3001,12 @@ void Dbg::ProcessDeoptimizationRequest(const DeoptimizationRequest& request) { break; case DeoptimizationRequest::kFullDeoptimization: VLOG(jdwp) << "Deoptimize the world ..."; - instrumentation->DeoptimizeEverything(); + instrumentation->DeoptimizeEverything(kDbgInstrumentationKey); VLOG(jdwp) << "Deoptimize the world DONE"; break; case DeoptimizationRequest::kFullUndeoptimization: VLOG(jdwp) << "Undeoptimize the world ..."; - instrumentation->UndeoptimizeEverything(); + instrumentation->UndeoptimizeEverything(kDbgInstrumentationKey); VLOG(jdwp) << "Undeoptimize the world DONE"; break; case DeoptimizationRequest::kSelectiveDeoptimization: -- cgit v1.2.3-59-g8ed1b