Lines Matching refs:tid
218 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()
345 if (llkIsMissingExeLink(tid)) { in getComm()
368 cmdline = llkProcGetName(tid); in getCmdline()
376 uid = llkProcGetUid(tid); in getUid()
436 std::string llkProcGetName(pid_t tid, const char* comm, const char* cmdline) { in llkProcGetName() argument
448 std::string content = llkProcGetName(tid); in llkProcGetName()
453 content = llkProcGetName(tid, "/comm"); in llkProcGetName()
454 if (llkIsMissingExeLink(tid) && (content.size() != 0)) { in llkProcGetName()
460 int llkKillOneProcess(pid_t pid, char state, pid_t tid, const char* tcomm = nullptr, in llkKillOneProcess() argument
464 if (tid != pid) { in llkKillOneProcess()
465 … forTid = " for '" + llkProcGetName(tid, tcomm, tcmdline) + "' (" + std::to_string(tid) + ")"; in llkKillOneProcess()
481 return llkKillOneProcess(pid, tprocp->state, tprocp->tid, tprocp->getComm(), in llkKillOneProcess()
491 return llkKillOneProcess(kprocp->tid, tprocp->state, tprocp->tid, tprocp->getComm(), in llkKillOneProcess()
524 void llkPanicKernel(bool dump, pid_t tid, const char* state, const std::string& message = "") { in llkPanicKernel() argument
529 llkKillOneProcess(initPid, 'R', tid); in llkPanicKernel()
559 auto piddir = procdir + std::to_string(tid) + "/stat"; in llkPanicKernel()
567 llkKillOneProcess(initPid, 'R', tid); in llkPanicKernel()
590 proc* llkTidLookup(pid_t tid) { in llkTidLookup() argument
591 auto search = tids.find(tid); in llkTidLookup()
598 void llkTidRemove(pid_t tid) { in llkTidRemove() argument
599 tids.erase(tid); in llkTidRemove()
602 proc* llkTidAlloc(pid_t tid, pid_t pid, pid_t ppid, const char* comm, int time, char state, in llkTidAlloc() argument
604 auto it = tids.emplace(std::make_pair(tid, proc(tid, pid, ppid, comm, time, state, frozen))); in llkTidAlloc()
1027 unsigned tid = -1; in llkCheck() local
1040 &tid, pdir, &state, &ppid, &utime, &stime, &dummy); in llkCheck()
1042 pid = tid; in llkCheck()
1044 LOG(VERBOSE) << "match " << match << ' ' << tid << " (" << pdir << ") " << state << ' ' in llkCheck()
1054 auto procp = llkTidLookup(tid); in llkCheck()
1056 procp = llkTidAlloc(tid, pid, ppid, pdir, utime + stime, state, frozen); in llkCheck()
1098 if ((tid == myTid) || llkSkipPid(tid)) { in llkCheck()
1144 << pid << "->" << tid << ' ' << process_comm; in llkCheck()
1152 << pid << "->" << tid << ' ' << process_comm; in llkCheck()
1180 << pid << "->" << tid << ' ' << process_comm << " [kill]"; in llkCheck()
1197 << "->" << tid << ' ' << process_comm << " [kill]"; in llkCheck()
1199 (llkKillOneProcess(pid, state, tid) >= 0) || in llkCheck()
1201 (llkKillOneProcess(tid, state, tid) >= 0)) { in llkCheck()
1209 auto taskdir = procdir + std::to_string(tid) + "/task/"; in llkCheck()
1218 std::to_string(tid) + " " + process_comm + " [panic]\n" + in llkCheck()
1221 llkPanicKernel(dump, tid, in llkCheck()
1238 if (p->second.pid != p->second.tid) { in llkCheck()
1243 llkProcGetName(p->second.tid, p->second.getComm(), p->second.getCmdline()); in llkCheck()
1246 << pidCmdline << "->" << p->second.tid << tidCmdline << " removed"; in llkCheck()