Home
last modified time | relevance | path

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

1234567891011

/base/request/request/frameworks/native/src/
Drequest_service_proxy.cpp39 int32_t RequestServiceProxy::Create(const Config &config, std::string &tid) in Create() argument
80 tid = std::to_string(reply.ReadInt32()); in Create()
126 int32_t RequestServiceProxy::GetTask(const std::string &tid, const std::string &token, Config &conf… in GetTask() argument
128 REQUEST_HILOGD("Request GetTask, tid: %{public}s", tid.c_str()); in GetTask()
132 data.WriteString(tid); in GetTask()
136 … REQUEST_HILOGE("End Request GetTask, tid: %{public}s, failed: %{public}d", tid.c_str(), ret); in GetTask()
145 REQUEST_HILOGD("End Request GetTask ok, tid: %{public}s", tid.c_str()); in GetTask()
149 int32_t RequestServiceProxy::Start(const std::string &tid) in Start() argument
151 REQUEST_HILOGD("Request Start, tid: %{public}s", tid.c_str()); in Start()
155 data.WriteString(tid); in Start()
[all …]
Drequest_manager.cpp28 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 …]
Drequest_manager_impl.cpp48 int32_t RequestManagerImpl::Create(const Config &config, int32_t seq, std::string &tid) in Create() argument
57 int32_t ret = proxy->Create(config, tid); in Create()
60 ret = Retry(tid, config, ret); in Create()
68 ret = proxy->Subscribe(tid); in Create()
71 ret = proxy->Start(tid); in Create()
121 int32_t RequestManagerImpl::GetTask(const std::string &tid, const std::string &token, Config &confi… in GetTask() argument
126 REQUEST_HILOGE("GetRequestServiceProxy fail, tid: %{public}s", tid.c_str()); in GetTask()
129 REQUEST_HILOGD("Request getTask, tid: %{public}s", tid.c_str()); in GetTask()
131 int32_t ret = proxy->GetTask(tid, token, config); in GetTask()
133 … REQUEST_HILOGE("End Request getTask, tid: %{public}s, failed: %{public}d", tid.c_str(), ret); in GetTask()
[all …]
/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/
Dthread_context.cpp68 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 …]
Ddfx_ptrace.cpp33 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/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 __anon578df8660202()
115 tid = gettid(); in __anon578df8660202()
116 printf("BlockTid:%d\n", tid); in __anon578df8660202()
120 WaitThreadBlock(tid);
121 printf("CurrentTid:%d BlockTid:%d\n", gettid(), tid);
123 ASSERT_EQ(unwinder->UnwindLocalWithTid(tid), true);
[all …]
Dprocess_dump_test.cpp87 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/
Dbacktrace_local.cpp42 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/
Drequest_service_proxy.h32 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 …]
Drequest_service_interface.h32 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;
Drequest_manager.h29 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 …]
Drequest_manager_impl.h48 int32_t Create(const Config &config, int32_t seq, std::string &tid);
49 int32_t GetTask(const std::string &tid, const std::string &token, Config &config);
50 int32_t Start(const std::string &tid);
51 int32_t Stop(const std::string &tid);
52 int32_t Query(const std::string &tid, TaskInfo &info);
53 int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info);
55 int32_t Show(const std::string &tid, TaskInfo &info);
56 int32_t Pause(const std::string &tid, Version version);
57 int32_t QueryMimeType(const std::string &tid, std::string &mimeType);
58 int32_t Remove(const std::string &tid, Version version);
[all …]
/base/request/request/test/unittest/cpp_test/fwkTest/src/
Drequest_manager_impl_test.cpp43 …MOCK_METHOD(int32_t, GetTask, (const std::string &tid, const std::string &token, Config &config), …
44 MOCK_METHOD(int32_t, Start, (const std::string &tid), (override));
45 MOCK_METHOD(int32_t, Pause, (const std::string &tid, Version version), (override));
46 … MOCK_METHOD(int32_t, QueryMimeType, (const std::string &tid, std::string &mimeType), (override));
47 MOCK_METHOD(int32_t, Remove, (const std::string &tid, Version version), (override));
48 MOCK_METHOD(int32_t, Resume, (const std::string &tid), (override));
49 MOCK_METHOD(int32_t, Stop, (const std::string &tid), (override));
50 MOCK_METHOD(int32_t, Query, (const std::string &tid, TaskInfo &info), (override));
51 …MOCK_METHOD(int32_t, Touch, (const std::string &tid, const std::string &token, TaskInfo &info), (o…
53 MOCK_METHOD(int32_t, Show, (const std::string &tid, TaskInfo &info), (override));
[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/procinfo/include/
Dprocinfo.h58 * @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/
Dmanager.rs84 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/
Ddfx_dump_catcher.h37 * @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/
Dmain.cpp37 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/
Ddump_catcher_demo.cpp29 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/
Dprocinfo.cpp105 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/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include/
Dthread_context.h37 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/test/fuzztest/faultloggerddumpcatcher_fuzzer/
Dfaultloggerddumpcatcher_fuzzer.cpp32 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/request/request/frameworks/js/napi/src/
Djs_task.cpp161 context->task->SetTid(context->tid); in JsMain()
166 REQUEST_HILOGI("End create seq %{public}d, tid %{public}s", seq, context->tid.c_str()); in JsMain()
179 JsTask::AddTaskMap(context->tid, context->task); in AddTask()
183 JsTask::AddTaskContextMap(context->tid, context); in AddTask()
200 int32_t ret = RequestManager::GetInstance()->Create(context->task->config_, seq, context->tid); in CreateExec()
211 std::string tid = context->tid; in AddRemoveListener() local
214 std::make_shared<JSNotifyDataListener>(context->env_, tid, SubscribeType::REMOVE); in AddRemoveListener()
217 tid, SubscribeType::REMOVE, context->task->notifyDataListenerMap_[SubscribeType::REMOVE]); in AddRemoveListener()
338 …REQUEST_HILOGE("End get task in AsyncCall input, seq: %{public}d, failed: parse tid or token fail"… in GetTask()
356 context->task->SetTid(context->tid); in GetTask()
[all …]
/base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/
Ddfx_dump_catcher.cpp109 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 …]

1234567891011