Lines Matching refs:pid
54 int pid = 0; in GetProcStatusByPath() local
65 if (sscanf_s(buf, "%*[^0-9]%d", &pid) != ARGS_COUNT_ONE) { in GetProcStatusByPath()
67 procInfo.pid = getprocpid(); in GetProcStatusByPath()
69 procInfo.pid = getpid(); in GetProcStatusByPath()
72 procInfo.pid = pid; in GetProcStatusByPath()
74 procInfo.nsPid = pid; in GetProcStatusByPath()
90 if (sscanf_s(buf, "%*[^0-9]%d%*[^0-9]%d", &pid, &nsPid) != ARGS_COUNT_TWO) { in GetProcStatusByPath()
92 procInfo.nsPid = pid; in GetProcStatusByPath()
97 procInfo.pid = pid; in GetProcStatusByPath()
105 bool TidToNstid(const int pid, const int tid, int& nstid) in TidToNstid() argument
107 std::string path = StringPrintf("/proc/%d/task/%d/status", pid, tid); in TidToNstid()
138 bool IsThreadInPid(int32_t pid, int32_t tid) argument
142 if (pid == getprocpid()) {
144 if (pid == getpid()) {
148 path = StringPrintf("/proc/%d/task/%d", pid, tid);
153 bool GetTidsByPidWithFunc(const int pid, std::vector<int>& tids, std::function<bool(int)> const& fu… argument
157 if (pid == getprocpid()) {
159 if (pid == getpid()) {
163 path = StringPrintf("/proc/%d/task", pid);
183 bool GetTidsByPid(const int pid, std::vector<int>& tids, std::vector<int>& nstids) argument
186 (void)GetProcStatusByPid(pid, procInfo);
192 TidToNstid(pid, tid, nstid);
197 bool ret = GetTidsByPidWithFunc(pid, tids, func);
206 pid_t pid = getprocpid(); local
209 ss << "Pid:" << pid << std::endl;
212 ReadProcessName(pid, processName);
233 void ReadThreadNameByPidAndTid(const int pid, const int tid, std::string& str) argument
235 std::string path = StringPrintf("/proc/%d/task/%d/comm", pid, tid);
241 void ReadProcessName(const int pid, std::string& str) argument
245 if (pid == getprocpid()) {
247 if (pid == getpid()) {
251 path = StringPrintf("/proc/%d/cmdline", pid);
258 void ReadProcessStatus(std::string& result, const int pid) argument
260 std::string path = StringPrintf("/proc/%d/status", pid);
273 void ReadProcessWchan(std::string& result, const int pid, bool onlyPid, bool withThreadName) argument
275 std::string path = StringPrintf("/proc/%d/wchan", pid);
296 std::string taskPath = StringPrintf("/proc/%d/task", pid);