Lines Matching refs:tid
55 std::string VirtualRuntime::ReadFromSavedCmdLines(pid_t tid)
65 std::string threadid = std::to_string(tid);
82 std::string VirtualRuntime::ReadThreadName(pid_t tid, bool isThread)
85 if (tid == SYSMGR_PID) {
87 } else if (tid == devhostPid_) {
90 comm = ReadFileToString(StringPrintf("/proc/%d/comm", tid)).c_str();
92 comm = ReadFileToString(StringPrintf("/proc/%d/cmdline", tid)).c_str();
95 comm = ReadFromSavedCmdLines(tid);
102 VirtualThread &VirtualRuntime::UpdateThread(pid_t pid, pid_t tid, const std::string name)
107 VirtualThread &thread = GetThread(pid, tid, name);
117 VirtualThread &VirtualRuntime::CreateThread(pid_t pid, pid_t tid, const std::string name)
120 if (pid == tid) {
121 userSpaceThreadMap_.emplace(std::piecewise_construct, std::forward_as_tuple(tid),
126 std::piecewise_construct, std::forward_as_tuple(tid),
127 std::forward_as_tuple(pid, tid, GetThread(pid, pid), symbolsFiles_));
129 VirtualThread &thread = userSpaceThreadMap_.at(tid);
131 if (pid == tid && !IsKernelThread(pid)) {
145 thread.name_ = ReadThreadName(tid, pid != tid);
147 HLOGD("create a new thread record for %u:%u:%s with %zu dso", pid, tid,
150 auto commRecord = std::make_unique<PerfRecordComm>(IsKernelThread(pid), pid, tid, thread.name_);
153 if (pid == tid) {
210 VirtualThread &VirtualRuntime::GetThread(pid_t pid, pid_t tid, const std::string name)
218 auto it = userSpaceThreadMap_.find(tid);
221 return CreateThread(pid, tid, name);
227 std::shared_ptr<DfxMap> VirtualRuntime::UpdateThreadMaps(pid_t pid, pid_t tid, const std::string filename,
230 VirtualThread &thread = GetThread(pid, tid);
494 pid_t tid = static_cast<pid_t>(recordSample.data_.tid);
496 pid = tid = serverPid;
498 auto symbol = GetSymbol(ip, pid, tid, context);
592 pid_t tid = static_cast<pid_t>(recordSample.data_.tid);
594 pid = tid = serverPid;
596 auto &thread = UpdateThread(pid, tid);
641 UpdateThread(recordSample.data_.pid, recordSample.data_.tid);
659 HLOGV(" MMAP: size %d pid %u tid %u", recordMmap.header.size, recordMmap.data_.pid,
660 recordMmap.data_.tid);
675 auto map = UpdateThreadMaps(recordMmap.data_.pid, recordMmap.data_.tid, recordMmap.data_.filename,
713 std::make_unique<PerfRecordMmap2>(recordMmap2.inKernel(), recordMmap2.data_.pid, recordMmap2.data_.tid,
715 UpdateThreadMaps(mmap2FirstSeg->data_.pid, mmap2FirstSeg->data_.tid, mmap2FirstSeg->data_.filename,
725 std::make_unique<PerfRecordMmap2>(recordMmap2.inKernel(), recordMmap2.data_.pid, recordMmap2.data_.tid,
727 UpdateThreadMaps(mmap2FirstSeg->data_.pid, mmap2FirstSeg->data_.tid, curMap->name,
732 std::make_unique<PerfRecordMmap2>(recordMmap2.inKernel(), recordMmap2.data_.pid, recordMmap2.data_.tid,
737 UpdateThreadMaps(mmap2SecondSegment->data_.pid, mmap2SecondSegment->data_.tid, curMap->name,
767 HLOGV(" MMAP2: size %d pid %u tid %u", recordMmap2.header.size, recordMmap2.data_.pid,
768 recordMmap2.data_.tid);
779 auto map = UpdateThreadMaps(recordMmap2.data_.pid, recordMmap2.data_.tid, recordMmap2.data_.filename,
788 UpdateThread(recordComm.data_.pid, recordComm.data_.tid, recordComm.data_.comm);
817 DfxSymbol symbol = GetSymbol(pc, recordAuxTrace.data_.reserved__, recordAuxTrace.data_.tid);
853 DfxSymbol symbol = GetSymbol(pc, recordAuxTrace.data_.reserved__, recordAuxTrace.data_.tid);
1095 DfxSymbol VirtualRuntime::GetSymbol(uint64_t ip, pid_t pid, pid_t tid, const perf_callchain_context &context)
1097 HLOGV("try find tid %u ip 0x%" PRIx64 " in %zu symbolsFiles\n", tid, ip, symbolsFiles_.size());
1101 VirtualThread &kthread = GetThread(pid, tid);
1115 symbol = GetUserSymbol(ip, GetThread(pid, tid));
1127 symbol = GetKernelSymbol(ip, kernelSpaceMemMaps_, GetThread(pid, tid));