/system/core/libprocessgroup/ |
D | sched_policy.cpp | 41 int set_cpuset_policy(int tid, SchedPolicy policy) { in set_cpuset_policy() argument 42 if (tid == 0) { in set_cpuset_policy() 43 tid = GetThreadId(); in set_cpuset_policy() 49 return SetTaskProfiles(tid, {"CPUSET_SP_BACKGROUND"}, true) ? 0 : -1; in set_cpuset_policy() 53 return SetTaskProfiles(tid, {"CPUSET_SP_FOREGROUND"}, true) ? 0 : -1; in set_cpuset_policy() 55 return SetTaskProfiles(tid, {"CPUSET_SP_TOP_APP"}, true) ? 0 : -1; in set_cpuset_policy() 57 return SetTaskProfiles(tid, {"CPUSET_SP_SYSTEM"}, true) ? 0 : -1; in set_cpuset_policy() 59 return SetTaskProfiles(tid, {"CPUSET_SP_RESTRICTED"}, true) ? 0 : -1; in set_cpuset_policy() 67 int set_sched_policy(int tid, SchedPolicy policy) { in set_sched_policy() argument 68 if (tid == 0) { in set_sched_policy() [all …]
|
D | task_profiles.cpp | 52 bool ProfileAttribute::GetPathForTask(int tid, std::string* path) const { in GetPathForTask() argument 54 if (!controller()->GetTaskGroup(tid, &subgroup)) { in GetPathForTask() 86 bool SetTimerSlackAction::IsTimerSlackSupported(int tid) { in IsTimerSlackSupported() argument 87 auto file = StringPrintf("/proc/%d/timerslack_ns", tid); in IsTimerSlackSupported() 92 bool SetTimerSlackAction::ExecuteForTask(int tid) const { in ExecuteForTask() 93 static bool sys_supports_timerslack = IsTimerSlackSupported(tid); in ExecuteForTask() 98 auto file = StringPrintf("/proc/%d/timerslack_ns", tid); in ExecuteForTask() 109 if (tid == 0 || tid == GetThreadId()) { in ExecuteForTask() 124 bool SetAttributeAction::ExecuteForTask(int tid) const { in ExecuteForTask() 127 if (!attribute_->GetPathForTask(tid, &path)) { in ExecuteForTask() [all …]
|
D | task_profiles.h | 38 bool GetPathForTask(int tid, std::string* path) const; 64 virtual bool ExecuteForTask(int tid) const; 78 virtual bool ExecuteForTask(int tid) const; 83 static bool IsTimerSlackSupported(int tid); 104 virtual bool ExecuteForTask(int tid) const; 117 virtual bool ExecuteForTask(int tid) const; 137 static bool AddTidToCgroup(int tid, int fd); 150 bool ExecuteForTask(int tid) const; 166 virtual bool ExecuteForTask(int tid) const; 183 bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use_fd_cache);
|
/system/memory/libmemunreachable/ |
D | ThreadCapture.cpp | 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 [all …]
|
/system/core/debuggerd/handler/ |
D | debuggerd_fallback.cpp | 83 thread.tid = gettid(); in debuggerd_fallback_trace() 125 long tid = strtol(ent->d_name, &end, 10); in iterate_siblings() local 130 if (tid != current_tid) { in iterate_siblings() 131 callback(tid, output_fd); in iterate_siblings() 148 pid_t tid; in forward_output() local 149 if (TEMP_FAILURE_RETRY(read(src_fd, &tid, sizeof(tid))) != sizeof(tid)) { in forward_output() 154 if (tid != expected_tid) { in forward_output() 155 async_safe_format_log(ANDROID_LOG_ERROR, "libc", "received tid %d, expected %d", tid, in forward_output() 178 int32_t tid; member 182 static uint64_t pack_thread_fd(pid_t tid, int fd) { in pack_thread_fd() argument [all …]
|
/system/nfc/src/nfc/llcp/ |
D | llcp_sdp.cc | 103 static void llcp_sdp_add_sdreq(uint8_t tid, char* p_name) { in llcp_sdp_add_sdreq() argument 112 UINT8_TO_BE_STREAM(p, tid); in llcp_sdp_add_sdreq() 128 tLLCP_STATUS llcp_sdp_send_sdreq(uint8_t tid, char* p_name) { in llcp_sdp_send_sdreq() argument 134 << StringPrintf("tid=0x%x, ServiceName=%s", tid, p_name); in llcp_sdp_send_sdreq() 157 llcp_sdp_add_sdreq(tid, p_name); in llcp_sdp_send_sdreq() 170 llcp_sdp_add_sdreq(tid, p_name); in llcp_sdp_send_sdreq() 200 static void llcp_sdp_add_sdres(uint8_t tid, uint8_t sap) { in llcp_sdp_add_sdres() argument 208 UINT8_TO_BE_STREAM(p, tid); in llcp_sdp_add_sdres() 224 static tLLCP_STATUS llcp_sdp_send_sdres(uint8_t tid, uint8_t sap) { in llcp_sdp_send_sdres() argument 229 << StringPrintf("tid=0x%x, SAP=0x%x", tid, sap); in llcp_sdp_send_sdres() [all …]
|
/system/extras/simpleperf/ |
D | cmd_stat_test.cpp | 218 std::atomic<int> tid(0); in TEST() local 220 tid = gettid(); in TEST() 224 while (tid == 0); in TEST() 225 ASSERT_TRUE(StatCmd()->Run({"-t", std::to_string(tid), "--in-app"})); in TEST() 380 int tid = 0; member 392 if (thread_map_.count(arg.tid) == 0) { in AddCounter() 393 ThreadInfo& thread = thread_map_[arg.tid]; in AddCounter() 394 thread.pid = thread.tid = arg.tid; in AddCounter() 395 thread.name = "thread" + std::to_string(arg.tid); in AddCounter() 405 counter.tid = arg.tid; in AddCounter() [all …]
|
D | CallChainJoiner.cpp | 45 void LRUCache::AddCallChain(pid_t tid, std::vector<uint64_t>& ips, std::vector<uint64_t>& sps) { in AddCallChain() argument 49 CacheNode* node = GetNode(tid, ips[i], sps[i]); in AddCallChain() 105 return n1->tid == n2->tid && n1->ip == n2->ip && n1->sp == n2->sp; in CacheNodeEqual() 109 return static_cast<size_t>(n->tid ^ n->ip ^ n->sp); in CacheNodeHash() 112 CacheNode* LRUCache::GetNode(uint32_t tid, uint64_t ip, uint64_t sp) { in GetNode() argument 113 CacheNode* node = FindNode(tid, ip, sp); in GetNode() 123 node->tid = tid; in GetNode() 177 static bool WriteCallChain(FILE* fp, pid_t pid, pid_t tid, CallChainJoiner::ChainType type, in WriteCallChain() argument 193 MoveToBinaryFormat(tid, p); in WriteCallChain() 206 static bool ReadCallChain(FILE* fp, pid_t& pid, pid_t& tid, CallChainJoiner::ChainType& type, in ReadCallChain() argument [all …]
|
D | thread_tree.cpp | 31 void ThreadTree::SetThreadName(int pid, int tid, const std::string& comm) { in SetThreadName() argument 32 ThreadEntry* thread = FindThreadOrNew(pid, tid); in SetThreadName() 40 void ThreadTree::ForkThread(int pid, int tid, int ppid, int ptid) { in ForkThread() argument 42 ThreadEntry* child = FindThreadOrNew(pid, tid); in ForkThread() 57 ThreadEntry* ThreadTree::FindThread(int tid) { in FindThread() argument 58 if (auto it = thread_tree_.find(tid); it != thread_tree_.end()) { in FindThread() 64 ThreadEntry* ThreadTree::FindThreadOrNew(int pid, int tid) { in FindThreadOrNew() argument 65 auto it = thread_tree_.find(tid); in FindThreadOrNew() 70 ExitThread(it->second.get()->pid, tid); in FindThreadOrNew() 72 return CreateThread(pid, tid); in FindThreadOrNew() [all …]
|
D | CallChainJoiner.h | 36 uint32_t tid; member 73 void AddCallChain(pid_t tid, std::vector<uint64_t>& ips, std::vector<uint64_t>& sps); 79 CacheNode* FindNode(uint32_t tid, uint64_t ip, uint64_t sp) { in FindNode() argument 81 key.tid = tid; in FindNode() 125 CacheNode* GetNode(uint32_t tid, uint64_t ip, uint64_t sp); 158 bool AddCallChain(pid_t pid, pid_t tid, ChainType type, const std::vector<uint64_t>& ips, 161 bool GetNextCallChain(pid_t& pid, pid_t& tid, ChainType& type, std::vector<uint64_t>& ips,
|
/system/libbase/ |
D | threads.cpp | 37 uint64_t tid; in GetThreadId() 38 pthread_threadid_np(NULL, &tid); in GetThreadId() 39 return tid; in GetThreadId() 51 int tgkill(int tgid, int tid, int sig) { in tgkill() argument 52 return syscall(__NR_tgkill, tgid, tid, sig); in tgkill()
|
/system/extras/memory_replay/ |
D | Threads.cpp | 72 Thread* Threads::CreateThread(pid_t tid) { in CreateThread() argument 76 Thread* thread = FindEmptyEntry(tid); in CreateThread() 81 thread->tid_ = tid; in CreateThread() 85 err(1, "Failed to create thread %d: %s\n", tid, strerror(errno)); in CreateThread() 92 Thread* Threads::FindThread(pid_t tid) { in FindThread() argument 93 size_t index = GetHashEntry(tid); in FindThread() 96 if (cur_tid == tid) { in FindThread() 119 size_t Threads::GetHashEntry(pid_t tid) { in GetHashEntry() argument 120 return tid % max_threads_; in GetHashEntry() 123 Thread* Threads::FindEmptyEntry(pid_t tid) { in FindEmptyEntry() argument [all …]
|
D | Threads.h | 31 Thread* CreateThread(pid_t tid); 32 Thread* FindThread(pid_t tid); 49 Thread* FindEmptyEntry(pid_t tid); 50 size_t GetHashEntry(pid_t tid);
|
/system/core/libutils/ |
D | ProcessCallStack.cpp | 77 static String8 getThreadName(pid_t tid) { in getThreadName() argument 83 snprintf(path, sizeof(path), PATH_THREAD_NAME, tid); in getThreadName() 93 return String8::format("[err-unknown-tid-%d]", tid); in getThreadName() 156 pid_t tid = -1; in update() local 157 sscanf(ep->d_name, "%d", &tid); in update() 159 if (tid < 0) { in update() 166 ssize_t idx = mThreadMap.add(tid, ThreadInfo()); in update() 179 int ignoreDepth = (selfPid == tid) ? IGNORE_DEPTH_CURRENT_THREAD : 0; in update() 182 threadInfo.callStack.update(ignoreDepth, tid); in update() 185 threadInfo.threadName = getThreadName(tid); in update() [all …]
|
/system/extras/memory_replay/traces/ |
D | README | 9 <tid>: <action_name> <ptr> [<optional_arguments>] 11 <tid> 22 thread_done - Terminate the thread with the given tid. 26 <tid>: malloc <ptr> <size> 33 <tid>: calloc <ptr> <nmemb> <size> 41 <tid>:realloc <new_ptr> <old_ptr> <size> 50 <tid>:memalign <ptr> <alignment> <size> 58 <tid>: free <ptr> 66 <tid>: thread_done 0x0 67 Indicates that the thread <tid> has completed.
|
/system/core/logd/ |
D | SerializedLogEntry.h | 36 SerializedLogEntry(uid_t uid, pid_t pid, pid_t tid, uint64_t sequence, log_time realtime, in SerializedLogEntry() argument 40 tid_(tid), in SerializedLogEntry() 55 .tid = tid(), in ToLogStatisticsElement() 72 entry.tid = tid(); in Flush() 83 pid_t tid() const { return tid_; } in tid() function
|
D | RecordingLogBuffer.cpp | 27 pid_t tid, const char* msg, uint16_t len) { in RecordLogMessage() argument 36 .tid = static_cast<uint32_t>(tid), in RecordLogMessage() 58 int RecordingLogBuffer::Log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, pid_t tid, in Log() argument 60 RecordLogMessage(log_id, realtime, uid, pid, tid, msg, len); in Log() 61 return SimpleLogBuffer::Log(log_id, realtime, uid, pid, tid, msg, len); in Log()
|
D | LogBufferTest.cpp | 66 if (expected.tid != result.tid) { in CompareLoggerEntries() 68 StringPrintf("tid: expected %" PRIu32 " vs %" PRIu32, expected.tid, result.tid)); in CompareLoggerEntries() 191 .tid = 1, in TEST_P() 212 {{.pid = 1, .tid = 2, .sec = 10000, .nsec = 20001, .lid = LOG_ID_MAIN, .uid = 0}, in TEST_P() 214 {{.pid = 10, .tid = 2, .sec = 10000, .nsec = 20002, .lid = LOG_ID_MAIN, .uid = 0}, in TEST_P() 216 {{.pid = 100, .tid = 2, .sec = 10000, .nsec = 20003, .lid = LOG_ID_KERNEL, .uid = 0}, in TEST_P() 218 {{.pid = 10, .tid = 2, .sec = 10000, .nsec = 20004, .lid = LOG_ID_MAIN, .uid = 0}, in TEST_P() 220 {{.pid = 1, .tid = 2, .sec = 10000, .nsec = 20005, .lid = LOG_ID_RADIO, .uid = 0}, in TEST_P() 222 {{.pid = 2, .tid = 2, .sec = 10000, .nsec = 20006, .lid = LOG_ID_RADIO, .uid = 0}, in TEST_P() 224 {{.pid = 3, .tid = 2, .sec = 10000, .nsec = 20007, .lid = LOG_ID_RADIO, .uid = 0}, in TEST_P() [all …]
|
/system/core/debuggerd/ |
D | crash_dump.cpp | 72 static bool pid_contains_tid(int pid_proc_fd, pid_t tid) { in pid_contains_tid() argument 74 std::string task_path = StringPrintf("task/%d", tid); in pid_contains_tid() 88 static bool ptrace_seize_thread(int pid_proc_fd, pid_t tid, std::string* error, int flags = 0) { in ptrace_seize_thread() argument 89 if (ptrace(PTRACE_SEIZE, tid, 0, flags) != 0) { in ptrace_seize_thread() 91 pid_t tracer = get_tracer(tid); in ptrace_seize_thread() 93 *error = StringPrintf("failed to attach to thread %d, already traced by %d (%s)", tid, in ptrace_seize_thread() 99 *error = StringPrintf("failed to attach to thread %d: %s", tid, strerror(errno)); in ptrace_seize_thread() 104 if (!pid_contains_tid(pid_proc_fd, tid)) { in ptrace_seize_thread() 105 if (ptrace(PTRACE_DETACH, tid, 0, 0) != 0) { in ptrace_seize_thread() 106 PLOG(WARNING) << "failed to detach from thread " << tid; in ptrace_seize_thread() [all …]
|
/system/bt/utils/src/ |
D | bt_utils.cc | 115 int tid = gettid(); in raise_priority_a2dp() local 130 rc = set_sched_policy(tid, SP_AUDIO_SYS); in raise_priority_a2dp() 134 g_TaskIDs[high_task] = tid; in raise_priority_a2dp() 138 LOG_WARN("failed to change sched policy, tid %d, err: %d", tid, errno); in raise_priority_a2dp() 147 const int rc = sched_setscheduler(tid, SCHED_FIFO, &rt_params); in raise_priority_a2dp() 150 __func__, A2DP_RT_PRIORITY, tid, strerror(errno)); in raise_priority_a2dp()
|
/system/libartpalette/ |
D | palette_fake.cc | 36 enum PaletteStatus PaletteSchedSetPriority(int32_t tid, int32_t priority) { in PaletteSchedSetPriority() argument 42 g_tid_priority_map[tid] = priority; in PaletteSchedSetPriority() 46 enum PaletteStatus PaletteSchedGetPriority(int32_t tid, in PaletteSchedGetPriority() argument 49 if (g_tid_priority_map.find(tid) == g_tid_priority_map.end()) { in PaletteSchedGetPriority() 50 g_tid_priority_map[tid] = art::palette::kNormalManagedThreadPriority; in PaletteSchedGetPriority() 52 *priority = g_tid_priority_map[tid]; in PaletteSchedGetPriority()
|
/system/core/libbacktrace/ |
D | Backtrace.cpp | 41 Backtrace::Backtrace(pid_t pid, pid_t tid, BacktraceMap* map) in Backtrace() argument 42 : pid_(pid), tid_(tid), map_(map), map_shared_(true) { in Backtrace() 130 Backtrace* Backtrace::Create(pid_t pid, pid_t tid, BacktraceMap* map) { in Create() argument 133 if (tid == BACKTRACE_CURRENT_THREAD) { in Create() 134 tid = android::base::GetThreadId(); in Create() 136 } else if (tid == BACKTRACE_CURRENT_THREAD) { in Create() 137 tid = pid; in Create() 141 return new UnwindStackCurrent(pid, tid, map); in Create() 143 return new UnwindStackPtrace(pid, tid, map); in Create()
|
/system/core/llkd/ |
D | libllkd.cpp | 218 bool llkIsMissingExeLink(pid_t tid) { in llkIsMissingExeLink() argument 221 auto ret = ::readlink((procdir + std::to_string(tid) + "/exe").c_str(), &c, sizeof(c)); in llkIsMissingExeLink() 236 std::string llkProcGetName(pid_t tid, const char* node = "/cmdline") { in llkProcGetName() argument 237 std::string content = ReadFile(procdir + std::to_string(tid) + node); in llkProcGetName() 246 uid_t llkProcGetUid(pid_t tid) { in llkProcGetUid() argument 254 std::string content = ReadFile(procdir + std::to_string(tid) + "/status"); in llkProcGetUid() 281 pid_t tid; // monitored thread id (in Z or D state). member 314 proc(pid_t tid, pid_t pid, pid_t ppid, const char* _comm, int time, char state, bool frozen) in proc() 315 : tid(tid), in proc() 342 strncpy(comm + 1, llkProcGetName(tid, "/comm").c_str(), sizeof(comm) - 2); in getComm() [all …]
|
/system/core/debuggerd/client/ |
D | debuggerd_client.cpp | 87 for (int tid : tids) { in get_wchan_data() local 88 std::string path = "/proc/" + std::to_string(pid) + "/task/" + std::to_string(tid) + "/wchan"; in get_wchan_data() 94 data << "sysTid=" << std::left << std::setw(10) << tid << wchan_str << "\n"; in get_wchan_data() 114 bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int timeout_ms, in debuggerd_trigger_dump() argument 116 pid_t pid = tid; in debuggerd_trigger_dump() 121 if (!android::procinfo::GetProcessInfo(tid, &procinfo, &error)) { in debuggerd_trigger_dump() 230 if (!send_signal(tid, dump_type)) { in debuggerd_trigger_dump() 303 int dump_backtrace_to_file(pid_t tid, DebuggerdDumpType dump_type, int fd) { in dump_backtrace_to_file() argument 304 return dump_backtrace_to_file_timeout(tid, dump_type, 0, fd); in dump_backtrace_to_file() 307 int dump_backtrace_to_file_timeout(pid_t tid, DebuggerdDumpType dump_type, int timeout_secs, in dump_backtrace_to_file_timeout() argument [all …]
|
/system/extras/simpleperf/scripts/inferno/ |
D | data_types.py | 27 def __init__(self, tid, pid): argument 28 self.tid = tid 66 def get_thread(self, tid, pid): argument 67 thread = self.threads.get(tid) 69 thread = self.threads[tid] = Thread(tid, pid) 73 thread = self.get_thread(sample.tid, sample.pid)
|