Lines Matching refs:pid

51     int pid = 0;
62 if (sscanf_s(buf, "%*[^0-9]%d", &pid) != ARGS_COUNT_ONE) {
63 procInfo.pid = getpid();
65 procInfo.pid = pid;
67 procInfo.nsPid = pid;
83 if (sscanf_s(buf, "%*[^0-9]%d%*[^0-9]%d", &pid, &nsPid) != ARGS_COUNT_TWO) {
85 procInfo.nsPid = pid;
90 procInfo.pid = pid;
98 bool TidToNstid(const int pid, const int tid, int& nstid)
100 std::string path = StringPrintf("/proc/%d/task/%d/status", pid, tid);
127 bool IsThreadInPid(int32_t pid, int32_t tid)
130 if (pid == getpid()) {
133 path = StringPrintf("/proc/%d/task/%d", pid, tid);
138 bool GetTidsByPidWithFunc(const int pid, std::vector<int>& tids, std::function<bool(int)> const& func)
141 if (pid == getpid()) {
144 path = StringPrintf("/proc/%d/task", pid);
164 bool GetTidsByPid(const int pid, std::vector<int>& tids, std::vector<int>& nstids)
167 (void)GetProcStatusByPid(pid, procInfo);
173 TidToNstid(pid, tid, nstid);
178 bool ret = GetTidsByPidWithFunc(pid, tids, func);
187 pid_t pid = getpid();
188 std::string ss = "\nTimestamp:" + GetCurrentTimeStr() + "Pid:" + std::to_string(pid) + "\n" +
191 ReadProcessName(pid, processName);
212 void ReadThreadNameByPidAndTid(const int pid, const int tid, std::string& str)
214 std::string path = StringPrintf("/proc/%d/task/%d/comm", pid, tid);
220 void ReadProcessName(const int pid, std::string& str)
223 if (pid == getpid()) {
226 path = StringPrintf("/proc/%d/cmdline", pid);
233 void ReadProcessStatus(std::string& result, const int pid)
235 std::string path = StringPrintf("/proc/%d/status", pid);
248 void ReadProcessWchan(std::string& result, const int pid, bool onlyPid, bool withThreadName)
250 std::string path = StringPrintf("/proc/%d/wchan", pid);
270 std::string taskPath = StringPrintf("/proc/%d/task", pid);