/base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/ |
D | dfx_dump_catcher.cpp | 61 static bool IsThreadInCurPid(int32_t tid) in IsThreadInCurPid() argument 63 std::string path = "/proc/self/task/" + std::to_string(tid); in IsThreadInCurPid() 106 bool DfxDumpCatcher::DoDumpLocalTid(const int tid, std::string& msg) in DoDumpLocalTid() argument 109 if (tid <= 0) { in DoDumpLocalTid() 114 if (DfxUnwindLocal::GetInstance().SendAndWaitRequest(tid)) { in DoDumpLocalTid() 119 msg.append(DfxUnwindLocal::GetInstance().CollectUnwindResult(tid)); in DoDumpLocalTid() 121 msg.append("Failed to dump thread:" + std::to_string(tid) + ".\n"); in DoDumpLocalTid() 154 pid_t tid = atoi(ent->d_name); in DoDumpLocalPid() local 155 if (tid == 0) { in DoDumpLocalPid() 160 if (tid == currentTid) { in DoDumpLocalPid() [all …]
|
/base/hiviewdfx/faultloggerd/example/ |
D | dump_catcher_demo.cpp | 41 static NOINLINE int TestFuncRemote(int32_t pid, int32_t tid) in TestFuncRemote() argument 45 bool ret = dumplog.DumpCatch(pid, tid, msg); in TestFuncRemote() 64 static bool ParseParameters(int argc, char *argv[], int32_t &pid, int32_t &tid) in ParseParameters() argument 78 tid = atoi(argv[4]); in ParseParameters() 82 tid = atoi(argv[2]); in ParseParameters() 99 int32_t tid = 0; in main() local 100 if (ParseParameters(argc, argv, pid, tid)) { in main() 101 TestFuncRemote(pid, tid); in main()
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/include/ |
D | dfx_dump_catcher.h | 44 bool DumpCatch(int pid, int tid, std::string& msg); 45 bool DumpCatchMix(int pid, int tid, std::string& msg); 46 bool DumpCatchFd(int pid, int tid, std::string& msg, int fd); 50 bool RequestCatchFrame(int tid); 51 bool CatchFrame(int tid, std::vector<std::shared_ptr<DfxFrame>>& frames); 56 bool DoDumpLocalTid(const int tid, std::string& msg); 58 bool DoDumpLocalLocked(int pid, int tid, std::string& msg); 59 bool DoDumpRemoteLocked(int pid, int tid, std::string& msg); 60 bool DoDumpCatchRemote(const int type, int pid, int tid, std::string& msg);
|
/base/hiviewdfx/faultloggerd/test/fuzztest/faultloggerd_fuzzer/ |
D | faultloggerd_fuzzer.cpp | 41 int tid[1]; in DumpStackTraceTest() local 47 err = memcpy_s(tid, sizeof(tid), data, PID_SIZE); in DumpStackTraceTest() 53 cout << "pid = " << pid[0] << " tid = " << tid[0] << " invalidOpt = " << invalidOption << endl; in DumpStackTraceTest() 55 if (catcher->DumpCatch(pid[0], tid[0], msg)) { in DumpStackTraceTest() 61 string processdumpCmd = "dumpcatcher -p " + to_string(pid[0]) + " -t " + to_string(tid[0]); in DumpStackTraceTest() 65 to_string(pid[0]) + " -t " + to_string(tid[0]); in DumpStackTraceTest()
|
/base/hiviewdfx/faultloggerd/tools/dump_catcher/ |
D | main.cpp | 55 static int ParseParamters(int argc, char *argv[], int &type, int32_t &pid, int32_t &tid) in ParseParamters() argument 95 tid = atoi(optarg); in ParseParamters() 122 int32_t tid = 0; in main() local 127 if (ParseParamters(argc, argv, type, pid, tid) <= 0) { in main() 131 DfxLogDebug("type: %d, pid: %d, tid: %d", type, pid, tid); in main() 132 OHOS::HiviewDFX::DumpCatcher::GetInstance().Dump(type, pid, tid); in main()
|
D | dump_catcher.cpp | 32 void DumpCatcher::Dump(int32_t type, int32_t pid, int32_t tid) const in Dump() 39 dumpRet = dfxDump.DumpCatch(pid, tid, msg); in Dump() 42 dumpRet = dfxDump.DumpCatchMix(pid, tid, msg); in Dump()
|
/base/hiviewdfx/faultloggerd/tools/process_dump/ |
D | dfx_process.cpp | 125 pid_t tid = atoi(ent->d_name); in InitOtherThreads() local 126 if (tid == 0) { in InitOtherThreads() 130 pid_t nstid = tid; in InitOtherThreads() 132 TidToNstid(tid, nstid); in InitOtherThreads() 140 InsertThreadNode(tid, nstid, attach); in InitOtherThreads() 146 void DfxProcess::InsertThreadNode(pid_t tid, pid_t nsTid, bool attach) in InsertThreadNode() argument 150 (*iter)->SetThreadId(tid); in InsertThreadNode() 156 auto thread = std::make_shared<DfxThread>(pid_, tid, nsTid); in InsertThreadNode() 163 int DfxProcess::TidToNstid(const int tid, int& nstid) in TidToNstid() argument 167 … if (snprintf_s(path, sizeof(path), sizeof(path) - 1, "/proc/%d/task/%d/status", pid_, tid) <= 0) { in TidToNstid() [all …]
|
D | dfx_logger.cpp | 74 void InitDebugLog(int type, int pid, int tid, unsigned int uid) in InitDebugLog() argument 76 DfxLogInfo("InitDebugLog :: type(%d), pid(%d), tid(%d), uid(%d).", type, pid, tid, uid); in InitDebugLog() 87 faultloggerdRequest.tid = tid; in InitDebugLog()
|
D | dfx_unwind_local.h | 48 std::string CollectUnwindResult(int32_t tid); 50 bool SendAndWaitRequest(int32_t tid); 59 bool SendLocalDumpRequest(int32_t tid);
|
D | dfx_dump_request.cpp | 66 void ProcessDumpRequest::SetTid(int32_t tid) in SetTid() argument 68 tid_ = tid; in SetTid() 76 void ProcessDumpRequest::SetRecycleTid(int32_t tid) in SetRecycleTid() argument 78 recycleTid_ = tid; in SetRecycleTid()
|
D | dfx_dump_request.h | 42 void SetTid(int32_t tid); 45 void SetRecycleTid(int32_t tid); 92 int32_t tid; member
|
D | dfx_util.cpp | 47 int tid = 0; in GetProcStatusByPath() local 62 procInfo.tid = gettid(); in GetProcStatusByPath() 81 if (sscanf_s(buf, "%*[^0-9]%d%*[^0-9]%d", &pid, &tid) != ARGS_COUNT_TWO) { in GetProcStatusByPath() 84 procInfo.tid = tid; in GetProcStatusByPath()
|
D | dfx_thread.cpp | 36 DfxThread::DfxThread(pid_t pid, pid_t tid, pid_t nsTid, const ucontext_t &context) in DfxThread() argument 37 :isCrashThread_(false), pid_(pid), tid_(tid), nsTid_(nsTid), unwStopReason_(-1) in DfxThread() 54 DfxThread::DfxThread(pid_t pid, pid_t tid, pid_t nsTid) in DfxThread() argument 55 :isCrashThread_(false), pid_(pid), tid_(tid), nsTid_(nsTid), unwStopReason_(-1) in DfxThread() 176 void DfxThread::SetThreadId(pid_t tid) in SetThreadId() argument 178 tid_ = tid; in SetThreadId()
|
D | dfx_thread.h | 32 DfxThread(pid_t pid, pid_t tid, pid_t nsTid, const ucontext_t &context); 33 DfxThread(pid_t pid, pid_t tid, pid_t nsTid); 40 void SetThreadId(pid_t tid);
|
D | dfx_fault_stack.h | 36 explicit FaultStack(int32_t tid) : tid_(tid) {}; in FaultStack() argument
|
D | dfx_unwind_local.cpp | 134 bool DfxUnwindLocal::SendAndWaitRequest(int32_t tid) in SendAndWaitRequest() argument 136 if (SendLocalDumpRequest(tid)) { in SendAndWaitRequest() 142 bool DfxUnwindLocal::SendLocalDumpRequest(int32_t tid) in SendLocalDumpRequest() argument 145 return syscall(SYS_tkill, tid, SIGLOCAL_DUMP) == 0; in SendLocalDumpRequest() 148 std::string DfxUnwindLocal::CollectUnwindResult(int32_t tid) in CollectUnwindResult() argument 150 if (tid < 0) { in CollectUnwindResult() 155 result << "Tid:" << tid; in CollectUnwindResult() 156 std::string path = "/proc/self/task/" + std::to_string(tid) + "/comm"; in CollectUnwindResult()
|
D | dfx_process.h | 40 void InsertThreadNode(pid_t tid, pid_t nsTid, bool attach = true); 48 int TidToNstid(const int tid, int& nstid);
|
D | dfx_logger.h | 26 void InitDebugLog(int type, int pid, int tid, unsigned int uid);
|
/base/hiviewdfx/faultloggerd/test/unittest/process_dump/src/ |
D | process_dump_test.cpp | 598 int32_t pid = 1, tid = 1; variable 600 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid, context); 615 int32_t pid = 243, tid = 243; variable 617 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid, context); 620 EXPECT_EQ(true, tid == threadId) << "ProcessDumpTest034 failed"; 632 int32_t pid = 243, tid = 243; variable 633 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid); 635 EXPECT_EQ(true, threadId == tid) << "ProcessDumpTest035 failed"; 647 int32_t pid = 1, tid = 1; variable 648 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid); [all …]
|
D | process_dfx_test.cpp | 96 pid_t tid = accountmgrPid; variable 97 std::shared_ptr<DfxThread> keyThread = std::make_shared<DfxThread>(pid, tid, tid); 257 pid_t tid = 100; variable 258 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid);
|
/base/hiviewdfx/hilog/frameworks/libhilog/ |
D | hilog_printf.cpp | 153 .tid = header.tid, in PrintLog() 259 header.tid = static_cast<uint32_t>(GetCurrentThreadId()); in HiLogPrintArgs() 261 uint64_t tid; in HiLogPrintArgs() local 262 pthread_threadid_np(NULL, &tid); in HiLogPrintArgs() 263 header.tid = static_cast<uint32_t>(tid); in HiLogPrintArgs() 265 header.tid = static_cast<uint32_t>(syscall(SYS_gettid)); in HiLogPrintArgs()
|
/base/hiviewdfx/faultloggerd/test/unittest/services/src/ |
D | faultlogger_daemon_test.cpp | 65 faultloggerdRequest.tid = gettid(); 98 faultloggerdRequest.tid = gettid(); 132 faultloggerdRequest.tid = gettid(); 135 faultloggerdRequest.tid = 0;
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client/ |
D | faultloggerd_client.cpp | 76 request->tid = gettid(); in FillRequest() 241 int RequestSdkDump(int32_t type, int32_t pid, int32_t tid) in RequestSdkDump() argument 243 DfxLogInfo("RequestSdkDump :: type(%d), pid(%d), tid(%d).", type, pid, tid); in RequestSdkDump() 244 if (pid <= 0 || tid < 0) { in RequestSdkDump() 255 request.tid = tid; in RequestSdkDump()
|
/base/hiviewdfx/hilog/services/hilogd/include/ |
D | log_data.h | 38 uint32_t tid; member 71 … tv_sec(msg.tv_sec), tv_nsec(msg.tv_nsec), mono_sec(msg.mono_sec), pid(msg.pid), tid(msg.tid), in HilogData()
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client/include/ |
D | faultloggerd_client.h | 75 int32_t tid; member 91 int RequestSdkDump(int32_t type, int32_t pid, int32_t tid);
|