Lines Matching refs:tid
81 bool ReleaseThread(pid_t tid);
86 int CaptureThread(pid_t tid);
87 bool ReleaseThread(pid_t tid, unsigned int signal);
88 int PtraceAttach(pid_t tid);
89 void PtraceDetach(pid_t tid, unsigned int signal);
90 bool PtraceThreadInfo(pid_t tid, ThreadInfo& thread_info);
138 pid_t tid = atoi(dirent->d_name); in ListThreads() local
139 if (tid <= 0) { in ListThreads()
142 tids.push_back(tid); in ListThreads()
179 void ThreadCaptureImpl::PtraceDetach(pid_t tid, unsigned int signal) { in PtraceDetach() argument
181 if (ptrace(PTRACE_DETACH, tid, NULL, sig_ptr) < 0 && errno != ESRCH) { in PtraceDetach()
182 MEM_ALOGE("failed to detach from thread %d of process %d: %s", tid, pid_, strerror(errno)); in PtraceDetach()
188 int ThreadCaptureImpl::PtraceAttach(pid_t tid) { in PtraceAttach() argument
189 int ret = ptrace(PTRACE_SEIZE, tid, NULL, NULL); in PtraceAttach()
191 MEM_ALOGE("failed to attach to thread %d of process %d: %s", tid, pid_, strerror(errno)); in PtraceAttach()
196 inject_test_func_(tid); in PtraceAttach()
199 if (ptrace(PTRACE_INTERRUPT, tid, 0, 0) < 0) { in PtraceAttach()
203 MEM_ALOGE("failed to interrupt thread %d of process %d: %s", tid, pid_, strerror(errno)); in PtraceAttach()
204 PtraceDetach(tid, 0); in PtraceAttach()
211 bool ThreadCaptureImpl::PtraceThreadInfo(pid_t tid, ThreadInfo& thread_info) { in PtraceThreadInfo() argument
212 thread_info.tid = tid; in PtraceThreadInfo()
220 if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(NT_PRSTATUS), &iovec)) { in PtraceThreadInfo()
221 … MEM_ALOGE("ptrace getregset for thread %d of process %d failed: %s", tid, pid_, strerror(errno)); in PtraceThreadInfo()
251 int ThreadCaptureImpl::CaptureThread(pid_t tid) { in CaptureThread() argument
252 int ret = PtraceAttach(tid); in CaptureThread()
258 if (TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL)) < 0) { in CaptureThread()
259 … MEM_ALOGE("failed to wait for pause of thread %d of process %d: %s", tid, pid_, strerror(errno)); in CaptureThread()
260 PtraceDetach(tid, 0); in CaptureThread()
265 MEM_ALOGE("thread %d of process %d was not paused after waitpid, killed?", tid, pid_); in CaptureThread()
285 tid, pid_); in CaptureThread()
293 captured_threads_[tid] = resume_signal; in CaptureThread()
297 bool ThreadCaptureImpl::ReleaseThread(pid_t tid) { in ReleaseThread() argument
298 auto it = captured_threads_.find(tid); in ReleaseThread()
305 bool ThreadCaptureImpl::ReleaseThread(pid_t tid, unsigned int signal) { in ReleaseThread() argument
306 PtraceDetach(tid, signal); in ReleaseThread()
355 bool ThreadCapture::ReleaseThread(pid_t tid) { in ReleaseThread() argument
356 return impl_->ReleaseThread(tid); in ReleaseThread()