Home
last modified time | relevance | path

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

12345678

/system/core/libprocessgroup/
Dsched_policy.cpp41 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 …]
Dtask_profiles.h40 virtual bool GetPathForTask(int tid, std::string* path) const = 0;
60 bool GetPathForTask(int tid, std::string* path) const override;
86 virtual bool IsValidForTask(int tid) const { return false; } in IsValidForTask() argument
99 bool ExecuteForTask(int tid) const override;
111 bool ExecuteForTask(int tid) const override;
113 bool IsValidForTask(int tid) const override { return true; } in IsValidForTask() argument
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;
[all …]
/system/unwinding/libunwindstack/benchmarks/
Dthread_unwind_benchmarks.cpp30 void ThreadCall6(std::atomic_int* tid, std::atomic_bool* done) { in ThreadCall6() argument
31 tid->store(android::base::GetThreadId()); in ThreadCall6()
37 void ThreadCall5(std::atomic_int* tid, std::atomic_bool* done) { in ThreadCall5() argument
38 ThreadCall6(tid, done); in ThreadCall5()
41 void ThreadCall4(std::atomic_int* tid, std::atomic_bool* done) { in ThreadCall4() argument
42 ThreadCall5(tid, done); in ThreadCall4()
45 void ThreadCall3(std::atomic_int* tid, std::atomic_bool* done) { in ThreadCall3() argument
46 ThreadCall4(tid, done); in ThreadCall3()
49 void ThreadCall2(std::atomic_int* tid, std::atomic_bool* done) { in ThreadCall2() argument
50 ThreadCall3(tid, done); in ThreadCall2()
[all …]
/system/memory/libmemunreachable/
DThreadCapture.cpp81 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/
Ddebuggerd_fallback.cpp68 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()
115 async_safe_format_log(ANDROID_LOG_ERROR, "libc", "received tid %d, expected %d", tid, in forward_output()
138 int32_t tid; member
142 static uint64_t pack_thread_fd(pid_t tid, int fd) { in pack_thread_fd() argument
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()
[all …]
/system/unwinding/libunwindstack/utils/
DProcessTracer.cpp100 bool ProcessTracer::Detach(pid_t tid) { in Detach() argument
101 if (tid != pid_ && tids_.find(tid) == tids_.end()) { in Detach()
102 fprintf(stderr, "Tid %d does not belong to proc %d.\n", tid, pid_); in Detach()
112 if (ptrace(PTRACE_DETACH, tid, nullptr, nullptr) == kPtraceFailed) { in Detach()
113 fprintf(stderr, "Failed to detach from tid %d: %s\n", tid, strerror(errno)); in Detach()
121 bool ProcessTracer::Attach(pid_t tid) { in Attach() argument
122 if (tid != pid_ && tids_.find(tid) == tids_.end()) { in Attach()
123 fprintf(stderr, "Tid %d does not belong to proc %d.\n", tid, pid_); in Attach()
129 fprintf(stderr, "Cannot attatch to tid %d. Already attached to tid %d.\n", tid, in Attach()
134 if (ptrace(PTRACE_ATTACH, tid, nullptr, nullptr) == kPtraceFailed) { in Attach()
[all …]
/system/nfc/src/nfc/llcp/
Dllcp_sdp.cc103 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/core/libutils/
DCallStack_test.cpp38 __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()
DProcessCallStack.cpp77 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/simpleperf/
Dcmd_stat_test.cpp219 std::atomic<int> tid(0); in TEST() local
221 tid = gettid(); in TEST()
225 while (tid == 0) in TEST()
227 ASSERT_TRUE(StatCmd()->Run({"-t", std::to_string(tid), "--in-app"})); in TEST()
389 int tid = 0; member
399 if (thread_map_.count(arg.tid) == 0) { in AddCounter()
400 ThreadInfo& thread = thread_map_[arg.tid]; in AddCounter()
401 thread.pid = thread.tid = arg.tid; in AddCounter()
402 thread.name = "thread" + std::to_string(arg.tid); in AddCounter()
412 counter.tid = arg.tid; in AddCounter()
[all …]
Dthread_tree.cpp44 void ThreadTree::SetThreadName(int pid, int tid, const std::string& comm) { in SetThreadName() argument
45 ThreadEntry* thread = FindThreadOrNew(pid, tid); in SetThreadName()
52 bool ThreadTree::ForkThread(int pid, int tid, int ppid, int ptid) { in ForkThread() argument
54 if (tid == ptid) { in ForkThread()
58 if (pid != tid && pid != ppid) { in ForkThread()
62 ThreadEntry* child = FindThreadOrNew(pid, tid); in ForkThread()
78 ThreadEntry* ThreadTree::FindThread(int tid) const { in FindThread()
79 if (auto it = thread_tree_.find(tid); it != thread_tree_.end()) { in FindThread()
85 ThreadEntry* ThreadTree::FindThreadOrNew(int pid, int tid) { in FindThreadOrNew() argument
86 auto it = thread_tree_.find(tid); in FindThreadOrNew()
[all …]
DCallChainJoiner.cpp45 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
192 MoveToBinaryFormat(tid, p); in WriteCallChain()
205 static bool ReadCallChain(FILE* fp, pid_t& pid, pid_t& tid, CallChainJoiner::ChainType& type, in ReadCallChain() argument
[all …]
/system/extras/memory_replay/
DThreads.cpp72 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 …]
/system/libbase/
Dthreads.cpp37 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/traces/
DREADME9 <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/unwinding/libunwindstack/utils/tests/
DProcessTracerTest.cpp153 static void VerifyState(pid_t tid, bool running) { in VerifyState() argument
156 ASSERT_TRUE(GetProcessInfo(tid, &proc_info)); in VerifyState()
173 for (const pid_t& tid : proc.tids()) { in VerifyState() local
174 VerifyState(tid, running); in VerifyState()
200 for (const pid_t& tid : proc.tids()) { in TEST_P() local
201 ASSERT_TRUE(proc.Attach(tid)); in TEST_P()
202 ASSERT_EQ(-1, ptrace(PTRACE_ATTACH, tid, nullptr, nullptr)); in TEST_P()
204 ASSERT_TRUE(proc.Detach(tid)); in TEST_P()
213 for (const pid_t& tid : proc.tids()) { in TEST_P() local
215 ASSERT_TRUE(proc.Attach(tid)); in TEST_P()
[all …]
/system/logging/logd/
DSerializedLogEntry.h36 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()
71 entry.tid = tid(); in Flush()
82 pid_t tid() const { return tid_; } in tid() function
DRecordingLogBuffer.cpp27 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()
DLogBufferTest.cpp56 if (expected.tid != result.tid) { in CompareLoggerEntries()
58 StringPrintf("tid: expected %" PRIu32 " vs %" PRIu32, expected.tid, result.tid)); in CompareLoggerEntries()
181 .tid = 1, in TEST_P()
199 {{.pid = 1, .tid = 2, .sec = 10000, .nsec = 20001, .lid = LOG_ID_MAIN, .uid = 0}, in TEST_P()
201 {{.pid = 10, .tid = 2, .sec = 10000, .nsec = 20002, .lid = LOG_ID_MAIN, .uid = 0}, in TEST_P()
203 {{.pid = 100, .tid = 2, .sec = 10000, .nsec = 20003, .lid = LOG_ID_KERNEL, .uid = 0}, in TEST_P()
205 {{.pid = 10, .tid = 2, .sec = 10000, .nsec = 20004, .lid = LOG_ID_MAIN, .uid = 0}, in TEST_P()
207 {{.pid = 1, .tid = 2, .sec = 10000, .nsec = 20005, .lid = LOG_ID_RADIO, .uid = 0}, in TEST_P()
209 {{.pid = 2, .tid = 2, .sec = 10000, .nsec = 20006, .lid = LOG_ID_RADIO, .uid = 0}, in TEST_P()
211 {{.pid = 3, .tid = 2, .sec = 10000, .nsec = 20007, .lid = LOG_ID_RADIO, .uid = 0}, in TEST_P()
[all …]
DSerializedLogBufferTest.cpp67 uint32_t tid; member
82 chunk.Log(entry.sequence, entry.realtime, entry.uid, entry.pid, entry.tid, entry.msg.data(), in CreateChunk()
149 .tid = 10, in TEST()
193 .tid = 10, in TEST()
199 .tid = 10, in TEST()
224 .tid = 10, in TEST()
230 .tid = 10, in TEST()
258 .tid = 10, in TEST()
267 .tid = 10, in TEST()
276 .tid = 10, in TEST()
[all …]
/system/core/debuggerd/
Dcrash_dump.cpp71 static bool pid_contains_tid(int pid_proc_fd, pid_t tid) { in pid_contains_tid() argument
73 std::string task_path = StringPrintf("task/%d", tid); in pid_contains_tid()
87 static bool ptrace_seize_thread(int pid_proc_fd, pid_t tid, std::string* error, int flags = 0) { in ptrace_seize_thread() argument
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()
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/unwinding/libunwindstack/tools/
Dunwind_for_offline.cpp79 bool CreateAndChangeDumpDir(std::filesystem::path thread_dir, pid_t tid, bool is_main_thread) { in CreateAndChangeDumpDir() argument
80 std::string dir_name = std::to_string(tid); in CreateAndChangeDumpDir()
84 fprintf(stderr, "Failed to create directory for tid %d\n", tid); in CreateAndChangeDumpDir()
104 bool SaveStack(pid_t tid, const std::vector<std::pair<uint64_t, uint64_t>>& stacks, in SaveStack() argument
118 auto process_memory = unwindstack::Memory::CreateProcessMemory(tid); in SaveStack()
179 bool CreateElfFromMemory(pid_t tid, unwindstack::MapInfo* map_info, std::string* name) { in CreateElfFromMemory() argument
191 auto memory = unwindstack::Memory::CreateProcessMemory(tid); in CreateElfFromMemory()
217 bool CopyMapInfo(pid_t tid, unwindstack::MapInfo* map_info, in CopyMapInfo() argument
231 if (CreateElfFromMemory(tid, map_info, name)) { in CopyMapInfo()
263 void SaveMapInfo(FILE* maps_fp, pid_t tid, unwindstack::MapInfo* map_info, in SaveMapInfo() argument
[all …]
/system/core/llkd/
Dlibllkd.cpp218 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/extras/setuclamp/
Dsetuclamp.cpp48 static int set_uclamp(int32_t min, int32_t max, int tid) { in set_uclamp() argument
56 int ret = sched_setattr(tid, &attr, 0); in set_uclamp()
59 std::cerr << "sched_setattr failed for thread " << tid << " err=" << err << std::endl; in set_uclamp()
70 int tid = atoi(argv[1]); in main() local
74 return set_uclamp(uclamp_min, uclamp_max, tid); in main()
/system/unwinding/libunwindstack/
DAndroidUnwinder.cpp127 bool AndroidUnwinder::Unwind(std::optional<pid_t> tid, AndroidUnwinderData& data) { in Unwind() argument
132 return InternalUnwind(tid, data); in Unwind()
179 bool AndroidLocalUnwinder::InternalUnwind(std::optional<pid_t> tid, AndroidUnwinderData& data) { in InternalUnwind() argument
180 if (!tid) { in InternalUnwind()
181 tid = android::base::GetThreadId(); in InternalUnwind()
184 if (static_cast<uint64_t>(*tid) == android::base::GetThreadId()) { in InternalUnwind()
198 unwinder.UnwindWithSignal(kThreadUnwindSignal, *tid, initial_regs, in InternalUnwind()
227 bool AndroidRemoteUnwinder::InternalUnwind(std::optional<pid_t> tid, AndroidUnwinderData& data) { in InternalUnwind() argument
228 if (!tid) { in InternalUnwind()
229 tid = pid_; in InternalUnwind()
[all …]

12345678