/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/ |
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 …]
|
D | thread_context.cpp | 64 std::shared_ptr<ThreadContext> GetContextLocked(int32_t tid) in GetContextLocked() argument 66 auto it = g_contextMap.find(tid); in GetContextLocked() 69 threadContext->tid = tid; in GetContextLocked() 72 g_contextMap[tid] = threadContext; in GetContextLocked() 76 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) { in GetContextLocked() 77 it->second->tid = tid; in GetContextLocked() 82 LOGE("GetContextLocked nullptr, tid: %d", tid); in GetContextLocked() 86 AT_UNUSED bool RemoveContextLocked(int32_t tid) in RemoveContextLocked() argument 88 auto it = g_contextMap.find(tid); in RemoveContextLocked() 90 LOGW("Context of tid(%d) is already removed.", tid); in RemoveContextLocked() [all …]
|
/base/request/request/frameworks/native/src/ |
D | request_service_proxy.cpp | 39 int32_t RequestServiceProxy::Create(const Config &config, std::string &tid) in Create() argument 79 tid = std::to_string(reply.ReadInt32()); in Create() 135 int32_t RequestServiceProxy::GetTask(const std::string &tid, const std::string &token, Config &conf… in GetTask() argument 137 REQUEST_HILOGI("Process send get task request, tid: %{public}s", tid.c_str()); in GetTask() 141 data.WriteString(tid); in GetTask() 145 …GE("End send get task request, tid: %{public}s, failed with reason: %{public}d", tid.c_str(), ret); in GetTask() 151 …"End send get task request, tid: %{public}s, failed with reason: %{public}d", tid.c_str(), errCode… in GetTask() 155 REQUEST_HILOGI("End send get task request successfully, tid: %{public}s", tid.c_str()); in GetTask() 159 int32_t RequestServiceProxy::Start(const std::string &tid) in Start() argument 161 REQUEST_HILOGI("Process send start request, tid: %{public}s", tid.c_str()); in Start() [all …]
|
D | request_manager.cpp | 28 int32_t RequestManager::Create(const Config &config, int32_t seq, std::string &tid) in Create() argument 30 return RequestManagerImpl::GetInstance()->Create(config, seq, tid); in Create() 32 int32_t RequestManager::GetTask(const std::string &tid, const std::string &token, Config &config) in GetTask() argument 34 return RequestManagerImpl::GetInstance()->GetTask(tid, token, config); in GetTask() 36 int32_t RequestManager::Start(const std::string &tid) in Start() argument 38 return RequestManagerImpl::GetInstance()->Start(tid); in Start() 40 int32_t RequestManager::Stop(const std::string &tid) in Stop() argument 42 return RequestManagerImpl::GetInstance()->Stop(tid); in Stop() 45 int32_t RequestManager::Query(const std::string &tid, TaskInfo &info) in Query() argument 47 return RequestManagerImpl::GetInstance()->Query(tid, info); in Query() [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 | 29 REQUEST_API int32_t Create(const Config &config, int32_t seq, std::string &tid); 30 REQUEST_API int32_t GetTask(const std::string &tid, const std::string &token, Config &config); 31 REQUEST_API int32_t Start(const std::string &tid); 32 REQUEST_API int32_t Stop(const std::string &tid); 33 REQUEST_API int32_t Query(const std::string &tid, TaskInfo &info); 34 REQUEST_API int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info); 36 REQUEST_API int32_t Show(const std::string &tid, TaskInfo &info); 37 REQUEST_API int32_t Pause(const std::string &tid, Version version); 38 REQUEST_API int32_t QueryMimeType(const std::string &tid, std::string &mimeType); 39 REQUEST_API int32_t Remove(const std::string &tid, Version version); [all …]
|
/base/request/request/services/src/service/command/ |
D | get_task.rs | 23 let tid: String = data.read()?; in get_task() localVariable 24 info!("Process Service getTask: task_id is {}", tid); in get_task() 25 match tid.parse::<u32>() { in get_task() 26 Ok(tid) => { in get_task() 27 debug!("Service getTask: u32 task_id is {}", tid); in get_task() 31 let (event, rx) = TaskManagerEvent::get_task(uid, tid, token); in get_task() 38 info!("End Service getTask successfully: task_id is {}", tid); in get_task() 43 … error!("End Service getTask, task_id is {}, failed with reason: task_id or token not found", tid); in get_task() 48 …error!("End Service getTask, task_id is {}, failed with reason: receives task_config failed", tid); in get_task() 54 … error!("End Service getTask, task_id is {}, failed with reason: task_id or token not valid", tid); in get_task()
|
D | subscribe.rs | 23 let tid: String = data.read()?; in subscribe() localVariable 24 info!("Process Service subscribe: task_id is {}", tid); in subscribe() 28 match tid.parse::<u32>() { in subscribe() 29 Ok(tid) => { in subscribe() 30 let (event, rx) = TaskManagerEvent::subscribe(tid, token_id); in subscribe() 35 tid in subscribe() 42 … error!("End Service subscribe, task_id is {}, failed with reason: receives ret failed", tid); in subscribe() 51 tid, ret in subscribe() 57 let ret = self.client_manager.subscribe(tid, pid, uid, token_id); in subscribe() 60 info!("End Service subscribe successfully: task_id is {}", tid); in subscribe() [all …]
|
D | unsubscribe.rs | 22 let tid: String = data.read()?; in unsubscribe() localVariable 23 info!("Process Service unsubscribe: task_id is {}", tid); in unsubscribe() 24 match tid.parse::<u32>() { in unsubscribe() 25 Ok(tid) => { in unsubscribe() 26 if self.client_manager.unsubscribe(tid) == ErrorCode::ErrOk { in unsubscribe() 28 info!("End Service unsubscribe successfully: task_id is {}", tid); in unsubscribe() 31 debug!("unsubscribe failed, task_id is {}", tid); in unsubscribe()
|
/base/request/request/test/unittest/cpp_test/fwkTest/src/ |
D | request_manager_impl_test.cpp | 40 …MOCK_METHOD(int32_t, GetTask, (const std::string &tid, const std::string &token, Config &config), … 41 MOCK_METHOD(int32_t, Start, (const std::string &tid), (override)); 42 MOCK_METHOD(int32_t, Pause, (const std::string &tid, Version version), (override)); 43 … MOCK_METHOD(int32_t, QueryMimeType, (const std::string &tid, std::string &mimeType), (override)); 44 MOCK_METHOD(int32_t, Remove, (const std::string &tid, Version version), (override)); 45 MOCK_METHOD(int32_t, Resume, (const std::string &tid), (override)); 46 MOCK_METHOD(int32_t, Stop, (const std::string &tid), (override)); 47 MOCK_METHOD(int32_t, Query, (const std::string &tid, TaskInfo &info), (override)); 48 …MOCK_METHOD(int32_t, Touch, (const std::string &tid, const std::string &token, TaskInfo &info), (o… 50 MOCK_METHOD(int32_t, Show, (const std::string &tid, TaskInfo &info), (override)); [all …]
|
D | request_manager_test.cpp | 94 std::string tid = "1"; variable 95 RequestManager::GetInstance()->Create(config, seq, tid); 110 std::string tid = "1"; variable 111 RequestManager::GetInstance()->Create(config, seq, tid); 135 std::string tid = "tid"; variable 136 RequestManager::GetInstance()->Stop(tid); 147 std::string tid = "tid"; variable 149 RequestManager::GetInstance()->Query(tid, info); 160 std::string tid = "tid"; variable 163 RequestManager::GetInstance()->Touch(tid, token, info); [all …]
|
D | request_test.cpp | 73 string tid = "testTid"; variable 74 Request request = Request(tid); 75 EXPECT_EQ(request.getId(), tid); 97 string tid = "testTid"; variable 99 Request request = Request(tid); 127 string tid = "testTid"; variable 129 Request request = Request(tid); 151 string tid = "testTid"; variable 153 Request request = Request(tid); 175 string tid = "testTid"; variable [all …]
|
/base/request/request/test/fuzztest/downloaduploadmanager_fuzzer/ |
D | downloaduploadmanager_fuzzer.cpp | 74 auto tid = std::to_string(size); in CreateRequestFuzzTest() local 78 RequestManager::GetInstance()->Create(config, seq, tid); in CreateRequestFuzzTest() 83 std::string tid(reinterpret_cast<const char *>(data), size); in StartRequestFuzzTest() 85 RequestManager::GetInstance()->Start(tid); in StartRequestFuzzTest() 90 std::string tid(reinterpret_cast<const char *>(data), size); in StopRequestFuzzTest() 92 RequestManager::GetInstance()->Stop(tid); in StopRequestFuzzTest() 98 std::string tid(reinterpret_cast<const char *>(data), size); in ShowRequestFuzzTest() 100 RequestManager::GetInstance()->Show(tid, info); in ShowRequestFuzzTest() 106 std::string tid(reinterpret_cast<const char *>(data), size); in TouchRequestFuzzTest() 109 RequestManager::GetInstance()->Touch(tid, token, info); in TouchRequestFuzzTest() [all …]
|
/base/request/request/services/src/service/client/ |
D | manager.rs | 81 ClientEvent::Subscribe(tid, pid, uid, token_id, tx) => { in run() 82 self.handle_subscribe(tid, pid, uid, token_id, tx) in run() 84 ClientEvent::Unsubscribe(tid, tx) => self.handle_unsubscribe(tid, tx), in run() 85 ClientEvent::TaskFinished(tid) => self.handle_task_finished(tid), in run() 87 ClientEvent::SendResponse(tid, version, status_code, reason, headers) => { in run() 88 if let Some(&pid) = self.pid_map.get(&tid) { in run() 91 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/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/backtrace/ |
D | backtrace_local.cpp | 43 bool GetBacktraceFramesByTid(std::vector<DfxFrame>& frames, int32_t tid, size_t skipFrameNum, bool … in GetBacktraceFramesByTid() argument 48 if (fast || (tid != BACKTRACE_CURRENT_THREAD)) { in GetBacktraceFramesByTid() 55 BacktraceLocalThread thread(tid, unwinder); in GetBacktraceFramesByTid() 61 bool GetBacktraceStringByTid(std::string& out, int32_t tid, size_t skipFrameNum, bool fast, in GetBacktraceStringByTid() argument 65 bool ret = GetBacktraceFramesByTid(frames, tid, skipFrameNum + 1, fast, maxFrameNums); in GetBacktraceStringByTid() 69 } else if (DfxGetKernelStack(tid, out) == 0) { in GetBacktraceStringByTid() 141 std::function<bool(int)> func = [&](int tid) { in GetProcessStacktrace() argument 142 if (tid <= 0 || tid == getproctid()) { in GetProcessStacktrace() 145 BacktraceLocalThread thread(tid, unwinder); in GetProcessStacktrace() 150 if (tid == getprocpid()) { in GetProcessStacktrace() [all …]
|
/base/hiviewdfx/faultloggerd/test/unittest/process_dump/ |
D | process_dump_test.cpp | 73 pid_t tid = accountmgrPid; variable 74 auto keyThread = DfxThread::Create(pid, tid, tid); 123 int32_t pid = 1, tid = 1; variable 124 auto thread = DfxThread::Create(pid, tid, tid); 137 int32_t pid = 243, tid = 243; variable 138 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid); 155 pid_t tid = pid; variable 156 std::shared_ptr<DfxThread> thread = DfxThread::Create(pid, tid, tid);
|
/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); 158 pid_t tid = atoi(files[i].c_str()); local 159 if (tid == 0) { 162 tids.push_back(tid); 165 func(tid); 179 func = [&](int tid) { argument [all …]
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include/ |
D | thread_context.h | 37 std::atomic<int32_t> tid {ThreadContextStatus::CONTEXT_UNUSED}; 68 bool GetStackRange(int32_t tid, uintptr_t& stackBottom, uintptr_t& stackTop); 69 std::shared_ptr<ThreadContext> CollectThreadContext(int32_t tid); 70 std::shared_ptr<ThreadContext> GetThreadContext(int32_t tid); 71 void ReleaseThread(int32_t tid); 79 bool SignalRequestThread(int32_t tid, ThreadContext* ctx);
|
/base/hiviewdfx/faultloggerd/test/fuzztest/faultloggerd_fuzzer/ |
D | faultloggerd_fuzzer.cpp | 39 int tid[1]; in DumpStackTraceTest() local 46 err = memcpy_s(tid, sizeof(tid), data, PID_SIZE); in DumpStackTraceTest() 53 catcher->DumpCatch(pid[0], tid[0], msg, DEFAULT_MAX_FRAME_NUM, false); in DumpStackTraceTest() 55 …ring processdumpCmd = "dumpcatcher -p " + std::to_string(pid[0]) + " -t " + std::to_string(tid[0]); in DumpStackTraceTest() 59 std::to_string(pid[0]) + " -t " + std::to_string(tid[0]); in DumpStackTraceTest() 72 int32_t tid[1]; in FaultloggerdClientTest() local 79 err = memcpy_s(tid, sizeof(tid), data, sizeof(int32_t)); in FaultloggerdClientTest() 95 RequestSdkDump(pid[0], tid[0]); in FaultloggerdClientTest()
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/ |
D | dfx_dump_catcher.cpp | 76 bool DfxDumpCatcher::DoDumpLocalTid(const int tid, std::string& msg, size_t maxFrameNums) in DoDumpLocalTid() argument 79 if (tid <= 0) { in DoDumpLocalTid() 83 ret = GetBacktraceStringByTid(msg, tid, 0, false, maxFrameNums); in DoDumpLocalTid() 85 msg.append("Failed to dump thread:" + std::to_string(tid) + ".\n"); in DoDumpLocalTid() 100 std::function<bool(int)> func = [&](int tid) { in DoDumpLocalPid() argument 101 if (tid <= 0) { in DoDumpLocalPid() 105 if (tid == getproctid()) { in DoDumpLocalPid() 108 return DoDumpLocalTid(tid, msg, maxFrameNums); in DoDumpLocalPid() 120 bool DfxDumpCatcher::DoDumpRemoteLocked(int pid, int tid, std::string& msg, bool isJson) in DoDumpRemoteLocked() argument 122 return DoDumpCatchRemote(pid, tid, msg, isJson); in DoDumpRemoteLocked() [all …]
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/include/ |
D | dfx_dump_catcher.h | 45 bool DumpCatch(int pid, int tid, std::string& msg, size_t maxFrameNums = DEFAULT_MAX_FRAME_NUM, 56 bool DumpCatchMix(int pid, int tid, std::string& msg); 68 …bool DumpCatchFd(int pid, int tid, std::string& msg, int fd, size_t maxFrameNums = DEFAULT_MAX_FRA… 82 bool DoDumpLocalTid(const int tid, std::string& msg, size_t maxFrameNums); 84 bool DoDumpLocalLocked(int pid, int tid, std::string& msg, size_t maxFrameNums); 85 bool DoDumpRemoteLocked(int pid, int tid, std::string& msg, bool isJson = false); 86 bool DoDumpCatchRemote(int pid, int tid, std::string& msg, bool isJson = false);
|
/base/request/request/services/src/task/ |
D | files.rs | 31 let tid = config.common_data.task_id; in open() localVariable 35 tid in open() 41 tid in open() 53 let tid = config.common_data.task_id; in open_task_files() localVariable 67 error!("None user file failed - task_id: {}, idx: {}", tid, idx); in open_task_files() 75 tid, in open_task_files() 82 tid, in open_task_files() 88 tid, idx, size in open_task_files() 96 tid, in open_task_files() 109 let tid = config.common_data.task_id; in open_body_files() localVariable [all …]
|
/base/hiviewdfx/faultloggerd/tools/process_dump/ |
D | dfx_thread.cpp | 38 std::shared_ptr<DfxThread> DfxThread::Create(pid_t pid, pid_t tid, pid_t nsTid) in Create() argument 40 auto thread = std::make_shared<DfxThread>(pid, tid, nsTid); in Create() 44 DfxThread::DfxThread(pid_t pid, pid_t tid, pid_t nsTid) : regs_(nullptr) in DfxThread() argument 46 InitThreadInfo(pid, tid, nsTid); in DfxThread() 49 void DfxThread::InitThreadInfo(pid_t pid, pid_t tid, pid_t nsTid) in InitThreadInfo() argument 52 threadInfo_.tid = tid; in InitThreadInfo() 54 ReadThreadNameByPidAndTid(threadInfo_.pid, threadInfo_.tid, threadInfo_.threadName); in InitThreadInfo()
|