/system/core/libcutils/ |
D | sched_policy.c | 68 static int add_tid_to_cgroup(int tid, int fd) in add_tid_to_cgroup() argument 81 while (tid > 0) { in add_tid_to_cgroup() 82 *--ptr = '0' + (tid % 10); in add_tid_to_cgroup() 83 tid = tid / 10; in add_tid_to_cgroup() 145 static int getSchedulerGroup(int tid, char* buf, size_t bufLen) in getSchedulerGroup() argument 152 snprintf(pathBuf, sizeof(pathBuf), "/proc/%d/cgroup", tid); in getSchedulerGroup() 206 int get_sched_policy(int tid, SchedPolicy *policy) in get_sched_policy() argument 208 if (tid == 0) { in get_sched_policy() 209 tid = gettid(); in get_sched_policy() 215 if (getSchedulerGroup(tid, grpBuf, sizeof(grpBuf)) < 0) in get_sched_policy() [all …]
|
D | debugger.c | 45 static int make_dump_request(debugger_action_t action, pid_t tid, int timeout_secs) { in make_dump_request() argument 48 msg.tid = tid; in make_dump_request() 78 int dump_backtrace_to_file(pid_t tid, int fd) { in dump_backtrace_to_file() argument 79 return dump_backtrace_to_file_timeout(tid, fd, 0); in dump_backtrace_to_file() 82 int dump_backtrace_to_file_timeout(pid_t tid, int fd, int timeout_secs) { in dump_backtrace_to_file_timeout() argument 83 int sock_fd = make_dump_request(DEBUGGER_ACTION_DUMP_BACKTRACE, tid, timeout_secs); in dump_backtrace_to_file_timeout() 102 int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen) { in dump_tombstone() argument 103 return dump_tombstone_timeout(tid, pathbuf, pathlen, 0); in dump_tombstone() 106 int dump_tombstone_timeout(pid_t tid, char* pathbuf, size_t pathlen, int timeout_secs) { in dump_tombstone_timeout() argument 107 int sock_fd = make_dump_request(DEBUGGER_ACTION_DUMP_TOMBSTONE, tid, timeout_secs); in dump_tombstone_timeout()
|
/system/bt/utils/src/ |
D | bt_utils.c | 119 int tid = gettid(); in raise_priority_a2dp() local 128 rc = set_sched_policy(tid, SP_AUDIO_SYS); in raise_priority_a2dp() 130 g_TaskIDs[high_task] = tid; in raise_priority_a2dp() 134 LOG_WARN("failed to change sched policy, tid %d, err: %d", tid, errno); in raise_priority_a2dp() 144 if (setpriority(PRIO_PROCESS, tid, priority) < 0) { in raise_priority_a2dp() 145 LOG_WARN("failed to change priority tid: %d to %d", tid, priority); in raise_priority_a2dp() 162 int tid; in adjust_priority_a2dp() local 167 tid = g_TaskIDs[i]; in adjust_priority_a2dp() 168 if (tid != INVALID_TASK_ID) in adjust_priority_a2dp() 170 if (setpriority(PRIO_PROCESS, tid, priority) < 0) in adjust_priority_a2dp() [all …]
|
/system/core/debuggerd/ |
D | debuggerd.cpp | 60 pid_t pid, tid; member 91 request.pid, exe, request.tid); in wait_for_user_action() 109 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 111 snprintf(path, sizeof(path), "/proc/%d/status", tid); in get_process_info() 149 static bool selinux_action_allowed(int s, pid_t tid, debugger_action_t action) in selinux_action_allowed() argument 171 if (getpidcon(tid, &tcon) < 0) { in selinux_action_allowed() 172 ALOGE("Cannot get context for tid %d\n", tid); in selinux_action_allowed() 219 out_request->tid = msg.tid; in read_request() 230 snprintf(buf, sizeof buf, "/proc/%d/task/%d", out_request->pid, out_request->tid); in read_request() 233 out_request->tid, out_request->pid); in read_request() [all …]
|
D | backtrace.cpp | 71 log_t* log, pid_t tid, bool attached, bool* detach_failed, int* total_sleep_time_usec) { in dump_thread() argument 77 snprintf(path, sizeof(path), "/proc/%d/comm", tid); in dump_thread() 89 _LOG(log, logtype::BACKTRACE, "\n\"%s\" sysTid=%d\n", threadname ? threadname : "<unknown>", tid); in dump_thread() 91 if (!attached && ptrace(PTRACE_ATTACH, tid, 0, 0) < 0) { in dump_thread() 96 if (!attached && wait_for_sigstop(tid, total_sleep_time_usec, detach_failed) == -1) { in dump_thread() 100 std::unique_ptr<Backtrace> backtrace(Backtrace::Create(tid, BACKTRACE_CURRENT_THREAD)); in dump_thread() 104 ALOGE("Unwind failed: tid = %d", tid); in dump_thread() 107 if (!attached && ptrace(PTRACE_DETACH, tid, 0, 0) != 0) { in dump_thread() 108 _LOG(log, logtype::ERROR, "ptrace detach from %d failed: %s\n", tid, strerror(errno)); in dump_thread() 113 void dump_backtrace(int fd, int amfd, pid_t pid, pid_t tid, bool* detach_failed, in dump_backtrace() argument [all …]
|
D | utility.cpp | 82 int wait_for_sigstop(pid_t tid, int* total_sleep_time_usec, bool* detach_failed) { in wait_for_sigstop() argument 86 pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL | WNOHANG)); in wait_for_sigstop() 88 ALOGE("waitpid failed: tid %d, %s", tid, strerror(errno)); in wait_for_sigstop() 90 } else if (n == tid) { in wait_for_sigstop() 103 ALOGE("timed out waiting for stop signal: tid=%d", tid); in wait_for_sigstop() 111 if (ptrace(PTRACE_DETACH, tid, 0, 0) != 0) { in wait_for_sigstop() 113 ALOGE("tid exited before attach completed: tid %d", tid); in wait_for_sigstop() 116 ALOGE("detach failed: tid %d, %s", tid, strerror(errno)); in wait_for_sigstop()
|
D | tombstone.cpp | 179 static void dump_signal_info(log_t* log, pid_t tid, int signal, int si_code) { in dump_signal_info() argument 182 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si) == -1) { in dump_signal_info() 201 static void dump_thread_info(log_t* log, pid_t pid, pid_t tid) { in dump_thread_info() argument 207 snprintf(path, sizeof(path), "/proc/%d/comm", tid); in dump_thread_info() 234 _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", pid, tid, in dump_thread_info() 332 static void dump_all_maps(Backtrace* backtrace, BacktraceMap* map, log_t* log, pid_t tid) { in dump_all_maps() argument 337 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si) != -1) { in dump_all_maps() 341 _LOG(log, logtype::ERROR, "Cannot get siginfo for %d: %s\n", tid, strerror(errno)); in dump_all_maps() 422 log_t* log, pid_t pid, pid_t tid, int* total_sleep_time_usec, BacktraceMap* map) { in dump_sibling_thread_report() argument 445 if (*end || new_tid == tid) { in dump_sibling_thread_report() [all …]
|
/system/core/libutils/ |
D | ProcessCallStack.cpp | 79 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 …]
|
D | Threads.cpp | 305 int androidSetThreadPriority(pid_t tid, int pri) in androidSetThreadPriority() argument 313 rc = set_sched_policy(tid, SP_BACKGROUND); in androidSetThreadPriority() 314 } else if (getpriority(PRIO_PROCESS, tid) >= ANDROID_PRIORITY_BACKGROUND) { in androidSetThreadPriority() 315 rc = set_sched_policy(tid, SP_FOREGROUND); in androidSetThreadPriority() 322 if (setpriority(PRIO_PROCESS, tid, pri) < 0) { in androidSetThreadPriority() 332 int androidGetThreadPriority(pid_t tid) { in androidGetThreadPriority() argument 334 return getpriority(PRIO_PROCESS, tid); in androidGetThreadPriority() 846 pid_t tid; in getTid() local 849 tid = pthread_gettid_np(pthread); in getTid() 852 tid = -1; in getTid() [all …]
|
/system/core/libbacktrace/ |
D | Backtrace.cpp | 42 Backtrace::Backtrace(pid_t pid, pid_t tid, BacktraceMap* map) in Backtrace() argument 43 : pid_(pid), tid_(tid), map_(map), map_shared_(true) { in Backtrace() 127 Backtrace* Backtrace::Create(pid_t pid, pid_t tid, BacktraceMap* map) { in Create() argument 130 if (tid == BACKTRACE_CURRENT_THREAD) { in Create() 131 tid = gettid(); in Create() 133 } else if (tid == BACKTRACE_CURRENT_THREAD) { in Create() 134 tid = pid; in Create() 138 return new UnwindCurrent(pid, tid, map); in Create() 140 return new UnwindPtrace(pid, tid, map); in Create()
|
D | ThreadEntry.cpp | 33 ThreadEntry::ThreadEntry(pid_t pid, pid_t tid) in ThreadEntry() argument 34 : pid_(pid), tid_(tid), ref_count_(1), mutex_(PTHREAD_MUTEX_INITIALIZER), in ThreadEntry() 49 ThreadEntry* ThreadEntry::Get(pid_t pid, pid_t tid, bool create) { in Get() argument 53 if (entry->Match(pid, tid)) { in Get() 61 entry = new ThreadEntry(pid, tid); in Get()
|
D | thread_utils.c | 25 int tgkill(int tgid, int tid, int sig) { in tgkill() argument 26 return syscall(__NR_tgkill, tgid, tid, sig); in tgkill()
|
D | BacktracePtrace.h | 29 BacktracePtrace(pid_t pid, pid_t tid, BacktraceMap* map) : Backtrace(pid, tid, map) {} in BacktracePtrace() argument
|
D | UnwindCurrent.h | 36 UnwindCurrent(pid_t pid, pid_t tid, BacktraceMap* map) : BacktraceCurrent(pid, tid, map) {} in UnwindCurrent() argument
|
D | backtrace_test.cpp | 68 pid_t tid; member 199 void VerifyThreadTest(pid_t tid, void (*VerifyFunc)(Backtrace*)) { in VerifyThreadTest() argument 200 std::unique_ptr<Backtrace> backtrace(Backtrace::Create(getpid(), tid)); in VerifyThreadTest() 292 void VerifyProcTest(pid_t pid, pid_t tid, bool share_map, in VerifyProcTest() argument 296 if (tid < 0) { in VerifyProcTest() 299 ptrace_tid = tid; in VerifyProcTest() 314 std::unique_ptr<Backtrace> backtrace(Backtrace::Create(pid, tid, map.get())); in VerifyProcTest() 412 pid_t tid = strtoul(entry->d_name, &end, 10); in GetThreads() local 414 threads->push_back(tid); in GetThreads() 489 thread->tid = gettid(); in ThreadLevelRun() [all …]
|
/system/core/include/cutils/ |
D | debugger.h | 44 pid_t tid; member 53 int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen); 61 int dump_tombstone_timeout(pid_t tid, char* pathbuf, size_t pathlen, int timeout_secs); 66 int dump_backtrace_to_file(pid_t tid, int fd); 73 int dump_backtrace_to_file_timeout(pid_t tid, int fd, int timeout_secs);
|
D | sched_policy.h | 37 extern int set_cpuset_policy(int tid, SchedPolicy policy); 45 extern int set_sched_policy(int tid, SchedPolicy policy); 51 extern int get_sched_policy(int tid, SchedPolicy *policy);
|
/system/extras/latencytop/ |
D | latencytop.c | 46 …tency_entry *read_thread_stats(struct latency_entry *list, int erase, int pid, int tid, int fatal); 72 int pid, tid; in main() local 78 pid = tid = 0; in main() 114 tid = atoi(argv[++i]); in main() 122 if (tid && !pid) { in main() 147 if (tid) { in main() 148 e = read_thread_stats(e, erase, pid, tid, 1); in main() 159 if (tid) { in main() 160 printf("Latencies for thread %d in process %d:\n", tid, pid); in main() 207 int tid; in read_process_stats() local [all …]
|
/system/extras/perfprofd/quipper/kernel-headers/tools/perf/util/ |
D | event.h | 25 u32 pid, tid; member 35 u32 pid, tid; member 50 u32 pid, tid; member 57 u32 tid, ptid; member 70 u32 pid, tid; member 116 u32 pid, tid; member
|
/system/extras/simpleperf/ |
D | record.h | 44 uint32_t pid, tid; member 122 uint32_t pid, tid; member 141 uint32_t pid, tid; member 158 uint32_t tid, ptid; member 204 MmapRecord CreateMmapRecord(const perf_event_attr& attr, bool in_kernel, uint32_t pid, uint32_t tid, 207 CommRecord CreateCommRecord(const perf_event_attr& attr, uint32_t pid, uint32_t tid,
|
D | record.cpp | 141 PrintIndented(indent, "sample_id: pid %u, tid %u\n", tid_data.pid, tid_data.tid); in Dump() 185 PrintIndented(indent, "pid %u, tid %u, addr %p, len 0x%" PRIx64 "\n", data.pid, data.tid, in DumpData() 213 PrintIndented(indent, "pid %u, tid %u, comm %s\n", data.pid, data.tid, comm.c_str()); in DumpData() 237 PrintIndented(indent, "pid %u, ppid %u, tid %u, ptid %u\n", data.pid, data.ppid, data.tid, in DumpData() 284 PrintIndented(indent, "pid %u, tid %u\n", tid_data.pid, tid_data.tid); in DumpData() 355 MmapRecord CreateMmapRecord(const perf_event_attr& attr, bool in_kernel, uint32_t pid, uint32_t tid, in CreateMmapRecord() argument 362 record.data.tid = tid; in CreateMmapRecord() 373 CommRecord CreateCommRecord(const perf_event_attr& attr, uint32_t pid, uint32_t tid, in CreateCommRecord() argument 379 record.data.tid = tid; in CreateCommRecord()
|
/system/core/toolbox/ |
D | ps.c | 44 static int ps_line(int pid, int tid, char *namefilter) in ps_line() argument 63 if(tid) { in ps_line() 64 sprintf(statline, "/proc/%d/task/%d/stat", pid, tid); in ps_line() 66 snprintf(macline, sizeof(macline), "/proc/%d/task/%d/attr/current", pid, tid); in ps_line() 145 if(tid != 0) { in ps_line() 147 pid = tid; in ps_line() 255 int tid = atoi(de->d_name); in ps_threads() local 256 if(tid == pid) continue; in ps_threads() 257 ps_line(pid, tid, namefilter); in ps_threads()
|
D | top.c | 57 pid_t tid; member 102 static struct proc_info *find_old_proc(pid_t pid, pid_t tid); 229 pid_t pid, tid; in read_procs() local 257 proc->pid = proc->tid = pid; in read_procs() 290 tid = atoi(tid_dir->d_name); in read_procs() 294 proc->pid = pid; proc->tid = tid; in read_procs() 296 sprintf(filename, "/proc/%d/task/%d/stat", pid, tid); in read_procs() 299 read_policy(tid, proc); in read_procs() 424 old_proc = find_old_proc(new_procs[i]->pid, new_procs[i]->tid); in print_procs() 483 … proc->pid, proc->tid, proc->prs, proc->delta_time * 100 / total_delta_time, proc->state, in print_procs() [all …]
|
/system/core/logd/ |
D | LogBufferElement.cpp | 36 uid_t uid, pid_t pid, pid_t tid, in LogBufferElement() argument 41 mTid(tid), in LogBufferElement() 61 char *android::tidToName(pid_t tid) { in tidToName() argument 64 snprintf(buffer, sizeof(buffer), "/proc/%u/comm", tid); in tidToName() 82 char *name = android::pidToName(tid); in tidToName() 201 entry.tid = mTid; in flushTo()
|
/system/extras/perfprofd/quipper/original-kernel-headers/tools/perf/util/ |
D | event.h | 13 u32 pid, tid; member 22 u32 pid, tid; member 35 u32 pid, tid; member 42 u32 tid, ptid; member 57 u32 pid, tid; member 107 u32 pid, tid; member
|