Lines Matching refs:Instrumentation
17 #include "instrumentation.h"
53 namespace instrumentation {
81 // Instrumentation works on non-inlined frames by updating returned PCs
88 explicit InstallStubsClassVisitor(Instrumentation* instrumentation)
89 : instrumentation_(instrumentation) {}
97 Instrumentation* const instrumentation_;
106 std::deque<instrumentation::InstrumentationStackFrame>* stack = self_->GetInstrumentationStack();
114 std::deque<instrumentation::InstrumentationStackFrame>* stack = self_->GetInstrumentationStack();
125 // The instrumentation events expect the exception to be set.
151 Instrumentation::Instrumentation()
176 void Instrumentation::InstallStubsForClass(mirror::Class* klass) {
194 bool Instrumentation::NeedDebugVersionFor(ArtMethod* method) const
205 void Instrumentation::InstallStubsForMethod(ArtMethod* method) {
242 // class, all its static methods code will be set to the instrumentation entry point.
246 // This needs to be checked first since the instrumentation entrypoint will be able to
265 // Places the instrumentation exit pc as the return PC for every quick frame. This also allows
267 // Since we may already have done this previously, we need to push new instrumentation frame before
268 // existing instrumentation frames.
310 // This instrumentation frame is for an interpreter bridge and is
313 // into the dex_pcs_ list to match size of instrumentation stack.
322 // We've reached a frame which has already been installed with instrumentation exit stub.
323 // We should have already installed instrumentation or be interpreter on previous frames.
338 // We already saw an existing instrumentation frame so this should be a runtime-method
348 << " without instrumentation exit return or interpreter frame."
364 // Insert frame at the right position so we do not corrupt the instrumentation stack.
365 // Instrumentation stack frames are in descending frame id order.
400 Instrumentation* instrumentation = reinterpret_cast<Instrumentation*>(arg);
407 if (instrumentation->ShouldNotifyMethodEnterExitEvents()) {
414 instrumentation->MethodEnterEvent(thread, (*ssi).this_object_, (*ssi).method_, 0);
420 instrumentation->MethodEnterEvent(thread, (*isi).this_object_, (*isi).method_, dex_pc);
427 void Instrumentation::InstrumentThreadStack(Thread* thread) {
432 // Removes the instrumentation exit pc as the return PC for every quick frame.
439 Instrumentation* instrumentation)
443 instrumentation_(instrumentation),
502 Instrumentation* const instrumentation_;
503 std::deque<instrumentation::InstrumentationStackFrame>* const instrumentation_stack_;
511 std::deque<instrumentation::InstrumentationStackFrame>* stack = thread->GetInstrumentationStack();
513 Instrumentation* instrumentation = reinterpret_cast<Instrumentation*>(arg);
516 RestoreStackVisitor visitor(thread, instrumentation_exit_pc, instrumentation);
525 static bool HasEvent(Instrumentation::InstrumentationEvent expected, uint32_t events) {
529 static void PotentiallyAddListenerTo(Instrumentation::InstrumentationEvent event,
550 void Instrumentation::AddListener(InstrumentationListener* listener, uint32_t events) {
605 static void PotentiallyRemoveListenerFrom(Instrumentation::InstrumentationEvent event,
632 void Instrumentation::RemoveListener(InstrumentationListener* listener, uint32_t events) {
687 Instrumentation::InstrumentationLevel Instrumentation::GetCurrentInstrumentationLevel() const {
697 bool Instrumentation::RequiresInstrumentationInstallation(InstrumentationLevel new_level) const {
698 // We need to reinstall instrumentation if we go to a different level.
702 void Instrumentation::UpdateInstrumentationLevels(InstrumentationLevel level) {
715 void Instrumentation::ConfigureStubs(const char* key, InstrumentationLevel desired_level) {
716 // Store the instrumentation level for this key or remove it.
718 // The client no longer needs instrumentation.
721 // The client needs instrumentation.
729 void Instrumentation::EnableSingleThreadDeopt() {
736 void Instrumentation::UpdateStubs() {
737 // Look for the highest required instrumentation level.
788 // the instrumentation exit pc.
798 void Instrumentation::SetEntrypointsInstrumented(bool instrumented) {
815 // Note: self may be null. One of those paths is setting instrumentation in the Heap
825 void Instrumentation::InstrumentQuickAllocEntryPoints() {
830 void Instrumentation::UninstrumentQuickAllocEntryPoints() {
835 void Instrumentation::InstrumentQuickAllocEntryPointsLocked() {
843 void Instrumentation::UninstrumentQuickAllocEntryPointsLocked() {
852 void Instrumentation::ResetQuickAllocEntryPoints() {
860 void Instrumentation::UpdateMethodsCodeImpl(ArtMethod* method, const void* quick_code) {
875 // implementation directly and this will confuse the instrumentation trampolines.
898 void Instrumentation::UpdateNativeMethodsCodeToJitCode(ArtMethod* method, const void* quick_code) {
909 void Instrumentation::UpdateMethodsCode(ArtMethod* method, const void* quick_code) {
914 void Instrumentation::UpdateMethodsCodeToInterpreterEntryPoint(ArtMethod* method) {
918 void Instrumentation::UpdateMethodsCodeForJavaDebuggable(ArtMethod* method,
927 bool Instrumentation::AddDeoptimizedMethod(ArtMethod* method) {
937 bool Instrumentation::IsDeoptimizedMethod(ArtMethod* method) {
941 ArtMethod* Instrumentation::BeginDeoptimizedMethod() {
949 bool Instrumentation::RemoveDeoptimizedMethod(ArtMethod* method) {
958 bool Instrumentation::IsDeoptimizedMethodsEmpty() const {
962 void Instrumentation::Deoptimize(ArtMethod* method) {
977 // Install instrumentation exit stub and instrumentation frames. We may already have installed
985 void Instrumentation::Undeoptimize(ArtMethod* method) {
1023 bool Instrumentation::IsDeoptimized(ArtMethod* method) {
1029 void Instrumentation::EnableDeoptimization() {
1036 void Instrumentation::DisableDeoptimization(const char* key) {
1059 // Indicates if instrumentation should notify method enter/exit events to the listeners.
1060 bool Instrumentation::ShouldNotifyMethodEnterExitEvents() const {
1067 void Instrumentation::DeoptimizeEverything(const char* key) {
1072 void Instrumentation::UndeoptimizeEverything(const char* key) {
1078 void Instrumentation::EnableMethodTracing(const char* key, bool needs_interpreter) {
1088 void Instrumentation::DisableMethodTracing(const char* key) {
1092 const void* Instrumentation::GetCodeForInvoke(ArtMethod* method) const {
1093 // This is called by instrumentation entry only and that should never be getting proxy methods.
1098 // exception is if it still has the instrumentation entrypoint. That means we are racing another
1099 // thread getting rid of instrumentation which is unexpected but possible. In that case we want
1135 const void* Instrumentation::GetQuickCodeFor(ArtMethod* method, PointerSize pointer_size) const {
1150 void Instrumentation::MethodEnterEventImpl(Thread* thread,
1167 void Instrumentation::MethodExitEventImpl(Thread* thread,
1194 void Instrumentation::MethodUnwindEvent(Thread* thread,
1210 void Instrumentation::DexPcMovedEventImpl(Thread* thread,
1224 void Instrumentation::BranchImpl(Thread* thread,
1235 void Instrumentation::WatchedFramePopImpl(Thread* thread, const ShadowFrame& frame) const {
1243 void Instrumentation::FieldReadEventImpl(Thread* thread,
1258 void Instrumentation::FieldWriteEventImpl(Thread* thread,
1283 void Instrumentation::ExceptionThrownEvent(Thread* thread,
1302 void Instrumentation::ExceptionHandledEvent(Thread* thread,
1319 size_t Instrumentation::ComputeFrameId(Thread* self,
1339 void Instrumentation::PushInstrumentationStackFrame(Thread* self, mirror::Object* this_object,
1343 std::deque<instrumentation::InstrumentationStackFrame>* stack = self->GetInstrumentationStack();
1349 // We send the enter event before pushing the instrumentation frame to make cleanup easier. If the
1365 instrumentation::InstrumentationStackFrame instrumentation_frame(h_this.Get(), method, lr,
1370 DeoptimizationMethodType Instrumentation::GetDeoptimizationMethodType(ArtMethod* method) {
1448 TwoWordReturn Instrumentation::PopInstrumentationStackFrame(Thread* self,
1455 std::deque<instrumentation::InstrumentationStackFrame>* stack = self->GetInstrumentationStack();
1563 uintptr_t Instrumentation::PopFramesForDeoptimization(Thread* self, size_t nframes) const {
1564 std::deque<instrumentation::InstrumentationStackFrame>* stack = self->GetInstrumentationStack();
1569 // Only need to send instrumentation events if it's not for deopt (do give the log messages if we
1570 // have verbose-instrumentation anyway though).
1576 // Now that we've sent all the instrumentation events we can actually modify the
1577 // instrumentation-stack. We cannot do this earlier since MethodUnwindEvent can re-enter java and
1578 // do other things that require the instrumentation stack to be in a consistent state with the
1595 } // namespace instrumentation