blob: 5e0a11d2d1fecc334da955311015647d88cbf93b [file] [log] [blame]
jeffhao725a9572012-11-13 18:20:12 -08001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_RUNTIME_INSTRUMENTATION_H_
18#define ART_RUNTIME_INSTRUMENTATION_H_
jeffhao725a9572012-11-13 18:20:12 -080019
Ian Rogers576ca0c2014-06-06 15:58:22 -070020#include <stdint.h>
Ian Rogers576ca0c2014-06-06 15:58:22 -070021#include <list>
Mathieu Chartiere401d142015-04-22 13:56:20 -070022#include <unordered_set>
Ian Rogers576ca0c2014-06-06 15:58:22 -070023
Ian Rogersd582fa42014-11-05 23:46:43 -080024#include "arch/instruction_set.h"
Elliott Hughes76160052012-12-12 16:31:20 -080025#include "base/macros.h"
Ian Rogers719d1a32014-03-06 12:13:39 -080026#include "base/mutex.h"
Hiroshi Yamauchi94f7b492014-07-22 18:08:23 -070027#include "gc_root.h"
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020028#include "safe_map.h"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080029
jeffhao725a9572012-11-13 18:20:12 -080030namespace art {
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080031namespace mirror {
Brian Carlstromea46f952013-07-30 01:26:50 -070032 class Class;
33 class Object;
34 class Throwable;
Ian Rogers62d6c772013-02-27 08:32:07 -080035} // namespace mirror
Mathieu Chartierc7853442015-03-27 14:35:38 -070036class ArtField;
Mathieu Chartiere401d142015-04-22 13:56:20 -070037class ArtMethod;
Ian Rogers62d6c772013-02-27 08:32:07 -080038union JValue;
jeffhao725a9572012-11-13 18:20:12 -080039class Thread;
40
Ian Rogers62d6c772013-02-27 08:32:07 -080041namespace instrumentation {
jeffhao725a9572012-11-13 18:20:12 -080042
Sebastien Hertzee1997a2013-09-19 14:47:09 +020043// Interpreter handler tables.
44enum InterpreterHandlerTable {
45 kMainHandlerTable = 0, // Main handler table: no suspend check, no instrumentation.
46 kAlternativeHandlerTable = 1, // Alternative handler table: suspend check and/or instrumentation
47 // enabled.
48 kNumHandlerTables
49};
50
Andreas Gampe40da2862015-02-27 12:49:04 -080051// Do we want to deoptimize for method entry and exit listeners or just try to intercept
52// invocations? Deoptimization forces all code to run in the interpreter and considerably hurts the
53// application's performance.
54static constexpr bool kDeoptimizeForAccurateMethodEntryExitListeners = true;
55
Ian Rogers62d6c772013-02-27 08:32:07 -080056// Instrumentation event listener API. Registered listeners will get the appropriate call back for
57// the events they are listening for. The call backs supply the thread, method and dex_pc the event
58// occurred upon. The thread may or may not be Thread::Current().
59struct InstrumentationListener {
60 InstrumentationListener() {}
61 virtual ~InstrumentationListener() {}
62
63 // Call-back for when a method is entered.
64 virtual void MethodEntered(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -070065 ArtMethod* method,
Mathieu Chartier90443472015-07-16 20:32:27 -070066 uint32_t dex_pc) SHARED_REQUIRES(Locks::mutator_lock_) = 0;
Ian Rogers62d6c772013-02-27 08:32:07 -080067
68 // Call-back for when a method is exited.
Ian Rogers62d6c772013-02-27 08:32:07 -080069 virtual void MethodExited(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -070070 ArtMethod* method, uint32_t dex_pc,
Ian Rogers62d6c772013-02-27 08:32:07 -080071 const JValue& return_value)
Mathieu Chartier90443472015-07-16 20:32:27 -070072 SHARED_REQUIRES(Locks::mutator_lock_) = 0;
Ian Rogers62d6c772013-02-27 08:32:07 -080073
74 // Call-back for when a method is popped due to an exception throw. A method will either cause a
75 // MethodExited call-back or a MethodUnwind call-back when its activation is removed.
Sebastien Hertz51db44a2013-11-19 10:00:29 +010076 virtual void MethodUnwind(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -070077 ArtMethod* method, uint32_t dex_pc)
Mathieu Chartier90443472015-07-16 20:32:27 -070078 SHARED_REQUIRES(Locks::mutator_lock_) = 0;
Ian Rogers62d6c772013-02-27 08:32:07 -080079
80 // Call-back for when the dex pc moves in a method.
81 virtual void DexPcMoved(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -070082 ArtMethod* method, uint32_t new_dex_pc)
Mathieu Chartier90443472015-07-16 20:32:27 -070083 SHARED_REQUIRES(Locks::mutator_lock_) = 0;
Ian Rogers62d6c772013-02-27 08:32:07 -080084
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +020085 // Call-back for when we read from a field.
Mathieu Chartiere401d142015-04-22 13:56:20 -070086 virtual void FieldRead(Thread* thread, mirror::Object* this_object, ArtMethod* method,
Mathieu Chartierc7853442015-03-27 14:35:38 -070087 uint32_t dex_pc, ArtField* field) = 0;
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +020088
89 // Call-back for when we write into a field.
Mathieu Chartiere401d142015-04-22 13:56:20 -070090 virtual void FieldWritten(Thread* thread, mirror::Object* this_object, ArtMethod* method,
Mathieu Chartierc7853442015-03-27 14:35:38 -070091 uint32_t dex_pc, ArtField* field, const JValue& field_value) = 0;
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +020092
Ian Rogers62d6c772013-02-27 08:32:07 -080093 // Call-back when an exception is caught.
Nicolas Geoffray14691c52015-03-05 10:40:17 +000094 virtual void ExceptionCaught(Thread* thread, mirror::Throwable* exception_object)
Mathieu Chartier90443472015-07-16 20:32:27 -070095 SHARED_REQUIRES(Locks::mutator_lock_) = 0;
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080096
97 // Call-back for when we get a backward branch.
Mathieu Chartiere401d142015-04-22 13:56:20 -070098 virtual void BackwardBranch(Thread* thread, ArtMethod* method, int32_t dex_pc_offset)
Mathieu Chartier90443472015-07-16 20:32:27 -070099 SHARED_REQUIRES(Locks::mutator_lock_) = 0;
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100100
101 // Call-back for when we get an invokevirtual or an invokeinterface.
102 virtual void InvokeVirtualOrInterface(Thread* thread,
103 mirror::Object* this_object,
104 ArtMethod* caller,
105 uint32_t dex_pc,
106 ArtMethod* callee)
107 SHARED_REQUIRES(Locks::mutator_lock_) = 0;
jeffhao725a9572012-11-13 18:20:12 -0800108};
109
Ian Rogers62d6c772013-02-27 08:32:07 -0800110// Instrumentation is a catch-all for when extra information is required from the runtime. The
111// typical use for instrumentation is for profiling and debugging. Instrumentation may add stubs
112// to method entry and exit, it may also force execution to be switched to the interpreter and
113// trigger deoptimization.
jeffhao725a9572012-11-13 18:20:12 -0800114class Instrumentation {
115 public:
Ian Rogers62d6c772013-02-27 08:32:07 -0800116 enum InstrumentationEvent {
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800117 kMethodEntered = 0x1,
118 kMethodExited = 0x2,
119 kMethodUnwind = 0x4,
120 kDexPcMoved = 0x8,
121 kFieldRead = 0x10,
122 kFieldWritten = 0x20,
123 kExceptionCaught = 0x40,
124 kBackwardBranch = 0x80,
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100125 kInvokeVirtualOrInterface = 0x100,
Ian Rogers62d6c772013-02-27 08:32:07 -0800126 };
jeffhao725a9572012-11-13 18:20:12 -0800127
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200128 enum class InstrumentationLevel {
129 kInstrumentNothing, // execute without instrumentation
130 kInstrumentWithInstrumentationStubs, // execute with instrumentation entry/exit stubs
131 kInstrumentWithInterpreter // execute with interpreter
132 };
133
Mathieu Chartier3b05e9b2014-03-25 09:29:43 -0700134 Instrumentation();
jeffhao725a9572012-11-13 18:20:12 -0800135
Ian Rogers62d6c772013-02-27 08:32:07 -0800136 // Add a listener to be notified of the masked together sent of instrumentation events. This
137 // suspend the runtime to install stubs. You are expected to hold the mutator lock as a proxy
138 // for saying you should have suspended all threads (installing stubs while threads are running
139 // will break).
140 void AddListener(InstrumentationListener* listener, uint32_t events)
Mathieu Chartier90443472015-07-16 20:32:27 -0700141 REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
jeffhao725a9572012-11-13 18:20:12 -0800142
Ian Rogers62d6c772013-02-27 08:32:07 -0800143 // Removes a listener possibly removing instrumentation stubs.
144 void RemoveListener(InstrumentationListener* listener, uint32_t events)
Mathieu Chartier90443472015-07-16 20:32:27 -0700145 REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
jeffhao725a9572012-11-13 18:20:12 -0800146
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100147 // Deoptimization.
Sebastien Hertza76a6d42014-03-20 16:40:17 +0100148 void EnableDeoptimization()
Mathieu Chartieraa516822015-10-02 15:53:37 -0700149 REQUIRES(Locks::mutator_lock_)
150 REQUIRES(!deoptimized_methods_lock_);
151 // Calls UndeoptimizeEverything which may visit class linker classes through ConfigureStubs.
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200152 void DisableDeoptimization(const char* key)
Mathieu Chartieraa516822015-10-02 15:53:37 -0700153 REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
154 REQUIRES(!deoptimized_methods_lock_);
155
Sebastien Hertza76a6d42014-03-20 16:40:17 +0100156 bool AreAllMethodsDeoptimized() const {
157 return interpreter_stubs_installed_;
158 }
Mathieu Chartier90443472015-07-16 20:32:27 -0700159 bool ShouldNotifyMethodEnterExitEvents() const SHARED_REQUIRES(Locks::mutator_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100160
161 // Executes everything with interpreter.
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200162 void DeoptimizeEverything(const char* key)
Mathieu Chartieraa516822015-10-02 15:53:37 -0700163 REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
164 REQUIRES(!Locks::thread_list_lock_,
165 !Locks::classlinker_classes_lock_,
Mathieu Chartier90443472015-07-16 20:32:27 -0700166 !deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100167
Mathieu Chartieraa516822015-10-02 15:53:37 -0700168 // Executes everything with compiled code (or interpreter if there is no code). May visit class
169 // linker classes through ConfigureStubs.
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200170 void UndeoptimizeEverything(const char* key)
Mathieu Chartieraa516822015-10-02 15:53:37 -0700171 REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
172 REQUIRES(!Locks::thread_list_lock_,
173 !Locks::classlinker_classes_lock_,
Mathieu Chartier90443472015-07-16 20:32:27 -0700174 !deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100175
176 // Deoptimize a method by forcing its execution with the interpreter. Nevertheless, a static
177 // method (except a class initializer) set to the resolution trampoline will be deoptimized only
178 // once its declaring class is initialized.
Mathieu Chartiere401d142015-04-22 13:56:20 -0700179 void Deoptimize(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700180 REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100181
182 // Undeoptimze the method by restoring its entrypoints. Nevertheless, a static method
183 // (except a class initializer) set to the resolution trampoline will be updated only once its
184 // declaring class is initialized.
Mathieu Chartiere401d142015-04-22 13:56:20 -0700185 void Undeoptimize(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700186 REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100187
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200188 // Indicates whether the method has been deoptimized so it is executed with the interpreter.
Mathieu Chartiere401d142015-04-22 13:56:20 -0700189 bool IsDeoptimized(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700190 REQUIRES(!deoptimized_methods_lock_) SHARED_REQUIRES(Locks::mutator_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100191
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200192 // Enable method tracing by installing instrumentation entry/exit stubs or interpreter.
193 void EnableMethodTracing(const char* key,
194 bool needs_interpreter = kDeoptimizeForAccurateMethodEntryExitListeners)
Mathieu Chartieraa516822015-10-02 15:53:37 -0700195 REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
196 REQUIRES(!Locks::thread_list_lock_,
197 !Locks::classlinker_classes_lock_,
Mathieu Chartier90443472015-07-16 20:32:27 -0700198 !deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100199
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200200 // Disable method tracing by uninstalling instrumentation entry/exit stubs or interpreter.
201 void DisableMethodTracing(const char* key)
Mathieu Chartieraa516822015-10-02 15:53:37 -0700202 REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
203 REQUIRES(!Locks::thread_list_lock_,
204 !Locks::classlinker_classes_lock_,
Mathieu Chartier90443472015-07-16 20:32:27 -0700205 !deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100206
Sebastien Hertzed2be172014-08-19 15:33:43 +0200207 InterpreterHandlerTable GetInterpreterHandlerTable() const
Mathieu Chartier90443472015-07-16 20:32:27 -0700208 SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200209 return interpreter_handler_table_;
210 }
211
Mathieu Chartier90443472015-07-16 20:32:27 -0700212 void InstrumentQuickAllocEntryPoints() REQUIRES(!Locks::instrument_entrypoints_lock_);
213 void UninstrumentQuickAllocEntryPoints() REQUIRES(!Locks::instrument_entrypoints_lock_);
Mathieu Chartier9ef78b52014-09-25 17:03:12 -0700214 void InstrumentQuickAllocEntryPointsLocked()
Mathieu Chartier90443472015-07-16 20:32:27 -0700215 REQUIRES(Locks::instrument_entrypoints_lock_, !Locks::thread_list_lock_,
216 !Locks::runtime_shutdown_lock_);
Mathieu Chartier9ef78b52014-09-25 17:03:12 -0700217 void UninstrumentQuickAllocEntryPointsLocked()
Mathieu Chartier90443472015-07-16 20:32:27 -0700218 REQUIRES(Locks::instrument_entrypoints_lock_, !Locks::thread_list_lock_,
219 !Locks::runtime_shutdown_lock_);
220 void ResetQuickAllocEntryPoints() REQUIRES(Locks::runtime_shutdown_lock_);
Ian Rogersfa824272013-11-05 16:12:57 -0800221
Ian Rogers62d6c772013-02-27 08:32:07 -0800222 // Update the code of a method respecting any installed stubs.
Mathieu Chartiere401d142015-04-22 13:56:20 -0700223 void UpdateMethodsCode(ArtMethod* method, const void* quick_code)
Mathieu Chartier90443472015-07-16 20:32:27 -0700224 SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!deoptimized_methods_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800225
226 // Get the quick code for the given method. More efficient than asking the class linker as it
227 // will short-cut to GetCode if instrumentation and static method resolution stubs aren't
228 // installed.
Mathieu Chartiere401d142015-04-22 13:56:20 -0700229 const void* GetQuickCodeFor(ArtMethod* method, size_t pointer_size) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700230 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800231
232 void ForceInterpretOnly() {
233 interpret_only_ = true;
234 forced_interpret_only_ = true;
235 }
236
Brian Carlstromea46f952013-07-30 01:26:50 -0700237 // Called by ArtMethod::Invoke to determine dispatch mechanism.
Ian Rogers62d6c772013-02-27 08:32:07 -0800238 bool InterpretOnly() const {
239 return interpret_only_;
240 }
241
Hiroshi Yamauchi563b47c2014-02-28 17:18:37 -0800242 bool IsForcedInterpretOnly() const {
243 return forced_interpret_only_;
244 }
245
Ian Rogers62d6c772013-02-27 08:32:07 -0800246 bool AreExitStubsInstalled() const {
247 return instrumentation_stubs_installed_;
248 }
249
Mathieu Chartier90443472015-07-16 20:32:27 -0700250 bool HasMethodEntryListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz74109f62013-06-07 17:40:09 +0200251 return have_method_entry_listeners_;
252 }
253
Mathieu Chartier90443472015-07-16 20:32:27 -0700254 bool HasMethodExitListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz74109f62013-06-07 17:40:09 +0200255 return have_method_exit_listeners_;
256 }
257
Mathieu Chartier90443472015-07-16 20:32:27 -0700258 bool HasMethodUnwindListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200259 return have_method_unwind_listeners_;
260 }
261
Mathieu Chartier90443472015-07-16 20:32:27 -0700262 bool HasDexPcListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz74109f62013-06-07 17:40:09 +0200263 return have_dex_pc_listeners_;
264 }
265
Mathieu Chartier90443472015-07-16 20:32:27 -0700266 bool HasFieldReadListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200267 return have_field_read_listeners_;
268 }
269
Mathieu Chartier90443472015-07-16 20:32:27 -0700270 bool HasFieldWriteListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200271 return have_field_write_listeners_;
272 }
273
Mathieu Chartier90443472015-07-16 20:32:27 -0700274 bool HasExceptionCaughtListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz9f102032014-05-23 08:59:42 +0200275 return have_exception_caught_listeners_;
276 }
277
Mathieu Chartier90443472015-07-16 20:32:27 -0700278 bool HasBackwardBranchListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800279 return have_backward_branch_listeners_;
280 }
281
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100282 bool HasInvokeVirtualOrInterfaceListeners() const SHARED_REQUIRES(Locks::mutator_lock_) {
283 return have_invoke_virtual_or_interface_listeners_;
284 }
285
Mathieu Chartier90443472015-07-16 20:32:27 -0700286 bool IsActive() const SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200287 return have_dex_pc_listeners_ || have_method_entry_listeners_ || have_method_exit_listeners_ ||
Sebastien Hertz42cd43f2014-05-13 14:15:41 +0200288 have_field_read_listeners_ || have_field_write_listeners_ ||
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200289 have_exception_caught_listeners_ || have_method_unwind_listeners_;
290 }
291
Ian Rogers62d6c772013-02-27 08:32:07 -0800292 // Inform listeners that a method has been entered. A dex PC is provided as we may install
293 // listeners into executing code and get method enter events for methods already on the stack.
294 void MethodEnterEvent(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700295 ArtMethod* method, uint32_t dex_pc) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700296 SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz74109f62013-06-07 17:40:09 +0200297 if (UNLIKELY(HasMethodEntryListeners())) {
Ian Rogers62d6c772013-02-27 08:32:07 -0800298 MethodEnterEventImpl(thread, this_object, method, dex_pc);
299 }
300 }
301
302 // Inform listeners that a method has been exited.
303 void MethodExitEvent(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700304 ArtMethod* method, uint32_t dex_pc,
Ian Rogers62d6c772013-02-27 08:32:07 -0800305 const JValue& return_value) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700306 SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz74109f62013-06-07 17:40:09 +0200307 if (UNLIKELY(HasMethodExitListeners())) {
Ian Rogers62d6c772013-02-27 08:32:07 -0800308 MethodExitEventImpl(thread, this_object, method, dex_pc, return_value);
309 }
310 }
311
312 // Inform listeners that a method has been exited due to an exception.
313 void MethodUnwindEvent(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700314 ArtMethod* method, uint32_t dex_pc) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700315 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800316
317 // Inform listeners that the dex pc has moved (only supported by the interpreter).
318 void DexPcMovedEvent(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700319 ArtMethod* method, uint32_t dex_pc) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700320 SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz74109f62013-06-07 17:40:09 +0200321 if (UNLIKELY(HasDexPcListeners())) {
Ian Rogers62d6c772013-02-27 08:32:07 -0800322 DexPcMovedEventImpl(thread, this_object, method, dex_pc);
323 }
324 }
325
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800326 // Inform listeners that a backward branch has been taken (only supported by the interpreter).
Mathieu Chartiere401d142015-04-22 13:56:20 -0700327 void BackwardBranch(Thread* thread, ArtMethod* method, int32_t offset) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700328 SHARED_REQUIRES(Locks::mutator_lock_) {
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800329 if (UNLIKELY(HasBackwardBranchListeners())) {
330 BackwardBranchImpl(thread, method, offset);
331 }
332 }
333
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200334 // Inform listeners that we read a field (only supported by the interpreter).
335 void FieldReadEvent(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700336 ArtMethod* method, uint32_t dex_pc,
Mathieu Chartierc7853442015-03-27 14:35:38 -0700337 ArtField* field) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700338 SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200339 if (UNLIKELY(HasFieldReadListeners())) {
340 FieldReadEventImpl(thread, this_object, method, dex_pc, field);
341 }
342 }
343
344 // Inform listeners that we write a field (only supported by the interpreter).
345 void FieldWriteEvent(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700346 ArtMethod* method, uint32_t dex_pc,
Mathieu Chartierc7853442015-03-27 14:35:38 -0700347 ArtField* field, const JValue& field_value) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700348 SHARED_REQUIRES(Locks::mutator_lock_) {
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200349 if (UNLIKELY(HasFieldWriteListeners())) {
350 FieldWriteEventImpl(thread, this_object, method, dex_pc, field, field_value);
351 }
352 }
353
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100354 void InvokeVirtualOrInterface(Thread* thread,
355 mirror::Object* this_object,
356 ArtMethod* caller,
357 uint32_t dex_pc,
358 ArtMethod* callee) const
359 SHARED_REQUIRES(Locks::mutator_lock_) {
360 if (UNLIKELY(HasInvokeVirtualOrInterfaceListeners())) {
361 InvokeVirtualOrInterfaceImpl(thread, this_object, caller, dex_pc, callee);
362 }
363 }
364
Ian Rogers62d6c772013-02-27 08:32:07 -0800365 // Inform listeners that an exception was caught.
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000366 void ExceptionCaughtEvent(Thread* thread, mirror::Throwable* exception_object) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700367 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800368
369 // Called when an instrumented method is entered. The intended link register (lr) is saved so
370 // that returning causes a branch to the method exit stub. Generates method enter events.
371 void PushInstrumentationStackFrame(Thread* self, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700372 ArtMethod* method, uintptr_t lr,
Jeff Hao9a916d32013-06-27 18:45:37 -0700373 bool interpreter_entry)
Mathieu Chartier90443472015-07-16 20:32:27 -0700374 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800375
376 // Called when an instrumented method is exited. Removes the pushed instrumentation frame
377 // returning the intended link register. Generates method exit events.
Andreas Gamped58342c2014-06-05 14:18:08 -0700378 TwoWordReturn PopInstrumentationStackFrame(Thread* self, uintptr_t* return_pc,
379 uint64_t gpr_result, uint64_t fpr_result)
Mathieu Chartier90443472015-07-16 20:32:27 -0700380 SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!deoptimized_methods_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800381
382 // Pops an instrumentation frame from the current thread and generate an unwind event.
383 void PopMethodForUnwind(Thread* self, bool is_deoptimization) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700384 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800385
386 // Call back for configure stubs.
Mathieu Chartier90443472015-07-16 20:32:27 -0700387 void InstallStubsForClass(mirror::Class* klass) SHARED_REQUIRES(Locks::mutator_lock_)
388 REQUIRES(!deoptimized_methods_lock_);
jeffhao725a9572012-11-13 18:20:12 -0800389
Mathieu Chartiere401d142015-04-22 13:56:20 -0700390 void InstallStubsForMethod(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700391 SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!deoptimized_methods_lock_);
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100392
Mingyao Yang99170c62015-07-06 11:10:37 -0700393 // Install instrumentation exit stub on every method of the stack of the given thread.
394 // This is used by the debugger to cause a deoptimization of the thread's stack after updating
395 // local variable(s).
396 void InstrumentThreadStack(Thread* thread)
397 SHARED_REQUIRES(Locks::mutator_lock_)
398 REQUIRES(!Locks::thread_list_lock_);
399
Sebastien Hertzb2feaaf2015-10-12 13:40:10 +0000400 static size_t ComputeFrameId(Thread* self,
401 size_t frame_depth,
402 size_t inlined_frames_before_frame)
403 SHARED_REQUIRES(Locks::mutator_lock_);
404
jeffhao725a9572012-11-13 18:20:12 -0800405 private:
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200406 InstrumentationLevel GetCurrentInstrumentationLevel() const;
407
Ian Rogers62d6c772013-02-27 08:32:07 -0800408 // Does the job of installing or removing instrumentation code within methods.
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200409 // In order to support multiple clients using instrumentation at the same time,
410 // the caller must pass a unique key (a string) identifying it so we remind which
411 // instrumentation level it needs. Therefore the current instrumentation level
412 // becomes the highest instrumentation level required by a client.
413 void ConfigureStubs(const char* key, InstrumentationLevel desired_instrumentation_level)
Mathieu Chartieraa516822015-10-02 15:53:37 -0700414 REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
415 REQUIRES(!deoptimized_methods_lock_,
416 !Locks::thread_list_lock_,
Mathieu Chartier90443472015-07-16 20:32:27 -0700417 !Locks::classlinker_classes_lock_);
jeffhao725a9572012-11-13 18:20:12 -0800418
Mathieu Chartier90443472015-07-16 20:32:27 -0700419 void UpdateInterpreterHandlerTable() REQUIRES(Locks::mutator_lock_) {
buzbee1452bee2015-03-06 14:43:04 -0800420 /*
421 * TUNING: Dalvik's mterp stashes the actual current handler table base in a
422 * tls field. For Arm, this enables all suspend, debug & tracing checks to be
423 * collapsed into a single conditionally-executed ldw instruction.
424 * Move to Dalvik-style handler-table management for both the goto interpreter and
425 * mterp.
426 */
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200427 interpreter_handler_table_ = IsActive() ? kAlternativeHandlerTable : kMainHandlerTable;
428 }
429
Mathieu Chartier661974a2014-01-09 11:23:53 -0800430 // No thread safety analysis to get around SetQuickAllocEntryPointsInstrumented requiring
431 // exclusive access to mutator lock which you can't get if the runtime isn't started.
Mathieu Chartier9ef78b52014-09-25 17:03:12 -0700432 void SetEntrypointsInstrumented(bool instrumented) NO_THREAD_SAFETY_ANALYSIS;
Mathieu Chartier661974a2014-01-09 11:23:53 -0800433
Ian Rogers62d6c772013-02-27 08:32:07 -0800434 void MethodEnterEventImpl(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700435 ArtMethod* method, uint32_t dex_pc) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700436 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800437 void MethodExitEventImpl(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700438 ArtMethod* method,
Ian Rogers62d6c772013-02-27 08:32:07 -0800439 uint32_t dex_pc, const JValue& return_value) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700440 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800441 void DexPcMovedEventImpl(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700442 ArtMethod* method, uint32_t dex_pc) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700443 SHARED_REQUIRES(Locks::mutator_lock_);
Mathieu Chartiere401d142015-04-22 13:56:20 -0700444 void BackwardBranchImpl(Thread* thread, ArtMethod* method, int32_t offset) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700445 SHARED_REQUIRES(Locks::mutator_lock_);
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100446 void InvokeVirtualOrInterfaceImpl(Thread* thread,
447 mirror::Object* this_object,
448 ArtMethod* caller,
449 uint32_t dex_pc,
450 ArtMethod* callee) const
451 SHARED_REQUIRES(Locks::mutator_lock_);
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200452 void FieldReadEventImpl(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700453 ArtMethod* method, uint32_t dex_pc,
Mathieu Chartierc7853442015-03-27 14:35:38 -0700454 ArtField* field) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700455 SHARED_REQUIRES(Locks::mutator_lock_);
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200456 void FieldWriteEventImpl(Thread* thread, mirror::Object* this_object,
Mathieu Chartiere401d142015-04-22 13:56:20 -0700457 ArtMethod* method, uint32_t dex_pc,
Mathieu Chartierc7853442015-03-27 14:35:38 -0700458 ArtField* field, const JValue& field_value) const
Mathieu Chartier90443472015-07-16 20:32:27 -0700459 SHARED_REQUIRES(Locks::mutator_lock_);
jeffhao725a9572012-11-13 18:20:12 -0800460
Hiroshi Yamauchi799eb3a2014-07-18 15:38:17 -0700461 // Read barrier-aware utility functions for accessing deoptimized_methods_
Mathieu Chartiere401d142015-04-22 13:56:20 -0700462 bool AddDeoptimizedMethod(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700463 SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(deoptimized_methods_lock_);
Mathieu Chartiere401d142015-04-22 13:56:20 -0700464 bool IsDeoptimizedMethod(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700465 SHARED_REQUIRES(Locks::mutator_lock_, deoptimized_methods_lock_);
Mathieu Chartiere401d142015-04-22 13:56:20 -0700466 bool RemoveDeoptimizedMethod(ArtMethod* method)
Mathieu Chartier90443472015-07-16 20:32:27 -0700467 SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(deoptimized_methods_lock_);
Mathieu Chartiere401d142015-04-22 13:56:20 -0700468 ArtMethod* BeginDeoptimizedMethod()
Mathieu Chartier90443472015-07-16 20:32:27 -0700469 SHARED_REQUIRES(Locks::mutator_lock_, deoptimized_methods_lock_);
Hiroshi Yamauchi799eb3a2014-07-18 15:38:17 -0700470 bool IsDeoptimizedMethodsEmpty() const
Mathieu Chartier90443472015-07-16 20:32:27 -0700471 SHARED_REQUIRES(Locks::mutator_lock_, deoptimized_methods_lock_);
Hiroshi Yamauchi799eb3a2014-07-18 15:38:17 -0700472
Brian Carlstromea46f952013-07-30 01:26:50 -0700473 // Have we hijacked ArtMethod::code_ so that it calls instrumentation/interpreter code?
Ian Rogers62d6c772013-02-27 08:32:07 -0800474 bool instrumentation_stubs_installed_;
475
Brian Carlstromea46f952013-07-30 01:26:50 -0700476 // Have we hijacked ArtMethod::code_ to reference the enter/exit stubs?
Ian Rogers62d6c772013-02-27 08:32:07 -0800477 bool entry_exit_stubs_installed_;
478
Brian Carlstromea46f952013-07-30 01:26:50 -0700479 // Have we hijacked ArtMethod::code_ to reference the enter interpreter stub?
Ian Rogers62d6c772013-02-27 08:32:07 -0800480 bool interpreter_stubs_installed_;
481
482 // Do we need the fidelity of events that we only get from running within the interpreter?
483 bool interpret_only_;
484
485 // Did the runtime request we only run in the interpreter? ie -Xint mode.
486 bool forced_interpret_only_;
487
488 // Do we have any listeners for method entry events? Short-cut to avoid taking the
489 // instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200490 bool have_method_entry_listeners_ GUARDED_BY(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800491
492 // Do we have any listeners for method exit events? Short-cut to avoid taking the
493 // instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200494 bool have_method_exit_listeners_ GUARDED_BY(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800495
496 // Do we have any listeners for method unwind events? Short-cut to avoid taking the
497 // instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200498 bool have_method_unwind_listeners_ GUARDED_BY(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800499
500 // Do we have any listeners for dex move events? Short-cut to avoid taking the
501 // instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200502 bool have_dex_pc_listeners_ GUARDED_BY(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800503
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200504 // Do we have any listeners for field read events? Short-cut to avoid taking the
505 // instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200506 bool have_field_read_listeners_ GUARDED_BY(Locks::mutator_lock_);
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200507
508 // Do we have any listeners for field write events? Short-cut to avoid taking the
509 // instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200510 bool have_field_write_listeners_ GUARDED_BY(Locks::mutator_lock_);
Sebastien Hertz3f52eaf2014-04-04 17:50:18 +0200511
Ian Rogers62d6c772013-02-27 08:32:07 -0800512 // Do we have any exception caught listeners? Short-cut to avoid taking the instrumentation_lock_.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200513 bool have_exception_caught_listeners_ GUARDED_BY(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800514
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800515 // Do we have any backward branch listeners? Short-cut to avoid taking the instrumentation_lock_.
516 bool have_backward_branch_listeners_ GUARDED_BY(Locks::mutator_lock_);
517
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100518 // Do we have any invoke listeners? Short-cut to avoid taking the instrumentation_lock_.
519 bool have_invoke_virtual_or_interface_listeners_ GUARDED_BY(Locks::mutator_lock_);
520
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200521 // Contains the instrumentation level required by each client of the instrumentation identified
522 // by a string key.
523 typedef SafeMap<const char*, InstrumentationLevel> InstrumentationLevelTable;
524 InstrumentationLevelTable requested_instrumentation_levels_ GUARDED_BY(Locks::mutator_lock_);
525
Ian Rogers62d6c772013-02-27 08:32:07 -0800526 // The event listeners, written to with the mutator_lock_ exclusively held.
Nicolas Geoffray514a6162015-11-03 11:44:24 +0000527 // Mutators must be able to iterate over these lists concurrently, that is, with listeners being
528 // added or removed while iterating. The modifying thread holds exclusive lock,
529 // so other threads cannot iterate (i.e. read the data of the list) at the same time but they
530 // do keep iterators that need to remain valid. This is the reason these listeners are std::list
531 // and not for example std::vector: the existing storage for a std::list does not move.
532 // Note that mutators cannot make a copy of these lists before iterating, as the instrumentation
533 // listeners can also be deleted concurrently.
534 // As a result, these lists are never trimmed. That's acceptable given the low number of
535 // listeners we have.
Ian Rogers62d6c772013-02-27 08:32:07 -0800536 std::list<InstrumentationListener*> method_entry_listeners_ GUARDED_BY(Locks::mutator_lock_);
537 std::list<InstrumentationListener*> method_exit_listeners_ GUARDED_BY(Locks::mutator_lock_);
538 std::list<InstrumentationListener*> method_unwind_listeners_ GUARDED_BY(Locks::mutator_lock_);
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800539 std::list<InstrumentationListener*> backward_branch_listeners_ GUARDED_BY(Locks::mutator_lock_);
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100540 std::list<InstrumentationListener*> invoke_virtual_or_interface_listeners_
541 GUARDED_BY(Locks::mutator_lock_);
Nicolas Geoffray514a6162015-11-03 11:44:24 +0000542 std::list<InstrumentationListener*> dex_pc_listeners_ GUARDED_BY(Locks::mutator_lock_);
543 std::list<InstrumentationListener*> field_read_listeners_ GUARDED_BY(Locks::mutator_lock_);
544 std::list<InstrumentationListener*> field_write_listeners_ GUARDED_BY(Locks::mutator_lock_);
545 std::list<InstrumentationListener*> exception_caught_listeners_ GUARDED_BY(Locks::mutator_lock_);
jeffhao725a9572012-11-13 18:20:12 -0800546
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100547 // The set of methods being deoptimized (by the debugger) which must be executed with interpreter
548 // only.
Mathieu Chartier3b05e9b2014-03-25 09:29:43 -0700549 mutable ReaderWriterMutex deoptimized_methods_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
Mathieu Chartiere401d142015-04-22 13:56:20 -0700550 std::unordered_set<ArtMethod*> deoptimized_methods_ GUARDED_BY(deoptimized_methods_lock_);
Sebastien Hertz11d40c22014-02-19 18:00:17 +0100551 bool deoptimization_enabled_;
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100552
Ian Rogersfa824272013-11-05 16:12:57 -0800553 // Current interpreter handler table. This is updated each time the thread state flags are
554 // modified.
Sebastien Hertzed2be172014-08-19 15:33:43 +0200555 InterpreterHandlerTable interpreter_handler_table_ GUARDED_BY(Locks::mutator_lock_);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200556
Ian Rogersfa824272013-11-05 16:12:57 -0800557 // Greater than 0 if quick alloc entry points instrumented.
Mathieu Chartier9ef78b52014-09-25 17:03:12 -0700558 size_t quick_alloc_entry_points_instrumentation_counter_
559 GUARDED_BY(Locks::instrument_entrypoints_lock_);
Ian Rogersfa824272013-11-05 16:12:57 -0800560
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200561 friend class InstrumentationTest; // For GetCurrentInstrumentationLevel and ConfigureStubs.
562
jeffhao725a9572012-11-13 18:20:12 -0800563 DISALLOW_COPY_AND_ASSIGN(Instrumentation);
564};
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700565std::ostream& operator<<(std::ostream& os, const Instrumentation::InstrumentationEvent& rhs);
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200566std::ostream& operator<<(std::ostream& os, const Instrumentation::InstrumentationLevel& rhs);
jeffhao725a9572012-11-13 18:20:12 -0800567
Ian Rogers62d6c772013-02-27 08:32:07 -0800568// An element in the instrumentation side stack maintained in art::Thread.
569struct InstrumentationStackFrame {
Mathieu Chartiere401d142015-04-22 13:56:20 -0700570 InstrumentationStackFrame(mirror::Object* this_object, ArtMethod* method,
Jeff Hao9a916d32013-06-27 18:45:37 -0700571 uintptr_t return_pc, size_t frame_id, bool interpreter_entry)
572 : this_object_(this_object), method_(method), return_pc_(return_pc), frame_id_(frame_id),
573 interpreter_entry_(interpreter_entry) {
Ian Rogers62d6c772013-02-27 08:32:07 -0800574 }
575
Mathieu Chartier90443472015-07-16 20:32:27 -0700576 std::string Dump() const SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers62d6c772013-02-27 08:32:07 -0800577
578 mirror::Object* this_object_;
Mathieu Chartiere401d142015-04-22 13:56:20 -0700579 ArtMethod* method_;
Sebastien Hertz138dbfc2013-12-04 18:15:25 +0100580 uintptr_t return_pc_;
581 size_t frame_id_;
582 bool interpreter_entry_;
Ian Rogers62d6c772013-02-27 08:32:07 -0800583};
584
585} // namespace instrumentation
jeffhao725a9572012-11-13 18:20:12 -0800586} // namespace art
587
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700588#endif // ART_RUNTIME_INSTRUMENTATION_H_