| /base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/ |
| D | thread_context.cpp | 68 std::shared_ptr<ThreadContext> GetContextLocked(int32_t tid) in GetContextLocked() argument 70 auto it = g_contextMap.find(tid); in GetContextLocked() 73 threadContext->tid = tid; in GetContextLocked() 76 g_contextMap[tid] = threadContext; in GetContextLocked() 80 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) { in GetContextLocked() 81 it->second->tid = tid; in GetContextLocked() 86 LOGE("GetContextLocked nullptr, tid: %d", tid); in GetContextLocked() 90 AT_UNUSED bool RemoveContextLocked(int32_t tid) in RemoveContextLocked() argument 92 auto it = g_contextMap.find(tid); in RemoveContextLocked() 94 LOGW("Context of tid(%d) is already removed.", tid); in RemoveContextLocked() [all …]
|
| D | dfx_ptrace.cpp | 33 void DfxPtrace::Detach(pid_t tid) in Detach() argument 35 if (tid > 0) { in Detach() 36 ptrace(PTRACE_CONT, tid, 0, 0); in Detach() 37 ptrace(PTRACE_DETACH, tid, nullptr, nullptr); in Detach() 41 bool DfxPtrace::Attach(pid_t tid, int timeout) in Attach() argument 43 if (tid <= 0) { in Attach() 47 if (ptrace(PTRACE_SEIZE, tid, 0, 0) != 0) { in Attach() 48 LOGW("Failed to seize tid(%d), errno=%d", tid, errno); in Attach() 52 if (ptrace(PTRACE_INTERRUPT, tid, 0, 0) != 0) { in Attach() 53 LOGW("Failed to interrupt tid(%d), errno=%d", tid, errno); in Attach() [all …]
|
| /base/request/request/frameworks/native/src/ |
| D | request_service_proxy.cpp | 59 int32_t RequestServiceProxy::Create(const Config &config, std::string &tid) in Create() argument 105 tid = std::to_string(reply.ReadInt32()); in Create() 151 int32_t RequestServiceProxy::GetTask(const std::string &tid, const std::string &token, Config &conf… in GetTask() argument 153 REQUEST_HILOGD("Request GetTask, tid: %{public}s", tid.c_str()); in GetTask() 157 data.WriteString(tid); in GetTask() 161 … REQUEST_HILOGE("End Request GetTask, tid: %{public}s, failed: %{public}d", tid.c_str(), ret); in GetTask() 172 REQUEST_HILOGD("End Request GetTask ok, tid: %{public}s", tid.c_str()); in GetTask() 176 int32_t RequestServiceProxy::Start(const std::string &tid) in Start() argument 178 REQUEST_HILOGD("Request Start, tid: %{public}s", tid.c_str()); in Start() 182 data.WriteString(tid); in Start() [all …]
|
| D | request_manager.cpp | 31 int32_t RequestManager::Create(const Config &config, int32_t seq, std::string &tid) in Create() argument 33 return RequestManagerImpl::GetInstance()->Create(config, seq, tid); in Create() 35 int32_t RequestManager::GetTask(const std::string &tid, const std::string &token, Config &config) in GetTask() argument 37 return RequestManagerImpl::GetInstance()->GetTask(tid, token, config); in GetTask() 39 int32_t RequestManager::Start(const std::string &tid) in Start() argument 41 return RequestManagerImpl::GetInstance()->Start(tid); in Start() 43 int32_t RequestManager::Stop(const std::string &tid) in Stop() argument 45 return RequestManagerImpl::GetInstance()->Stop(tid); in Stop() 48 int32_t RequestManager::Query(const std::string &tid, TaskInfo &info) in Query() argument 50 return RequestManagerImpl::GetInstance()->Query(tid, info); in Query() [all …]
|
| D | request_manager_impl.cpp | 48 int32_t RequestManagerImpl::Create(const Config &config, int32_t seq, std::string &tid) in Create() argument 52 int ret = CallProxyMethod(&RequestServiceInterface::Create, config, tid); in Create() 55 ret = CallProxyMethod(&RequestServiceInterface::Subscribe, tid); in Create() 58 ret = CallProxyMethod(&RequestServiceInterface::Start, tid); in Create() 66 int32_t RequestManagerImpl::GetTask(const std::string &tid, const std::string &token, Config &confi… in GetTask() argument 70 int32_t ret = CallProxyMethod(&RequestServiceInterface::GetTask, tid, token, config); in GetTask() 73 ret = CallProxyMethod(&RequestServiceInterface::Subscribe, tid); in GetTask() 76 REQUEST_HILOGE("Request getTask, tid: %{public}s, failed: %{public}d", tid.c_str(), ret); in GetTask() 82 int32_t RequestManagerImpl::Start(const std::string &tid) in Start() argument 84 return CallProxyMethod(&RequestServiceInterface::Start, tid); in Start() [all …]
|
| /base/hiviewdfx/faultloggerd/test/benchmarktest/unwinder/ |
| D | unwind_local_tid_benchmark.cpp | 41 NOINLINE int TestFunc6(std::atomic_int* tid, std::atomic_bool* done) in TestFunc6() argument 43 tid->store(gettid()); in TestFunc6() 49 NOINLINE int TestFunc5(std::atomic_int* tid, std::atomic_bool* done) in TestFunc5() argument 51 int val = TestFunc6(tid, done); in TestFunc5() 55 NOINLINE int TestFunc4(std::atomic_int* tid, std::atomic_bool* done) in TestFunc4() argument 57 int val = TestFunc5(tid, done); in TestFunc4() 61 NOINLINE int TestFunc3(std::atomic_int* tid, std::atomic_bool* done) in TestFunc3() argument 63 int val = TestFunc4(tid, done); in TestFunc3() 67 NOINLINE int TestFunc2(std::atomic_int* tid, std::atomic_bool* done) in TestFunc2() argument 69 int val = TestFunc3(tid, done); in TestFunc2() [all …]
|
| /base/hiviewdfx/faultloggerd/test/unittest/process_dump/ |
| D | lock_parser_test.cpp | 88 void WaitThreadBlock(int& tid) in WaitThreadBlock() argument 91 if (tid > 0) { in WaitThreadBlock() 92 printf("WaitThreadBlock:%d\n", tid); in WaitThreadBlock() 113 int tid = 0; variable 114 std::thread t1([&tid, &mutex] { in __anonc3ae7ae70202() 115 tid = gettid(); in __anonc3ae7ae70202() 116 printf("BlockTid:%d\n", tid); in __anonc3ae7ae70202() 120 WaitThreadBlock(tid); 121 printf("CurrentTid:%d BlockTid:%d\n", gettid(), tid); 123 ASSERT_EQ(unwinder->UnwindLocalWithTid(tid), true); [all …]
|
| D | process_dump_test.cpp | 87 pid_t tid = accountmgrPid; variable 88 auto keyThread = DfxThread::Create(pid, tid, tid); 143 pthread_t tid; variable 145 pthread_create(&tid, NULL, SleepThread, &threadID[0]); 146 std::shared_ptr<DfxProcess> process2 = DfxProcess::Create(pid, tid); 148 pthread_join(tid, NULL); 163 int32_t pid = 1, tid = 1; variable 164 auto thread = DfxThread::Create(pid, tid, tid); 177 int32_t pid = 243, tid = 243; variable 178 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid); [all …]
|
| /base/hiviewdfx/faultloggerd/interfaces/innerkits/backtrace/ |
| D | backtrace_local.cpp | 42 std::string GetThreadHead(int32_t tid) in GetThreadHead() argument 46 if (tid == BACKTRACE_CURRENT_THREAD) { in GetThreadHead() 47 tid = gettid(); in GetThreadHead() 49 ReadThreadName(tid, threadName); in GetThreadHead() 50 threadHead << "Tid:" << tid << ", Name:" << threadName << "\n"; in GetThreadHead() 55 bool GetBacktraceFramesByTid(std::vector<DfxFrame>& frames, int32_t tid, size_t skipFrameNum, bool … in GetBacktraceFramesByTid() argument 60 if (fast || (tid != BACKTRACE_CURRENT_THREAD)) { in GetBacktraceFramesByTid() 67 BacktraceLocalThread thread(tid, unwinder); in GetBacktraceFramesByTid() 73 bool GetBacktraceStringByTid(std::string& out, int32_t tid, size_t skipFrameNum, bool fast, in GetBacktraceStringByTid() argument 77 bool ret = GetBacktraceFramesByTid(frames, tid, skipFrameNum + 1, fast, maxFrameNums); in GetBacktraceStringByTid() [all …]
|
| /base/request/request/frameworks/native/include/ |
| D | request_service_proxy.h | 32 int32_t Create(const Config &config, std::string &tid) override; 33 int32_t GetTask(const std::string &tid, const std::string &token, Config &config) override; 34 int32_t Start(const std::string &tid) override; 35 int32_t Pause(const std::string &tid, Version version) override; 36 int32_t QueryMimeType(const std::string &tid, std::string &mimeType) override; 37 int32_t Remove(const std::string &tid, Version version) override; 38 int32_t Resume(const std::string &tid) override; 40 int32_t Stop(const std::string &tid) override; 41 int32_t Query(const std::string &tid, TaskInfo &info) override; 42 int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info) override; [all …]
|
| D | request_service_interface.h | 32 virtual int32_t GetTask(const std::string &tid, const std::string &token, Config &config) = 0; 33 virtual int32_t Start(const std::string &tid) = 0; 34 virtual int32_t Pause(const std::string &tid, Version version) = 0; 35 virtual int32_t QueryMimeType(const std::string &tid, std::string &mimeType) = 0; 36 virtual int32_t Remove(const std::string &tid, Version version) = 0; 37 virtual int32_t Resume(const std::string &tid) = 0; 39 virtual int32_t Stop(const std::string &tid) = 0; 40 virtual int32_t Query(const std::string &tid, TaskInfo &info) = 0; 41 virtual int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info) = 0; 43 virtual int32_t Show(const std::string &tid, TaskInfo &info) = 0;
|
| D | request_manager.h | 31 REQUEST_API int32_t Create(const Config &config, int32_t seq, std::string &tid); 32 REQUEST_API int32_t GetTask(const std::string &tid, const std::string &token, Config &config); 33 REQUEST_API int32_t Start(const std::string &tid); 34 REQUEST_API int32_t Stop(const std::string &tid); 35 REQUEST_API int32_t Query(const std::string &tid, TaskInfo &info); 36 REQUEST_API int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info); 38 REQUEST_API int32_t Show(const std::string &tid, TaskInfo &info); 39 REQUEST_API int32_t Pause(const std::string &tid, Version version); 40 REQUEST_API int32_t QueryMimeType(const std::string &tid, std::string &mimeType); 41 REQUEST_API int32_t Remove(const std::string &tid, Version version); [all …]
|
| D | request_manager_impl.h | 47 int32_t Create(const Config &config, int32_t seq, std::string &tid); 48 int32_t GetTask(const std::string &tid, const std::string &token, Config &config); 49 int32_t Start(const std::string &tid); 50 int32_t Stop(const std::string &tid); 51 int32_t Query(const std::string &tid, TaskInfo &info); 52 int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info); 54 int32_t Show(const std::string &tid, TaskInfo &info); 55 int32_t Pause(const std::string &tid, Version version); 56 int32_t QueryMimeType(const std::string &tid, std::string &mimeType); 57 int32_t Remove(const std::string &tid, Version version); [all …]
|
| /base/request/request/test/unittest/cpp_test/fwkTest/src/ |
| D | request_manager_impl_test.cpp | 45 …MOCK_METHOD(int32_t, GetTask, (const std::string &tid, const std::string &token, Config &config), … 46 MOCK_METHOD(int32_t, Start, (const std::string &tid), (override)); 47 MOCK_METHOD(int32_t, Pause, (const std::string &tid, Version version), (override)); 48 … MOCK_METHOD(int32_t, QueryMimeType, (const std::string &tid, std::string &mimeType), (override)); 49 MOCK_METHOD(int32_t, Remove, (const std::string &tid, Version version), (override)); 50 MOCK_METHOD(int32_t, Resume, (const std::string &tid), (override)); 51 MOCK_METHOD(int32_t, Stop, (const std::string &tid), (override)); 52 MOCK_METHOD(int32_t, Query, (const std::string &tid, TaskInfo &info), (override)); 53 …MOCK_METHOD(int32_t, Touch, (const std::string &tid, const std::string &token, TaskInfo &info), (o… 55 MOCK_METHOD(int32_t, Show, (const std::string &tid, TaskInfo &info), (override)); [all …]
|
| D | request_manager_test.cpp | 84 std::string tid = "1"; variable 85 RequestManager::GetInstance()->Create(config, seq, tid); 97 std::string tidStr = "tid"; 101 std::string tid = "1"; variable 102 RequestManager::GetInstance()->Create(config, seq, tid); 115 std::string tidStr = "tid"; 128 std::string tid = "tid"; variable 129 RequestManager::GetInstance()->Stop(tid); 141 std::string tid = "tid"; variable 143 RequestManager::GetInstance()->Query(tid, info); [all …]
|
| /base/hiviewdfx/faultloggerd/interfaces/innerkits/procinfo/include/ |
| D | procinfo.h | 58 * @brief convert real tid to namespace tid 61 * @param tid thread id 62 * @param nsTid namespace tid(output parameter) 65 bool TidToNstid(const int pid, const int tid, int& nstid); 67 * @brief convert real tid to namespace tid 70 * @param tid thread id 73 bool IsThreadInPid(int32_t pid, int32_t tid); 94 * @param tid thread id 97 void ReadThreadName(const int tid, std::string& str); 100 * @param tid thread id [all …]
|
| /base/request/request/services/src/service/client/ |
| D | manager.rs | 84 ClientEvent::Subscribe(tid, pid, uid, token_id, tx) => { in run() 85 self.handle_subscribe(tid, pid, uid, token_id, tx) in run() 87 ClientEvent::Unsubscribe(tid, tx) => self.handle_unsubscribe(tid, tx), in run() 88 ClientEvent::TaskFinished(tid) => self.handle_task_finished(tid), in run() 90 ClientEvent::SendResponse(tid, version, status_code, reason, headers) => { in run() 91 if let Some(&pid) = self.pid_map.get(&tid) { in run() 94 tid, in run() 151 tid: u32, in handle_subscribe() 158 self.pid_map.insert(tid, pid); in handle_subscribe() 166 fn handle_unsubscribe(&mut self, tid: u32, tx: Sender<ErrorCode>) { in handle_unsubscribe() [all …]
|
| /base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/include/ |
| D | dfx_dump_catcher.h | 37 * @brief Dump native stack by specify pid and tid 40 * @param tid thread id 46 bool DumpCatch(int pid, int tid, std::string& msg, size_t maxFrameNums = DEFAULT_MAX_FRAME_NUM, 50 * @brief Dump native and js mixed-stack by specify pid and tid 53 * @param tid thread id 57 bool DumpCatchMix(int pid, int tid, std::string& msg); 60 * @brief Dump native stack by specify pid and tid to file 63 * @param tid thread id 69 …bool DumpCatchFd(int pid, int tid, std::string& msg, int fd, size_t maxFrameNums = DEFAULT_MAX_FRA… 75 * @param tid thread id [all …]
|
| /base/hiviewdfx/faultloggerd/tools/dump_catcher/ |
| D | main.cpp | 37 std::cout << "-p pid -t tid dump the stacktrace of the thread with given tid." << std::endl; in PrintCommandHelp() 45 std::cout << "pid and tid must > 0." << std::endl; in PrintCommandFailed() 48 static int ParseParamters(int argc, char *argv[], int &type, int32_t &pid, int32_t &tid) in ParseParamters() argument 88 tid = atoi(optarg); in ParseParamters() 115 int32_t tid = 0; in main() local 120 if (ParseParamters(argc, argv, type, pid, tid) <= 0) { in main() 124 DFXLOG_DEBUG("type: %d, pid: %d, tid: %d", type, pid, tid); in main() 125 OHOS::HiviewDFX::DumpCatcher::GetInstance().Dump(type, pid, tid); in main()
|
| /base/hiviewdfx/faultloggerd/example/ |
| D | dump_catcher_demo.cpp | 29 static NOINLINE int TestFuncDump(int32_t pid, int32_t tid, bool isJson) in TestFuncDump() argument 37 bool ret = dumplog.DumpCatch(pid, tid, msg, OHOS::HiviewDFX::DEFAULT_MAX_FRAME_NUM, isJson); in TestFuncDump() 69 static bool ParseParameters(int argc, char *argv[], int32_t &pid, int32_t &tid) in ParseParameters() argument 79 tid = atoi(argv[2]); in ParseParameters() 88 tid = atoi(argv[4]); in ParseParameters() 92 tid = atoi(argv[2]); in ParseParameters() 109 int32_t tid = 0; in main() local 110 if (ParseParameters(argc, argv, pid, tid)) { in main() 111 TestFuncDump(pid, tid, true); in main()
|
| /base/hiviewdfx/faultloggerd/interfaces/innerkits/procinfo/ |
| D | procinfo.cpp | 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 146 path = StringPrintf("%s/%d", PROC_SELF_TASK_PATH, tid); 148 path = StringPrintf("/proc/%d/task/%d", pid, tid); 169 pid_t tid = atoi(files[i].c_str()); local 170 if (tid == 0) { 173 tids.emplace_back(tid); 176 func(tid); 190 func = [&](int tid) { argument [all …]
|
| /base/request/request/frameworks/js/napi/src/ |
| D | js_task.cpp | 162 context->task->SetTid(context->tid); in JsMain() 167 REQUEST_HILOGI("End create seq %{public}d, tid %{public}s", seq, context->tid.c_str()); in JsMain() 180 JsTask::AddTaskMap(context->tid, context->task); in AddTask() 184 JsTask::AddTaskContextMap(context->tid, context); in AddTask() 196 int32_t ret = RequestManager::GetInstance()->Create(context->task->config_, seq, context->tid); in CreateExec() 207 std::string tid = context->tid; in AddRemoveListener() local 210 std::make_shared<JSNotifyDataListener>(context->env_, tid, SubscribeType::REMOVE); in AddRemoveListener() 213 tid, SubscribeType::REMOVE, context->task->notifyDataListenerMap_[SubscribeType::REMOVE]); in AddRemoveListener() 334 …REQUEST_HILOGE("End get task in AsyncCall input, seq: %{public}d, failed: parse tid or token fail"… in GetTask() 352 context->task->SetTid(context->tid); in GetTask() [all …]
|
| /base/hiviewdfx/faultloggerd/test/fuzztest/faultloggerddumpcatcher_fuzzer/ |
| D | faultloggerddumpcatcher_fuzzer.cpp | 32 int tid; in DumpStackTraceTest() local 33 int offsetTotalLength = sizeof(pid) + sizeof(tid) + in DumpStackTraceTest() 40 STREAM_TO_VALUEINFO(data, tid); in DumpStackTraceTest() 48 catcher->DumpCatch(pid, tid, msg, DEFAULT_MAX_FRAME_NUM, false); in DumpStackTraceTest() 50 …td::string processdumpCmd = "dumpcatcher -p " + std::to_string(pid) + " -t " + std::to_string(tid); in DumpStackTraceTest() 54 std::to_string(pid) + " -t " + std::to_string(tid); in DumpStackTraceTest()
|
| /base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include/ |
| D | thread_context.h | 37 std::atomic<int32_t> tid {ThreadContextStatus::CONTEXT_UNUSED}; 70 bool GetStackRange(int32_t tid, uintptr_t& stackBottom, uintptr_t& stackTop); 71 std::shared_ptr<ThreadContext> CollectThreadContext(int32_t tid); 72 std::shared_ptr<ThreadContext> GetThreadContext(int32_t tid); 73 void ReleaseThread(int32_t tid); 81 bool SignalRequestThread(int32_t tid, ThreadContext* ctx);
|
| /base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/ |
| D | dfx_dump_catcher.cpp | 109 bool DfxDumpCatcher::DoDumpLocalTid(const int tid, std::string& msg, size_t maxFrameNums) in DoDumpLocalTid() argument 112 if (tid <= 0) { in DoDumpLocalTid() 116 ret = GetBacktraceStringByTid(msg, tid, 0, false, maxFrameNums); in DoDumpLocalTid() 118 msg.append("Failed to dump thread:" + std::to_string(tid) + ".\n"); in DoDumpLocalTid() 134 std::function<bool(int)> func = [&](int tid) { in DoDumpLocalPid() argument 135 if (tid <= 0) { in DoDumpLocalPid() 139 if (tid == getproctid()) { in DoDumpLocalPid() 142 ret = DoDumpLocalTid(tid, threadMsg, maxFrameNums); in DoDumpLocalPid() 157 bool DfxDumpCatcher::DoDumpRemoteLocked(int pid, int tid, std::string& msg, bool isJson, int timeou… in DoDumpRemoteLocked() argument 159 return DoDumpCatchRemote(pid, tid, msg, isJson, timeout); in DoDumpRemoteLocked() [all …]
|