/aosp14/system/core/libprocessgroup/ |
H A 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() 67 int set_sched_policy(int tid, SchedPolicy policy) { in set_sched_policy() argument 68 if (tid == 0) { in set_sched_policy() 69 tid = GetThreadId(); in set_sched_policy() 98 SLOGD("vvv tid %d (%s)", tid, thread_name); in set_sched_policy() 162 if (!controller.GetTaskGroup(tid, &subgroup)) in getCGroupSubsys() 188 int get_sched_policy(int tid, SchedPolicy* policy) { in get_sched_policy() argument 189 if (tid == 0) { in get_sched_policy() [all …]
|
H A D | task_profiles.h | 99 bool ExecuteForTask(int tid) const override; 111 bool ExecuteForTask(int tid) const override; 118 static bool IsTimerSlackSupported(int tid); 129 bool ExecuteForTask(int tid) const override; 132 bool IsValidForTask(int tid) const override; 149 bool ExecuteForTask(int tid) const override; 153 bool IsValidForTask(int tid) const override; 175 bool ExecuteForTask(int tid) const override; 179 bool IsValidForTask(int tid) const override; 201 bool ExecuteForTask(int tid) const; [all …]
|
H A D | task_profiles.cpp | 205 if (tid == 0 || tid == GetThreadId()) { in ExecuteForTask() 256 if (!attribute_->GetPathForTask(tid, &path)) { in ExecuteForTask() 294 if (!attribute_->GetPathForTask(tid, &path)) { in IsValidForTask() 320 if (tid <= 0) { in AddTidToCgroup() 324 std::string value = std::to_string(tid); in AddTidToCgroup() 658 profile->ExecuteForTask(tid); in ExecuteForTask() 686 if (!profile->IsValidForTask(tid)) { in IsValidForTask() 709 if (tid == 0) { in ExecuteForTask() 710 tid = GetThreadId(); in ExecuteForTask() 713 if (!element->ExecuteForTask(tid)) { in ExecuteForTask() [all …]
|
H A D | processgroup.cpp | 123 bool CgroupGetAttributePathForTask(const std::string& attr_name, int tid, std::string* path) { in CgroupGetAttributePathForTask() argument 131 if (!attr->GetPathForTask(tid, path)) { in CgroupGetAttributePathForTask() 132 PLOG(ERROR) << "Failed to find cgroup for tid " << tid; in CgroupGetAttributePathForTask() 174 bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use_fd_cache) { in SetTaskProfiles() argument 181 tid, std::span<const std::string_view>(profiles), use_fd_cache); in SetTaskProfiles() 184 bool SetTaskProfiles(int tid, std::span<const std::string_view> profiles, bool use_fd_cache) { in SetTaskProfiles() argument 185 return TaskProfiles::GetInstance().SetTaskProfiles(tid, profiles, use_fd_cache); in SetTaskProfiles() 626 static bool SetProcessGroupValue(int tid, const std::string& attr_name, int64_t value) { in SetProcessGroupValue() argument 633 if (!CgroupGetAttributePathForTask(attr_name, tid, &path)) { in SetProcessGroupValue() 657 bool getAttributePathForTask(const std::string& attr_name, int tid, std::string* path) { in getAttributePathForTask() argument [all …]
|
/aosp14/system/core/debuggerd/handler/ |
H A D | debuggerd_fallback.cpp | 68 thread.tid = gettid(); in debuggerd_fallback_trace() 108 pid_t tid; in forward_output() local 109 if (TEMP_FAILURE_RETRY(read(src_fd, &tid, sizeof(tid))) != sizeof(tid)) { in forward_output() 114 if (tid != expected_tid) { in forward_output() 138 int32_t tid; member 143 packed_thread_output packed = {.tid = tid, .fd = fd}; in pack_thread_fd() 153 return std::make_pair(result.tid, result.fd); in unpack_thread_fd() 162 auto [tid, fd] = unpack_thread_fd(val); in trace_handler() 163 if (tid != gettid()) { in trace_handler() 178 if (TEMP_FAILURE_RETRY(write(fd, &tid, sizeof(tid))) == sizeof(tid)) { in trace_handler() [all …]
|
/aosp14/system/core/libutils/ |
H A D | CallStack_test.cpp | 38 __attribute__((__noinline__)) extern "C" void ThreadBusyWait(std::atomic<pid_t>* tid, in ThreadBusyWait() argument 40 *tid = android::base::GetThreadId(); in ThreadBusyWait() 50 std::atomic<pid_t> tid = -1; in TEST() local 51 std::thread thread([&tid, &done]() { ThreadBusyWait(&tid, &done); }); in TEST() 53 while (tid == -1) { in TEST() 57 cs.update(0, tid); in TEST()
|
H A 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() 182 threadInfo.callStack.update(ignoreDepth, tid); in update() 185 threadInfo.threadName = getThreadName(tid); in update() 188 __FUNCTION__, tid, threadInfo.callStack.size()); in update() [all …]
|
H A D | Threads.cpp | 299 int androidSetThreadPriority(pid_t tid, int pri) in androidSetThreadPriority() argument 302 int curr_pri = getpriority(PRIO_PROCESS, tid); in androidSetThreadPriority() 308 if (setpriority(PRIO_PROCESS, tid, pri) < 0) { in androidSetThreadPriority() 317 int androidGetThreadPriority(pid_t tid) { in androidGetThreadPriority() argument 318 return getpriority(PRIO_PROCESS, tid); in androidGetThreadPriority() 831 pid_t tid; in getTid() local 834 tid = pthread_gettid_np(pthread); in getTid() 837 tid = -1; in getTid() 839 return tid; in getTid()
|
H A D | CallStack.cpp | 41 void CallStack::update(int32_t ignoreDepth, pid_t tid) { in update() argument 51 if (tid != -1) { in update() 52 tid_val = tid; in update()
|
/aosp14/system/core/llkd/ |
H A D | libllkd.cpp | 246 uid_t llkProcGetUid(pid_t tid) { in llkProcGetUid() argument 315 : tid(tid), in proc() 464 if (tid != pid) { in llkKillOneProcess() 491 return llkKillOneProcess(kprocp->tid, tprocp->state, tprocp->tid, tprocp->getComm(), in llkKillOneProcess() 590 proc* llkTidLookup(pid_t tid) { in llkTidLookup() argument 598 void llkTidRemove(pid_t tid) { in llkTidRemove() argument 599 tids.erase(tid); in llkTidRemove() 1028 unsigned tid = -1; in llkCheck() local 1043 pid = tid; in llkCheck() 1099 if ((tid == myTid) || llkSkipPid(tid)) { in llkCheck() [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/wm/ |
H A D | VrController.java | 234 public void setVrThreadLocked(int tid, int pid, WindowProcessController proc) { in setVrThreadLocked() argument 243 if (tid != 0) { in setVrThreadLocked() 244 enforceThreadInProcess(tid, pid); in setVrThreadLocked() 249 setVrRenderThreadLocked(tid, proc.getCurrentSchedulingGroup(), false); in setVrThreadLocked() 251 proc.mVrThreadTid = (tid > 0) ? tid : 0; in setVrThreadLocked() 268 public void setPersistentVrThreadLocked(int tid, int pid, WindowProcessController proc) { in setPersistentVrThreadLocked() argument 277 if (tid != 0) { in setPersistentVrThreadLocked() 278 enforceThreadInProcess(tid, pid); in setPersistentVrThreadLocked() 280 setPersistentVrRenderThreadLocked(tid, false); in setPersistentVrThreadLocked() 429 private void enforceThreadInProcess(int tid, int pid) { in enforceThreadInProcess() argument [all …]
|
/aosp14/system/core/debuggerd/ |
H A D | crash_dump.cpp | 88 if (ptrace(PTRACE_SEIZE, tid, 0, flags) != 0) { in ptrace_seize_thread() 91 pid_t tracer_pid = get_tracer(tid); 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() 118 pid_t result = waitpid(tid, &status, __WALL); in wait_for_stop() 119 if (result != tid) { in wait_for_stop() 137 if (ptrace(PTRACE_INTERRUPT, tid, 0, 0) == 0) { in ptrace_interrupt() 138 return wait_for_stop(tid, received_signal); in ptrace_interrupt() 505 info.tid = thread; in main() 585 for (const auto& [tid, thread] : thread_info) { in main() [all …]
|
H A D | util.cpp | 57 std::string get_thread_name(pid_t tid) { in get_thread_name() argument 59 android::base::ReadFileToString(android::base::StringPrintf("/proc/%d/comm", tid), &result); in get_thread_name() 89 pid_t tid = atoi(entry->d_name); in iterate_tids() local 90 if (tid == 0) { in iterate_tids() 93 callback(tid); in iterate_tids()
|
/aosp14/frameworks/base/services/core/java/com/android/server/ |
H A D | ThreadPriorityBooster.java | 48 final int prevPriority = getThreadPriority(state.tid); in boost() 50 setThreadPriority(state.tid, mBoostToPriority); in boost() 64 setThreadPriority(state.tid, state.prevPriority); in reset() 80 final int prevPriority = getThreadPriority(state.tid); in setBoostToPriority() 82 setThreadPriority(state.tid, priority); in setBoostToPriority() 88 final int tid = myTid(); field in ThreadPriorityBooster.PriorityState
|
/aosp14/system/core/debuggerd/client/ |
H A D | debuggerd_client.cpp | 96 for (int tid : tids) { in get_wchan_data() local 103 data << "sysTid=" << std::left << std::setw(10) << tid << wchan_str << "\n"; in get_wchan_data() 117 bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int timeout_ms, in debuggerd_trigger_dump() argument 119 pid_t pid = tid; in debuggerd_trigger_dump() 124 if (!android::procinfo::GetProcessInfo(tid, &procinfo, &error)) { in debuggerd_trigger_dump() 300 int dump_backtrace_to_file(pid_t tid, DebuggerdDumpType dump_type, int fd) { in dump_backtrace_to_file() argument 301 return dump_backtrace_to_file_timeout(tid, dump_type, 0, fd); in dump_backtrace_to_file() 304 int dump_backtrace_to_file_timeout(pid_t tid, DebuggerdDumpType dump_type, int timeout_secs, in dump_backtrace_to_file_timeout() argument 313 std::string wchan_data = get_wchan_data(fd, tid); in dump_backtrace_to_file_timeout() 316 int ret = debuggerd_trigger_dump(tid, dump_type, timeout_ms, std::move(copy)) ? 0 : -1; in dump_backtrace_to_file_timeout() [all …]
|
/aosp14/system/core/debuggerd/libdebuggerd/ |
H A D | tombstone.cpp | 77 .registers = std::move(regs), .uid = uid, .tid = target_tid, in engrave_tombstone_ucontext() 87 if (!iterate_tids(pid, [&threads, &thread, &target_tid](pid_t tid) { in engrave_tombstone_ucontext() argument 88 if (target_tid == tid) { in engrave_tombstone_ucontext() 91 threads[tid] = ThreadInfo{ in engrave_tombstone_ucontext() 93 .tid = tid, in engrave_tombstone_ucontext() 96 .thread_name = get_thread_name(tid), in engrave_tombstone_ucontext()
|
H A D | backtrace.cpp | 67 _LOG(&log, logtype::BACKTRACE, "\n\"%s\" sysTid=%d\n", thread.thread_name.c_str(), thread.tid); in dump_backtrace_thread() 71 _LOG(&log, logtype::THREAD, "Unwind failed: tid = %d: Error %s\n", thread.tid, in dump_backtrace_thread() 94 for (const auto& [tid, info] : thread_info) { in dump_backtrace() 95 if (tid != target_thread) { in dump_backtrace()
|
/aosp14/system/core/libprocessgroup/include/processgroup/ |
H A D | processgroup.h | 35 bool CgroupGetAttributePathForTask(const std::string& attr_name, int tid, std::string* path); 37 bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use_fd_cache = false); 43 bool SetTaskProfiles(int tid, std::initializer_list<std::string_view> profiles, 47 bool SetTaskProfiles(int tid, std::span<const std::string_view> profiles, 97 bool getAttributePathForTask(const std::string& attr_name, int tid, std::string* path);
|
H A D | sched_policy.h | 56 extern int set_cpuset_policy(int tid, SchedPolicy policy); 64 extern int set_sched_policy(int tid, SchedPolicy policy); 70 extern int get_sched_policy(int tid, SchedPolicy* policy);
|
/aosp14/system/core/libcutils/ |
H A D | threads.cpp | 34 uint64_t tid; in gettid() local 35 pthread_threadid_np(NULL, &tid); in gettid() 36 return tid; in gettid()
|
/aosp14/system/core/libprocessgroup/tools/ |
H A D | settaskprofile.cpp | 38 int tid = atoi(argv[1]); in main() local 39 if (tid == 0) { in main() 45 if (!SetTaskProfiles(tid, {argv[i]})) { in main()
|
/aosp14/frameworks/base/core/jni/ |
H A D | android_util_Process.cpp | 116 signalExceptionForError(env, err, tid); in signalExceptionForPriorityError() 129 signalExceptionForError(env, err, tid); in signalExceptionForGroupError() 209 ALOGV("%s tid=%d grp=%" PRId32, __func__, tid, grp); in android_os_Process_setThreadGroup() 217 signalExceptionForGroupError(env, -res, tid); in android_os_Process_setThreadGroup() 223 ALOGV("%s tid=%d grp=%" PRId32, __func__, tid, grp); in android_os_Process_setThreadGroupAndCpuset() 231 signalExceptionForGroupError(env, -res, tid); in android_os_Process_setThreadGroupAndCpuset() 464 jint tid) in android_os_Process_getThreadScheduler() argument 470 policy = sched_getscheduler(tid); in android_os_Process_getThreadScheduler() 475 signalExceptionForPriorityError(env, ENOSYS, tid); in android_os_Process_getThreadScheduler() 487 int rc = sched_setscheduler(tid, policy, ¶m); in android_os_Process_setThreadScheduler() [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/os/ |
H A D | SchedulingPolicyService.java | 82 public int requestPriority(int pid, int tid, int prio, boolean isForApp) { in requestPriority() argument 92 prio > PRIORITY_MAX || Process.getThreadGroupLeader(tid) != pid) { in requestPriority() 98 && Process.getUidForPid(tid) != Process.AUDIOSERVER_UID) { in requestPriority() 104 Process.setThreadGroup(tid, !isForApp ? in requestPriority() 113 Process.setThreadScheduler(tid, Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK, in requestPriority()
|
/aosp14/frameworks/base/core/java/android/os/ |
H A D | Process.java | 1017 public static final int getThreadGroupLeader(int tid) { in getThreadGroupLeader() argument 1021 Process.readProcLines("/proc/" + tid + "/status", procStatusLabels, procStatusValues); in getThreadGroupLeader() 1038 public static final native void setThreadPriority(int tid, int priority) in setThreadPriority() argument 1067 public static final native void setThreadGroup(int tid, int group) in setThreadGroup() argument 1082 public static final native void setThreadGroupAndCpuset(int tid, int group) in setThreadGroupAndCpuset() argument 1207 public static final native int getThreadPriority(int tid) in getThreadPriority() argument 1225 public static final native int getThreadScheduler(int tid) in getThreadScheduler() argument 1244 public static final native void setThreadScheduler(int tid, int policy, int priority) in setThreadScheduler() argument 1535 public static final boolean isThreadInProcess(int tid, int pid) { in isThreadInProcess() argument 1538 if (Os.access("/proc/" + tid + "/task/" + pid, OsConstants.F_OK)) { in isThreadInProcess()
|
/aosp14/system/core/debuggerd/include/debuggerd/ |
H A D | client.h | 32 int dump_backtrace_to_file(pid_t tid, enum DebuggerdDumpType dump_type, int output_fd); 33 int dump_backtrace_to_file_timeout(pid_t tid, enum DebuggerdDumpType dump_type, int timeout_secs,
|