6#if defined(DART_HOST_OS_ANDROID)
9#include <sys/syscall.h>
24#if defined(HOST_ARCH_ARM) && \
25 (defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)) && \
27#define USE_SIGNAL_HANDLER_TRAMPOLINE
33#if defined(USE_SIGNAL_HANDLER_TRAMPOLINE)
36void ThreadInterruptSignalHandler(
int signal, siginfo_t*
info,
void* context_) {
37 if (signal != SIGPROF) {
41 if (thread ==
nullptr) {
44 ThreadInterruptScope signal_handler_scope;
46 ucontext_t* context =
reinterpret_cast<ucontext_t*
>(context_);
47 mcontext_t mcontext = context->uc_mcontext;
48 InterruptedThreadState its;
56#if defined(USE_SIGNAL_HANDLER_TRAMPOLINE)
62 if (FLAG_trace_thread_interrupter) {
64 reinterpret_cast<void*
>(thread->id()));
66 int result = syscall(__NR_tgkill, getpid(), thread->id(), SIGPROF);
70#if defined(USE_SIGNAL_HANDLER_TRAMPOLINE)
72extern "C" void ThreadInterruptSignalHandlerTrampoline(
int signal,
77void ThreadInterrupter::InstallSignalHandler() {
78#if defined(USE_SIGNAL_HANDLER_TRAMPOLINE)
85void ThreadInterrupter::RemoveSignalHandler() {
90 return SignalHandler::PrepareCurrentThread();
94 SignalHandler::CleanupCurrentThreadState(
state);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static void SampleThread(Thread *thread, const InterruptedThreadState &state)
static uintptr_t GetDartStackPointer(const mcontext_t &mcontext)
static uintptr_t GetCStackPointer(const mcontext_t &mcontext)
static uintptr_t GetFramePointer(const mcontext_t &mcontext)
static uintptr_t GetProgramCounter(const mcontext_t &mcontext)
static void Install(SignalAction action)
static uintptr_t GetLinkRegister(const mcontext_t &mcontext)
static void CleanupCurrentThreadState(void *state)
static void * PrepareCurrentThread()
static void InterruptThread(OSThread *thread)
static Thread * Current()
DECLARE_FLAG(bool, show_invisible_frames)