| Index: runtime/vm/thread_interrupter_linux.cc
|
| diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_linux.cc
|
| index d7b9b8532abf2e3fd05d76603f5ff89e81dedf69..2cb0f55764c7c256a57886ceea4f65abbc30a3f8 100644
|
| --- a/runtime/vm/thread_interrupter_linux.cc
|
| +++ b/runtime/vm/thread_interrupter_linux.cc
|
| @@ -5,8 +5,11 @@
|
| #include "platform/globals.h"
|
| #if defined(TARGET_OS_LINUX)
|
|
|
| +#include <errno.h> // NOLINT
|
| +
|
| #include "vm/flags.h"
|
| #include "vm/os.h"
|
| +#include "vm/profiler.h"
|
| #include "vm/signal_handler.h"
|
| #include "vm/thread_interrupter.h"
|
|
|
| @@ -26,22 +29,16 @@ class ThreadInterrupterLinux : public AllStatic {
|
| if (thread == NULL) {
|
| return;
|
| }
|
| - ThreadInterruptCallback callback = NULL;
|
| - void* callback_data = NULL;
|
| - if (!thread->IsThreadInterrupterEnabled(&callback, &callback_data)) {
|
| - return;
|
| - }
|
| // Extract thread state.
|
| ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
|
| mcontext_t mcontext = context->uc_mcontext;
|
| InterruptedThreadState its;
|
| - its.tid = thread->id();
|
| its.pc = SignalHandler::GetProgramCounter(mcontext);
|
| its.fp = SignalHandler::GetFramePointer(mcontext);
|
| its.csp = SignalHandler::GetCStackPointer(mcontext);
|
| its.dsp = SignalHandler::GetDartStackPointer(mcontext);
|
| its.lr = SignalHandler::GetLinkRegister(mcontext);
|
| - callback(its, callback_data);
|
| + Profiler::SampleThread(thread, its);
|
| }
|
| };
|
|
|
| @@ -52,7 +49,7 @@ void ThreadInterrupter::InterruptThread(Thread* thread) {
|
| reinterpret_cast<void*>(thread->id()));
|
| }
|
| int result = pthread_kill(thread->id(), SIGPROF);
|
| - ASSERT(result == 0);
|
| + ASSERT((result == 0) || (result == ESRCH));
|
| }
|
|
|
|
|
|
|