Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: runtime/vm/thread_interrupter_android.cc

Issue 2682343002: Disable the profiler when a debugger is attached (Closed)
Patch Set: vegorov review Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/thread_interrupter.cc ('k') | runtime/vm/thread_interrupter_fuchsia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include <sys/syscall.h> // NOLINT 8 #include <sys/syscall.h> // NOLINT
9 #include <errno.h> // NOLINT 9 #include <errno.h> // NOLINT
10 10
(...skipping 29 matching lines...) Expand all
40 its.pc = SignalHandler::GetProgramCounter(mcontext); 40 its.pc = SignalHandler::GetProgramCounter(mcontext);
41 its.fp = SignalHandler::GetFramePointer(mcontext); 41 its.fp = SignalHandler::GetFramePointer(mcontext);
42 its.csp = SignalHandler::GetCStackPointer(mcontext); 42 its.csp = SignalHandler::GetCStackPointer(mcontext);
43 its.dsp = SignalHandler::GetDartStackPointer(mcontext); 43 its.dsp = SignalHandler::GetDartStackPointer(mcontext);
44 its.lr = SignalHandler::GetLinkRegister(mcontext); 44 its.lr = SignalHandler::GetLinkRegister(mcontext);
45 Profiler::SampleThread(thread, its); 45 Profiler::SampleThread(thread, its);
46 } 46 }
47 }; 47 };
48 48
49 49
50 bool ThreadInterrupter::IsDebuggerAttached() {
51 return false;
52 }
53
54
50 void ThreadInterrupter::InterruptThread(OSThread* thread) { 55 void ThreadInterrupter::InterruptThread(OSThread* thread) {
51 if (FLAG_trace_thread_interrupter) { 56 if (FLAG_trace_thread_interrupter) {
52 OS::Print("ThreadInterrupter interrupting %p\n", 57 OS::PrintErr("ThreadInterrupter interrupting %p\n",
53 reinterpret_cast<void*>(thread->id())); 58 reinterpret_cast<void*>(thread->id()));
54 } 59 }
55 int result = syscall(__NR_tgkill, getpid(), thread->id(), SIGPROF); 60 int result = syscall(__NR_tgkill, getpid(), thread->id(), SIGPROF);
56 ASSERT((result == 0) || (result == ESRCH)); 61 ASSERT((result == 0) || (result == ESRCH));
57 } 62 }
58 63
59 64
60 void ThreadInterrupter::InstallSignalHandler() { 65 void ThreadInterrupter::InstallSignalHandler() {
61 SignalHandler::Install< 66 SignalHandler::Install<
62 ThreadInterrupterAndroid::ThreadInterruptSignalHandler>(); 67 ThreadInterrupterAndroid::ThreadInterruptSignalHandler>();
63 } 68 }
64 69
65 70
66 void ThreadInterrupter::RemoveSignalHandler() { 71 void ThreadInterrupter::RemoveSignalHandler() {
67 SignalHandler::Remove(); 72 SignalHandler::Remove();
68 } 73 }
69 74
70 #endif // !PRODUCT 75 #endif // !PRODUCT
71 76
72 } // namespace dart 77 } // namespace dart
73 78
74 #endif // defined(TARGET_OS_ANDROID) 79 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/vm/thread_interrupter.cc ('k') | runtime/vm/thread_interrupter_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698