Home
last modified time | relevance | path

Searched full:tid (Results 1 – 25 of 300) sorted by relevance

12345678910>>...12

/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/
Ddfx_ptrace.cpp33 void DfxPtrace::Detach(pid_t tid) in Detach() argument
35 if (tid > 0) { in Detach()
36 if (ptrace(PTRACE_DETACH, tid, nullptr, nullptr) == 0) { in Detach()
39 DFXLOGW("Failed to detach tid(%{public}d), errno=%{public}d", tid, errno); in Detach()
40 if (ptrace(PTRACE_INTERRUPT, tid, 0, 0) != 0) { in Detach()
41 DFXLOGW("Failed to ptrace interrupt tid(%{public}d), errno=%{public}d", tid, errno); in Detach()
44 if (waitpid(tid, nullptr, 0) < 0) { in Detach()
45 DFXLOGW("Failed to waitpid tid(%{public}d), errno=%{public}d", tid, errno); in Detach()
49 ptrace(PTRACE_DETACH, tid, nullptr, nullptr); in Detach()
53 bool DfxPtrace::Attach(pid_t tid, int timeout) in Attach() argument
[all …]
Dthread_context.cpp74 void PrintThreadStatus(int32_t tid) in PrintThreadStatus() argument
77 std::string path = StringPrintf("/proc/%d/status", tid); in PrintThreadStatus()
82 std::shared_ptr<ThreadContext> GetContextLocked(int32_t tid) in GetContextLocked() argument
84 auto it = g_contextMap.find(tid); in GetContextLocked()
87 threadContext->tid = tid; in GetContextLocked()
90 g_contextMap[tid] = threadContext; in GetContextLocked()
94 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) { in GetContextLocked()
95 it->second->tid = tid; in GetContextLocked()
100 DFXLOGE("GetContextLocked nullptr, tid: %{public}d", tid); in GetContextLocked()
113 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) { in RemoveAllContextLocked()
[all …]
/base/hiviewdfx/faultloggerd/test/benchmarktest/unwinder/
Dunwind_local_tid_benchmark.cpp41 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/
Dlock_parser_test.cpp88 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 __anon75981a250202()
115 tid = gettid(); in __anon75981a250202()
116 printf("BlockTid:%d\n", tid); in __anon75981a250202()
120 WaitThreadBlock(tid);
121 printf("CurrentTid:%d BlockTid:%d\n", gettid(), tid);
123 ASSERT_EQ(unwinder->UnwindLocalWithTid(tid), true);
[all …]
Dprocess_dump_test.cpp90 pid_t tid = accountmgrPid; variable
91 auto keyThread = DfxThread::Create(pid, tid, tid);
146 pthread_t tid; variable
148 pthread_create(&tid, NULL, SleepThread, &threadID[0]);
149 std::shared_ptr<DfxProcess> process2 = DfxProcess::Create(pid, tid);
151 pthread_join(tid, NULL);
166 int32_t pid = 1, tid = 1; variable
167 auto thread = DfxThread::Create(pid, tid, tid);
180 int32_t pid = 243, tid = 243; variable
181 std::shared_ptr<DfxThread> thread = std::make_shared<DfxThread>(pid, tid, tid);
[all …]
/base/request/request/frameworks/native/request/src/
Drequest_service_proxy.cpp74 rets[i].tid = std::to_string(reply.ReadInt32()); in CreateTasks()
88 for (const std::string &tid : tids) { in StartTasks() local
89 data.WriteString(tid); in StartTasks()
120 for (const std::string &tid : tids) { in StopTasks() local
121 data.WriteString(tid); in StopTasks()
152 for (const std::string &tid : tids) { in ResumeTasks() local
153 data.WriteString(tid); in ResumeTasks()
185 for (const std::string &tid : tids) { in PauseTasks() local
186 data.WriteString(tid); in PauseTasks()
218 for (const std::string &tid : tids) { in RemoveTasks() local
[all …]
Drequest_manager.cpp84 ExceptionErrorCode RequestManager::SetMode(const std::string &tid, const Mode mode) in SetMode() argument
86 return RequestManagerImpl::GetInstance()->SetMode(tid, mode); in SetMode()
95 int32_t RequestManager::Create(const Config &config, int32_t seq, std::string &tid) in Create() argument
97 return RequestManagerImpl::GetInstance()->Create(config, seq, tid); in Create()
99 int32_t RequestManager::GetTask(const std::string &tid, const std::string &token, Config &config) in GetTask() argument
101 return RequestManagerImpl::GetInstance()->GetTask(tid, token, config); in GetTask()
103 int32_t RequestManager::Start(const std::string &tid) in Start() argument
105 return RequestManagerImpl::GetInstance()->Start(tid); in Start()
107 int32_t RequestManager::Stop(const std::string &tid) in Stop() argument
109 return RequestManagerImpl::GetInstance()->Stop(tid); in Stop()
[all …]
Drequest_manager_impl.cpp50 ExceptionErrorCode RequestManagerImpl::SetMode(const std::string &tid, const Mode mode) in SetMode() argument
52 …return static_cast<ExceptionErrorCode>(CallProxyMethod(&RequestServiceInterface::SetMode, tid, mod… in SetMode()
80 …static_cast<ExceptionErrorCode>(CallProxyMethod(&RequestServiceInterface::Subscribe, taskRet.tid)); in CreateTasks()
138 int32_t RequestManagerImpl::Create(const Config &config, int32_t seq, std::string &tid) in Create() argument
142 int ret = CallProxyMethod(&RequestServiceInterface::Create, config, tid); in Create()
145 ret = CallProxyMethod(&RequestServiceInterface::Subscribe, tid); in Create()
148 ret = CallProxyMethod(&RequestServiceInterface::Start, tid); in Create()
156 int32_t RequestManagerImpl::GetTask(const std::string &tid, const std::string &token, Config &confi… in GetTask() argument
160 int32_t ret = CallProxyMethod(&RequestServiceInterface::GetTask, tid, token, config); in GetTask()
163 ret = CallProxyMethod(&RequestServiceInterface::Subscribe, tid); in GetTask()
[all …]
/base/request/request/frameworks/native/request/include/
Drequest_service_proxy.h53 ExceptionErrorCode SetMode(const std::string &tid, const Mode mode) override;
57 int32_t Create(const Config &config, std::string &tid) override;
58 int32_t GetTask(const std::string &tid, const std::string &token, Config &config) override;
59 int32_t Start(const std::string &tid) override;
60 int32_t Pause(const std::string &tid, const Version version) override;
61 int32_t QueryMimeType(const std::string &tid, std::string &mimeType) override;
62 int32_t Remove(const std::string &tid, const Version version) override;
63 int32_t Resume(const std::string &tid) override;
64 int32_t SetMaxSpeed(const std::string &tid, const int64_t maxSpeed) override;
66 int32_t Stop(const std::string &tid) override;
[all …]
Drequest_manager.h49 REQUEST_API ExceptionErrorCode SetMode(const std::string &tid, const Mode mode);
51 REQUEST_API int32_t Create(const Config &config, int32_t seq, std::string &tid);
52 REQUEST_API int32_t GetTask(const std::string &tid, const std::string &token, Config &config);
53 REQUEST_API int32_t Start(const std::string &tid);
54 REQUEST_API int32_t Stop(const std::string &tid);
55 REQUEST_API int32_t Query(const std::string &tid, TaskInfo &info);
56 REQUEST_API int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info);
58 REQUEST_API int32_t Show(const std::string &tid, TaskInfo &info);
59 REQUEST_API int32_t Pause(const std::string &tid, const Version version);
60 REQUEST_API int32_t QueryMimeType(const std::string &tid, std::string &mimeType);
[all …]
Drequest_service_interface.h51 virtual ExceptionErrorCode SetMode(const std::string &tid, const Mode mode) = 0;
56 virtual int32_t GetTask(const std::string &tid, const std::string &token, Config &config) = 0;
57 virtual int32_t Start(const std::string &tid) = 0;
58 virtual int32_t Pause(const std::string &tid, const Version version) = 0;
59 virtual int32_t QueryMimeType(const std::string &tid, std::string &mimeType) = 0;
60 virtual int32_t Remove(const std::string &tid, const Version version) = 0;
61 virtual int32_t Resume(const std::string &tid) = 0;
62 virtual int32_t SetMaxSpeed(const std::string &tid, const int64_t maxSpeed) = 0;
64 virtual int32_t Stop(const std::string &tid) = 0;
65 virtual int32_t Query(const std::string &tid, TaskInfo &info) = 0;
[all …]
/base/hiviewdfx/faultloggerd/interfaces/innerkits/procinfo/include/
Dprocinfo.h57 * @brief convert real tid to namespace tid
60 * @param tid thread id
61 * @param nsTid namespace tid(output parameter)
64 bool TidToNstid(const int pid, const int tid, int& nstid);
66 * @brief convert real tid to namespace tid
69 * @param tid thread id
72 bool IsThreadInPid(int32_t pid, int32_t tid);
93 * @param tid thread id
96 void ReadThreadName(const int tid, std::string& str);
99 * @param tid thread id
[all …]
/base/request/request/services/src/service/client/
Dmanager.rs94 ClientEvent::Subscribe(tid, pid, uid, token_id, tx) => { in run()
95 self.handle_subscribe(tid, pid, uid, token_id, tx) in run()
97 ClientEvent::Unsubscribe(tid, tx) => self.handle_unsubscribe(tid, tx), in run()
98 ClientEvent::TaskFinished(tid) => self.handle_task_finished(tid), in run()
100 ClientEvent::SendResponse(tid, version, status_code, reason, headers) => { in run()
101 if let Some(&pid) = self.pid_map.get(&tid) { in run()
104 tid, in run()
171 tid: u32, in handle_subscribe()
178 self.pid_map.insert(tid, pid); in handle_subscribe()
186 fn handle_unsubscribe(&mut self, tid: u32, tx: Sender<ErrorCode>) { in handle_unsubscribe()
[all …]
/base/request/request/test/unittest/cpp_test/fwkTest/src/
Drequest_manager_impl_test.cpp66 MOCK_METHOD(ExceptionErrorCode, SetMode, (const std::string &tid, const Mode mode), (override));
68 …MOCK_METHOD(int32_t, GetTask, (const std::string &tid, const std::string &token, Config &config), …
69 MOCK_METHOD(int32_t, Start, (const std::string &tid), (override));
70 MOCK_METHOD(int32_t, Pause, (const std::string &tid, const Version version), (override));
71 … MOCK_METHOD(int32_t, QueryMimeType, (const std::string &tid, std::string &mimeType), (override));
72 MOCK_METHOD(int32_t, Remove, (const std::string &tid, const Version version), (override));
73 MOCK_METHOD(int32_t, Resume, (const std::string &tid), (override));
74 MOCK_METHOD(int32_t, Stop, (const std::string &tid), (override));
75 MOCK_METHOD(int32_t, Query, (const std::string &tid, TaskInfo &info), (override));
76 …MOCK_METHOD(int32_t, Touch, (const std::string &tid, const std::string &token, TaskInfo &info), (o…
[all …]
Drequest_manager_test.cpp84 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/backtrace/
Dbacktrace_local.cpp43 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()
62 bool GetBacktraceStringByTid(std::string& out, int32_t tid, size_t skipFrameNum, bool fast, in GetBacktraceStringByTid() argument
66 bool ret = GetBacktraceFramesByTid(frames, tid, skipFrameNum + 1, fast, maxFrameNums); in GetBacktraceStringByTid()
70 if (DfxGetKernelStack(tid, msg) == 0 && FormatThreadKernelStack(msg, threadStack)) { in GetBacktraceStringByTid()
73 DFXLOGI("Failed to get tid(%{public}d) user stack, try kernel", tid); in GetBacktraceStringByTid()
81 std::string threadHead = GetThreadHead(tid); in GetBacktraceStringByTid()
143 std::function<bool(int)> func = [&](int tid) { in GetProcessStacktrace() argument
144 if (tid <= 0 || tid == gettid()) { in GetProcessStacktrace()
[all …]
Dbacktrace_local_thread.cpp33 std::string GetThreadHead(int32_t tid) in GetThreadHead() argument
36 if (tid == BACKTRACE_CURRENT_THREAD) { in GetThreadHead()
37 tid = gettid(); in GetThreadHead()
39 ReadThreadName(tid, threadName); in GetThreadHead()
40 std::string threadHead = "Tid:" + std::to_string(tid) + ", Name:" + threadName + "\n"; in GetThreadHead()
44 BacktraceLocalThread::BacktraceLocalThread(int32_t tid, std::shared_ptr<Unwinder> unwinder) in BacktraceLocalThread() argument
45 : tid_(tid), unwinder_(unwinder) in BacktraceLocalThread()
106 // Tid:1676, Name:IPC_3_1676 in GetFormattedStr()
108 ss = "Tid:" + std::to_string(tid_) + ", Name:" + threadName + "\n"; in GetFormattedStr()
/base/hiviewdfx/faultloggerd/tools/dump_catcher/
Dmain.cpp37 printf("-p pid -t tid dump the stacktrace of the thread with given tid.\n"); in PrintCommandHelp()
44 printf("%s\npid and tid must > 0 and timeout must > 1000.\n", DUMP_STACK_TAG_FAILED.c_str()); in PrintCommandFailed()
47 static int ParseParamters(int argc, char *argv[], int32_t &pid, int32_t &tid, int &timeout) in ParseParamters() argument
73 tid = atoi(optarg); in ParseParamters()
106 int32_t tid = 0; in main() local
112 if (ParseParamters(argc, argv, pid, tid, timeout) <= 0) { in main()
116 DFXLOGD("pid: %{public}d, tid: %{public}d, timeout: %{public}d", pid, tid, timeout); in main()
117 OHOS::HiviewDFX::DumpCatcher::GetInstance().Dump(pid, tid, timeout); in main()
/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include/
Dthread_context.h40 std::atomic<int32_t> tid {ThreadContextStatus::CONTEXT_UNUSED};
73 bool GetStackRange(int32_t tid, uintptr_t& stackBottom, uintptr_t& stackTop);
74 std::shared_ptr<ThreadContext> CollectThreadContext(int32_t tid);
75 std::shared_ptr<ThreadContext> GetThreadContext(int32_t tid);
76 void ReleaseThread(int32_t tid);
83 bool SignalRequestThread(int32_t tid, ThreadContext* ctx);
104 bool CollectThreadContext(int32_t tid);
105 bool CheckStatusValidate(int status, int32_t tid);
119 bool SignalRequestThread(int32_t tid);
120 void StartCollectThreadContext(int32_t tid);
/base/hiviewdfx/faultloggerd/example/
Ddump_catcher_demo.cpp29 static NOINLINE int TestFuncDump(int32_t pid, int32_t tid, bool isJson) in TestFuncDump() argument
38 bool ret = dumplog.DumpCatch(pid, tid, msg, defaultMaxFrameNum, isJson); in TestFuncDump()
61 static bool ParseParameters(int argc, char *argv[], int32_t &pid, int32_t &tid) in ParseParameters() argument
71 tid = atoi(argv[2]); in ParseParameters()
80 tid = atoi(argv[4]); in ParseParameters()
84 tid = atoi(argv[2]); in ParseParameters()
101 int32_t tid = 0; in main() local
102 if (ParseParameters(argc, argv, pid, tid)) { in main()
103 TestFuncDump(pid, tid, true); in main()
/base/request/request/services/src/service/command/
Dsubscribe.rs24 info!("Service subscribe tid {}", task_id); in subscribe()
50 "End Service subscribe, tid: {}, failed: send event failed", in subscribe()
57 "End Service subscribe, tid: {}, failed: send event failed", in subscribe()
67 "End Service subscribe, tid: {}, failed: receives ret failed", in subscribe()
74 "End Service subscribe, tid: {}, failed: receives ret failed", in subscribe()
84 error!("End Service subscribe, tid: {}, failed: {:?}", task_id, ret); in subscribe()
88 &format!("End Service subscribe, tid: {}, failed: {:?}", task_id, ret) in subscribe()
97 debug!("End Service subscribe ok: tid: {}", task_id); in subscribe()
100 error!("End Service subscribe, tid: {}, failed: {:?}", task_id, ret); in subscribe()
104 &format!("End Service subscribe, tid: {}, failed: {:?}", task_id, ret) in subscribe()
/base/hiviewdfx/faultloggerd/interfaces/innerkits/procinfo/
Dprocinfo.cpp106 bool TidToNstid(const int pid, const int tid, int& nstid) in TidToNstid() argument
108 std::string path = StringPrintf("/proc/%d/task/%d/status", pid, tid); in TidToNstid()
135 bool IsThreadInPid(int32_t pid, int32_t tid) in IsThreadInPid() argument
139 path = StringPrintf("%s/%d", PROC_SELF_TASK_PATH, tid); in IsThreadInPid()
141 path = StringPrintf("/proc/%d/task/%d", pid, tid); in IsThreadInPid()
159 pid_t tid = atoi(files[i].c_str()); in GetTidsByPidWithFunc() local
160 if (tid == 0) { in GetTidsByPidWithFunc()
163 tids.emplace_back(tid); in GetTidsByPidWithFunc()
166 func(tid); in GetTidsByPidWithFunc()
180 func = [&](int tid) { in GetTidsByPid() argument
[all …]
/base/request/request/test/unittest/cpp_test/innerTest/src/
Drequest_action_test.cpp148 std::string g_tidUser = "550015967"; //test correct tid which will be replaced after create used
159 std::string tidStr = "tid";
174 std::string tid = "tid"; variable
175 RequestAction::GetInstance()->Stop(tid);
187 std::string tid = "tid"; variable
190 RequestAction::GetInstance()->Touch(tid, token, info);
202 std::string tid = "tid"; variable
204 RequestAction::GetInstance()->Show(tid, info);
216 std::string tid = "tid"; variable
217 RequestAction::GetInstance()->Pause(tid);
[all …]
/base/request/request/frameworks/js/napi/request/src/
Djs_task.cpp168 context->task->SetTid(context->tid); in JsMain()
173 REQUEST_HILOGI("End create seq %{public}d, tid %{public}s", seq, context->tid.c_str()); in JsMain()
186 JsTask::AddTaskMap(context->tid, context->task); in AddTask()
190 JsTask::AddTaskContextMap(context->tid, context); in AddTask()
202 int32_t ret = RequestManager::GetInstance()->Create(context->task->config_, seq, context->tid); in CreateExec()
213 std::string tid = context->tid; in AddRemoveListener() local
216 std::make_shared<JSNotifyDataListener>(context->env_, tid, SubscribeType::REMOVE); in AddRemoveListener()
219 tid, SubscribeType::REMOVE, context->task->notifyDataListenerMap_[SubscribeType::REMOVE]); in AddRemoveListener()
358 context->task->SetTid(context->tid); in GetTask()
373 std::string tid = context->tid; in GetTaskExecution() local
[all …]
/base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/include/
Ddfx_dump_catcher.h36 * @brief Dump native stack by specify pid and tid
39 * @param tid thread id
45 bool DumpCatch(int pid, int tid, std::string& msg, size_t maxFrameNums = DEFAULT_MAX_FRAME_NUM,
49 * @brief Dump native stack by specify pid and tid to file
52 * @param tid thread id
58 …bool DumpCatchFd(int pid, int tid, std::string& msg, int fd, size_t maxFrameNums = DEFAULT_MAX_FRA…
64 * @param tid thread id
94 int tid = 0, bool isJson = false);
98 bool DoDumpLocalTid(const int tid, std::string& msg, size_t maxFrameNums);
100 bool DoDumpLocalLocked(int pid, int tid, std::string& msg, size_t maxFrameNums);
[all …]

12345678910>>...12