Home
last modified time | relevance | path

Searched refs:tid (Results 1 – 25 of 55) sorted by relevance

123

/system/core/libcutils/
Dsched_policy.c68 static int add_tid_to_cgroup(int tid, SchedPolicy policy) in add_tid_to_cgroup() argument
101 while (tid > 0) { in add_tid_to_cgroup()
102 *--ptr = '0' + (tid % 10); in add_tid_to_cgroup()
103 tid = tid / 10; in add_tid_to_cgroup()
161 static int getSchedulerGroup(int tid, char* buf, size_t bufLen) in getSchedulerGroup() argument
168 snprintf(pathBuf, sizeof(pathBuf), "/proc/%d/cgroup", tid); in getSchedulerGroup()
222 int get_sched_policy(int tid, SchedPolicy *policy) in get_sched_policy() argument
225 if (tid == 0) { in get_sched_policy()
226 tid = gettid(); in get_sched_policy()
233 if (getSchedulerGroup(tid, grpBuf, sizeof(grpBuf)) < 0) in get_sched_policy()
[all …]
Ddebugger.c30 static bool is32bit(pid_t tid) { in is32bit() argument
32 if (asprintf(&exeline, "/proc/%d/exe", tid) == -1) { in is32bit()
67 static int make_dump_request(debugger_action_t action, pid_t tid) { in make_dump_request() argument
75 if (is32bit(tid)) { in make_dump_request()
78 msg32.tid = tid; in make_dump_request()
88 msg.tid = tid; in make_dump_request()
109 int dump_backtrace_to_file(pid_t tid, int fd) { in dump_backtrace_to_file() argument
110 int sock_fd = make_dump_request(DEBUGGER_ACTION_DUMP_BACKTRACE, tid); in dump_backtrace_to_file()
129 int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen) { in dump_tombstone() argument
130 int sock_fd = make_dump_request(DEBUGGER_ACTION_DUMP_TOMBSTONE, tid); in dump_tombstone()
/system/core/debuggerd/
Ddebuggerd.cpp50 pid_t pid, tid; member
81 request.pid, exe, request.tid); in wait_for_user_action()
99 static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* out_gid) { in get_process_info() argument
101 snprintf(path, sizeof(path), "/proc/%d/status", tid); in get_process_info()
162 out_request->tid = msg.tid; in read_request()
173 snprintf(buf, sizeof buf, "/proc/%d/task/%d", out_request->pid, out_request->tid); in read_request()
176 out_request->tid, out_request->pid); in read_request()
183 status = get_process_info(out_request->tid, &out_request->pid, in read_request()
186 ALOGE("tid %d does not exist. ignoring explicit dump request\n", out_request->tid); in read_request()
214 request.pid, request.uid, request.gid, request.tid); in handle_request()
[all …]
Dbacktrace.cpp66 log_t* log, pid_t tid, bool attached, bool* detach_failed, int* total_sleep_time_usec) { in dump_thread() argument
72 snprintf(path, sizeof(path), "/proc/%d/comm", tid); in dump_thread()
84 _LOG(log, logtype::BACKTRACE, "\n\"%s\" sysTid=%d\n", threadname ? threadname : "<unknown>", tid); in dump_thread()
86 if (!attached && ptrace(PTRACE_ATTACH, tid, 0, 0) < 0) { in dump_thread()
91 wait_for_stop(tid, total_sleep_time_usec); in dump_thread()
93 UniquePtr<Backtrace> backtrace(Backtrace::Create(tid, BACKTRACE_CURRENT_THREAD)); in dump_thread()
98 if (!attached && ptrace(PTRACE_DETACH, tid, 0, 0) != 0) { in dump_thread()
99 _LOG(log, logtype::ERROR, "ptrace detach from %d failed: %s\n", tid, strerror(errno)); in dump_thread()
104 void dump_backtrace(int fd, int amfd, pid_t pid, pid_t tid, bool* detach_failed, in dump_backtrace() argument
111 dump_thread(&log, tid, true, detach_failed, total_sleep_time_usec); in dump_backtrace()
[all …]
Dutility.cpp94 int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { in wait_for_signal() argument
97 pid_t n = waitpid(tid, &status, __WALL | WNOHANG); in wait_for_signal()
114 ALOGE("timed out waiting for tid=%d to die\n", tid); in wait_for_signal()
125 void wait_for_stop(pid_t tid, int* total_sleep_time_usec) { in wait_for_stop() argument
127 while (TEMP_FAILURE_RETRY(ptrace(PTRACE_GETSIGINFO, tid, 0, &si)) < 0 && errno == ESRCH) { in wait_for_stop()
129 ALOGE("timed out waiting for tid=%d to stop\n", tid); in wait_for_stop()
144 void dump_memory(log_t* log, pid_t tid, uintptr_t addr) { in dump_memory() argument
176 long data = ptrace(PTRACE_PEEKTEXT, tid, (void*)p, NULL); in dump_memory()
Dutility.h74 int wait_for_signal(pid_t tid, int* total_sleep_time_usec);
75 void wait_for_stop(pid_t tid, int* total_sleep_time_usec);
77 void dump_memory(log_t* log, pid_t tid, uintptr_t addr);
Dmachine.h24 void dump_memory_and_code(log_t* log, pid_t tid);
25 void dump_registers(log_t* log, pid_t tid);
Dtombstone.cpp175 static void dump_signal_info(log_t* log, pid_t tid, int signal, int si_code) { in dump_signal_info() argument
178 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si) == -1) { in dump_signal_info()
197 static void dump_thread_info(log_t* log, pid_t pid, pid_t tid) { in dump_thread_info() argument
203 snprintf(path, sizeof(path), "/proc/%d/comm", tid); in dump_thread_info()
230 _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", pid, tid, in dump_thread_info()
346 static void dump_nearby_maps(BacktraceMap* map, log_t* log, pid_t tid) { in dump_nearby_maps() argument
349 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si)) { in dump_nearby_maps()
350 _LOG(log, logtype::MAPS, "cannot get siginfo for %d: %s\n", tid, strerror(errno)); in dump_nearby_maps()
391 log_t* log, pid_t pid, pid_t tid, int* total_sleep_time_usec, BacktraceMap* map) { in dump_sibling_thread_report() argument
414 if (*end || new_tid == tid) { in dump_sibling_thread_report()
[all …]
/system/core/libutils/
DProcessCallStack.cpp79 static String8 getThreadName(pid_t tid) { in getThreadName() argument
85 snprintf(path, sizeof(path), PATH_THREAD_NAME, tid); in getThreadName()
95 return String8::format("[err-unknown-tid-%d]", tid); in getThreadName()
163 pid_t tid = -1; in update() local
164 sscanf(ep->d_name, "%d", &tid); in update()
166 if (tid < 0) { in update()
173 ssize_t idx = mThreadMap.add(tid, ThreadInfo()); in update()
186 int ignoreDepth = (selfPid == tid) ? IGNORE_DEPTH_CURRENT_THREAD : 0; in update()
189 threadInfo.callStack.update(ignoreDepth, tid); in update()
192 threadInfo.threadName = getThreadName(tid); in update()
[all …]
/system/core/toolbox/
Dschedtop.c16 int tid; member
91 static void add_thread(int pid, int tid, struct thread_info *proc_info) in add_thread() argument
97 if(tid == 0) in add_thread()
102 info->tid = tid; in add_thread()
104 if(tid) in add_thread()
105 sprintf(line, "/proc/%d/task/%d/schedstat", pid, tid); in add_thread()
120 if (!tid) { in add_thread()
128 if (tid) in add_thread()
129 sprintf(line, "/proc/%d/task/%d/stat", pid, tid); in add_thread()
147 if(tid == 0) in add_thread()
[all …]
Dps.c38 static int ps_line(int pid, int tid, char *namefilter) in ps_line() argument
56 if(tid) { in ps_line()
57 sprintf(statline, "/proc/%d/task/%d/stat", pid, tid); in ps_line()
59 snprintf(macline, sizeof(macline), "/proc/%d/task/%d/attr/current", pid, tid); in ps_line()
138 if(tid != 0) { in ps_line()
140 pid = tid; in ps_line()
235 int tid = atoi(de->d_name); in ps_threads() local
236 if(tid == pid) continue; in ps_threads()
237 ps_line(pid, tid, namefilter); in ps_threads()
Dtop.c56 pid_t tid; member
101 static struct proc_info *find_old_proc(pid_t pid, pid_t tid);
234 pid_t pid, tid; in read_procs() local
262 proc->pid = proc->tid = pid; in read_procs()
295 tid = atoi(tid_dir->d_name); in read_procs()
299 proc->pid = pid; proc->tid = tid; in read_procs()
301 sprintf(filename, "/proc/%d/task/%d/stat", pid, tid); in read_procs()
304 read_policy(tid, proc); in read_procs()
420 old_proc = find_old_proc(new_procs[i]->pid, new_procs[i]->tid); in print_procs()
477 …printf("%5d %5d %2d %3ld%% %c %6ldK %6ldK %3s %-8.8s %-15s %s\n", proc->pid, proc->tid, proc->prs,… in print_procs()
[all …]
/system/core/debuggerd/arm/
Dmachine.cpp30 void dump_memory_and_code(log_t* log, pid_t tid) { in dump_memory_and_code() argument
32 if (ptrace(PTRACE_GETREGS, tid, 0, &regs)) { in dump_memory_and_code()
49 dump_memory(log, tid, addr); in dump_memory_and_code()
54 dump_memory(log, tid, static_cast<uintptr_t>(regs.ARM_pc)); in dump_memory_and_code()
58 dump_memory(log, tid, static_cast<uintptr_t>(regs.ARM_lr)); in dump_memory_and_code()
62 void dump_registers(log_t* log, pid_t tid) { in dump_registers() argument
64 if (ptrace(PTRACE_GETREGS, tid, 0, &r)) { in dump_registers()
84 if (ptrace(PTRACE_GETVFPREGS, tid, 0, &vfp_regs)) { in dump_registers()
/system/core/debuggerd/arm64/
Dmachine.cpp30 void dump_memory_and_code(log_t* log, pid_t tid) { in dump_memory_and_code() argument
36 if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, &io) == -1) { in dump_memory_and_code()
54 dump_memory(log, tid, addr); in dump_memory_and_code()
58 dump_memory(log, tid, (uintptr_t)regs.pc); in dump_memory_and_code()
62 dump_memory(log, tid, (uintptr_t)regs.sp); in dump_memory_and_code()
66 void dump_registers(log_t* log, pid_t tid) { in dump_registers() argument
72 if (ptrace(PTRACE_GETREGSET, tid, (void*) NT_PRSTATUS, (void*) &io) == -1) { in dump_registers()
96 if (ptrace(PTRACE_GETREGSET, tid, (void*) NT_PRFPREG, (void*) &io) == -1) { in dump_registers()
/system/core/include/cutils/
Ddebugger.h46 pid_t tid; member
55 pid_t tid; member
65 int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen);
70 int dump_backtrace_to_file(pid_t tid, int fd);
Dsched_policy.h43 extern int set_sched_policy(int tid, SchedPolicy policy);
49 extern int get_sched_policy(int tid, SchedPolicy *policy);
/system/core/libbacktrace/
DBacktraceImpl.cpp165 BacktraceImpl* impl, pid_t pid, pid_t tid, BacktraceMap* map) in BacktracePtrace() argument
167 tid_ = tid; in BacktracePtrace()
195 Backtrace* Backtrace::Create(pid_t pid, pid_t tid, BacktraceMap* map) { in Create() argument
197 if (tid == BACKTRACE_CURRENT_THREAD || tid == gettid()) { in Create()
200 return CreateThreadObj(tid, map); in Create()
202 } else if (tid == BACKTRACE_CURRENT_THREAD) { in Create()
205 return CreatePtraceObj(pid, tid, map); in Create()
DBacktraceThread.cpp47 ThreadEntry::ThreadEntry(pid_t pid, pid_t tid) in ThreadEntry() argument
48 …: pid_(pid), tid_(tid), futex_(0), ref_count_(1), mutex_(PTHREAD_MUTEX_INITIALIZER), next_(ThreadE… in ThreadEntry()
56 ThreadEntry* ThreadEntry::Get(pid_t pid, pid_t tid, bool create) { in Get() argument
60 if (entry->Match(pid, tid)) { in Get()
68 entry = new ThreadEntry(pid, tid); in Get()
150 BacktraceThread::BacktraceThread(BacktraceImpl* impl, pid_t tid, BacktraceMap* map) in BacktraceThread() argument
152 tid_ = tid; in BacktraceThread()
Dbacktrace_test.cpp60 pid_t tid; member
182 void VerifyThreadTest(pid_t tid, void (*VerifyFunc)(Backtrace*)) { in VerifyThreadTest() argument
183 UniquePtr<Backtrace> backtrace(Backtrace::Create(getpid(), tid)); in VerifyThreadTest()
255 void VerifyProcTest(pid_t pid, pid_t tid, bool share_map, in VerifyProcTest() argument
259 if (tid < 0) { in VerifyProcTest()
262 ptrace_tid = tid; in VerifyProcTest()
276 UniquePtr<Backtrace> backtrace(Backtrace::Create(pid, tid, map.get())); in VerifyProcTest()
372 pid_t tid = strtoul(entry->d_name, &end, 10); in GetThreads() local
374 threads->push_back(tid); in GetThreads()
449 thread->tid = gettid(); in ThreadLevelRun()
[all …]
DBacktraceThread.h39 static ThreadEntry* Get(pid_t pid, pid_t tid, bool create = true);
62 ThreadEntry(pid_t pid, pid_t tid);
82 BacktraceThread(BacktraceImpl* impl, pid_t tid, BacktraceMap* map);
Dthread_utils.c38 int tgkill(int tgid, int tid, int sig) { in tgkill() argument
39 return syscall(__NR_tgkill, tgid, tid, sig); in tgkill()
DBacktraceImpl.h64 BacktracePtrace(BacktraceImpl* impl, pid_t pid, pid_t tid, BacktraceMap* map);
71 Backtrace* CreatePtraceObj(pid_t pid, pid_t tid, BacktraceMap* map);
72 Backtrace* CreateThreadObj(pid_t tid, BacktraceMap* map);
/system/core/debuggerd/mips/
Dmachine.cpp46 void dump_memory_and_code(log_t* log, pid_t tid) { in dump_memory_and_code() argument
48 if (ptrace(PTRACE_GETREGS, tid, 0, &r)) { in dump_memory_and_code()
72 dump_memory(log, tid, addr); in dump_memory_and_code()
79 dump_memory(log, tid, (uintptr_t)pc); in dump_memory_and_code()
83 dump_memory(log, tid, (uintptr_t)ra); in dump_memory_and_code()
87 void dump_registers(log_t* log, pid_t tid) { in dump_registers() argument
89 if(ptrace(PTRACE_GETREGS, tid, 0, &r)) { in dump_registers()
/system/extras/latencytop/
Dlatencytop.c45 …tency_entry *read_thread_stats(struct latency_entry *list, int erase, int pid, int tid, int fatal);
71 int pid, tid; in main() local
77 pid = tid = 0; in main()
113 tid = atoi(argv[++i]); in main()
121 if (tid && !pid) { in main()
146 if (tid) { in main()
147 e = read_thread_stats(e, erase, pid, tid, 1); in main()
158 if (tid) { in main()
159 printf("Latencies for thread %d in process %d:\n", tid, pid); in main()
206 int tid; in read_process_stats() local
[all …]
/system/core/logd/
DLogBufferElement.cpp30 uid_t uid, pid_t pid, pid_t tid, in LogBufferElement() argument
35 , mTid(tid) in LogBufferElement()
54 entry.tid = mTid; in flushTo()

123