/base/hiviewdfx/hiview/framework/native/unified_collection/process/ |
H A D | process_status.cpp | 33 std::string ProcessStatus::GetProcessName(int32_t pid)
in GetProcessName() argument 41 if (processInfos_.find(pid) != processInfos_.end() && !processInfos_[pid].name.empty()) {
in GetProcessName() 42 return processInfos_[pid].name;
in GetProcessName() 44 std::string procName = CommonUtils::GetProcFullNameByPid(pid);
in GetProcessName() 45 if (UpdateProcessName(pid, procName)) {
in GetProcessName() 48 HIVIEW_LOGD("failed to get proc name from pid=%{public}d", pid);
in GetProcessName() 83 bool ProcessStatus::UpdateProcessName(int32_t pid, const std::string& procName)
in UpdateProcessName() argument 89 if (processInfos_.find(pid) ! in UpdateProcessName() 101 GetProcessState(int32_t pid) GetProcessState() argument 109 GetProcessLastForegroundTime(int32_t pid) GetProcessLastForegroundTime() argument 117 NotifyProcessState(int32_t pid, ProcessState procState) NotifyProcessState() argument 123 UpdateProcessState(int32_t pid, ProcessState procState) UpdateProcessState() argument 144 UpdateProcessForegroundState(int32_t pid) UpdateProcessForegroundState() argument 160 UpdateProcessBackgroundState(int32_t pid) UpdateProcessBackgroundState() argument 178 ClearProcessInfo(int32_t pid) ClearProcessInfo() argument [all...] |
/base/hiviewdfx/faultloggerd/test/benchmarktest/unwind/ |
H A D | unwind_remote_benchmark.cpp | 64 static size_t UnwindRemote(pid_t pid, unw_addr_space_t as)
in UnwindRemote() argument 71 void *context = _UPT_create(pid);
in UnwindRemote() 104 pid_t pid = fork();
in Run() local 105 if (pid == 0) {
in Run() 108 } else if (pid < 0) {
in Run() 111 if (!DfxPtrace::Attach(pid)) {
in Run() 112 DFXLOGE("Failed to attach pid: %{public}d", pid);
in Run() 113 TestScopedPidReaper::Kill(pid);
in Run() 117 DFXLOGU("pid in Run() 133 GetCacheUnwind(pid_t pid, unw_addr_space_t& as) GetCacheUnwind() argument 147 pid_t pid = fork(); RunCache() local [all...] |
/base/hiviewdfx/faultloggerd/test/unittest/local_handler/ |
H A D | local_handler_test.cpp | 63 static bool CheckLocalCrashKeyWords(const string& filePath, pid_t pid, int sig) in CheckLocalCrashKeyWords() argument 65 if (filePath.empty() || pid <= 0) { in CheckLocalCrashKeyWords() 81 "Pid:" + to_string(pid), "Uid:", "name:./test_localhandler", in CheckLocalCrashKeyWords() 86 "Pid:" + to_string(pid), "Uid:", "name:./test_localhandler", in CheckLocalCrashKeyWords() 104 pid_t pid = fork(); in HWTEST_F() local 105 if (pid < 0) { in HWTEST_F() 107 } else if (pid == 0) { in HWTEST_F() 112 GTEST_LOG_(INFO) << "process(" << getpid() << ") is ready to kill process(" << pid << ")"; in HWTEST_F() 113 kill(pid, SIGILL); in HWTEST_F() 115 bool ret = CheckLocalCrashKeyWords(GetCppCrashFileName(pid), pi in HWTEST_F() 129 pid_t pid = fork(); HWTEST_F() local 154 pid_t pid = fork(); HWTEST_F() local 179 pid_t pid = fork(); HWTEST_F() local 204 pid_t pid = fork(); HWTEST_F() local 229 pid_t pid = fork(); HWTEST_F() local 253 pid_t pid = fork(); HWTEST_F() local 415 pid_t pid = fork(); HWTEST_F() local [all...] |
/base/hiviewdfx/faultloggerd/test/benchmarktest/unwindstack/ |
H A D | pid_utils.cpp | 39 static bool Exited(pid_t pid) in Exited() argument 42 pid_t waitPid = waitpid(pid, &status, WNOHANG); in Exited() 43 if (waitPid != pid) { in Exited() 48 DFXLOGE("%{public}d died: Process exited with code %{public}d", pid, WEXITSTATUS(status)); in Exited() 50 DFXLOGE("%{public}d died: Process exited due to signal %{public}d", pid, WTERMSIG(status)); in Exited() 52 DFXLOGE("%{public}d died: Process finished for unknown reason", pid); in Exited() 57 bool PidUtils::Quiesce(pid_t pid) in Quiesce() argument 62 if (ptrace(PTRACE_GETSIGINFO, pid, 0, &si) == 0) { in Quiesce() 71 if (ptrace(PTRACE_LISTEN, pid, 0, 0) == -1) { in Quiesce() 78 DFXLOGE("%{public}d: Did not quiesce in 10 seconds", pid); in Quiesce() 82 Attach(pid_t pid) Attach() argument 106 Detach(pid_t pid) Detach() argument 115 WaitForPidState(pid_t pid, const std::function<PidRunEnum()>& stateCheckFunc) WaitForPidState() argument 140 WaitForPidStateAfterAttach(pid_t pid, const std::function<PidRunEnum()>& stateCheckFunc) WaitForPidStateAfterAttach() argument [all...] |
H A D | unwind_remote_benchmark.cpp | 74 static bool WaitForRemote(pid_t pid, volatile bool* readyPtr)
in WaitForRemote() argument 76 return PidUtils::WaitForPidState(pid, [pid, readyPtr]() {
in WaitForRemote() 77 unwindstack::MemoryRemote memory(pid);
in WaitForRemote() 91 pid_t pid;
92 if ((pid = fork()) == 0) {
95 } else if (pid < 0) {
99 if (!WaitForRemote(pid, &ready)) {
100 DFXLOGE("Failed to wait pid: %{public}d", pid);
[all...] |
/base/security/security_component_manager/services/security_component_service/sa/sa_main/ |
H A D | app_state_observer.cpp | 35 bool AppStateObserver::IsProcessForeground(int32_t pid, int32_t uid) in IsProcessForeground() argument 39 if (pid == iter->pid) { in IsProcessForeground() 43 if ((iter->pid == -1) && (uid == iter->uid)) { in IsProcessForeground() 44 iter->pid = pid; in IsProcessForeground() 51 void AppStateObserver::AddProcessToForegroundSet(int32_t pid, const SecCompProcessData& data) in AddProcessToForegroundSet() argument 55 if (pid == -1) { in AddProcessToForegroundSet() 60 } else if (pid == iter->pid) { in AddProcessToForegroundSet() [all...] |
/base/hiviewdfx/faultloggerd/test/systemtest/ |
H A D | faultloggerd_system_test.cpp | 73 pid_t pid = fork(); in ForkAndExecuteCrasher() local 74 if (pid < 0) { in ForkAndExecuteCrasher() 76 return pid; in ForkAndExecuteCrasher() 77 } else if (pid == 0) { in ForkAndExecuteCrasher() 85 GTEST_LOG_(INFO) << "forked pid:" << pid; in ForkAndExecuteCrasher() 91 waitpid(pid, &status, WNOHANG); in ForkAndExecuteCrasher() 99 return pid; in ForkAndExecuteCrasher() 105 auto pid = ForkAndExecuteCrasher(option, type); in TriggerCrasherAndGetFileName() local 111 crashFileName = GetCppCrashFileName(pid, tempPat in TriggerCrasherAndGetFileName() 122 CheckCountNum(const string& filePath, const pid_t& pid, const string& option) CheckCountNum() argument 152 CheckCountNumAbort(const string& filePath, const pid_t& pid) CheckCountNumAbort() argument 164 CheckCountNumNullpointer(const string& filePath, const pid_t& pid) CheckCountNumNullpointer() argument 175 CheckCountNumStackOverFlow(const string& filePath, const pid_t& pid) CheckCountNumStackOverFlow() argument 186 CheckCountNumPCZero(const string& filePath, const pid_t& pid) CheckCountNumPCZero() argument 197 CheckCountNumOverStack(const string& filePath, const pid_t& pid) CheckCountNumOverStack() argument 208 CheckCountNumMultiThread(const string& filePath, const pid_t& pid) CheckCountNumMultiThread() argument 252 string pid; ReadRealPid() local 253 file >> pid; ReadRealPid() local 264 CheckCountNumStackTop(const string& filePath, const pid_t& pid) CheckCountNumStackTop() argument 281 CheckCppCrashAllLabelKeywords(const string& filePath, const pid_t& pid) CheckCppCrashAllLabelKeywords() argument 294 CheckCppCrashAsyncStackEnableKeywords(const string& filePath, const pid_t& pid) CheckCppCrashAsyncStackEnableKeywords() argument 306 CheckCppCrashAsyncStackDisableKeywords(const string& filePath, const pid_t& pid) CheckCppCrashAsyncStackDisableKeywords() argument 324 CheckTestGetCrashObj(const string& filePath, const pid_t& pid) CheckTestGetCrashObj() argument 346 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 366 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 386 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 406 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 426 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 446 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 466 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 486 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 506 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 526 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 546 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 566 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 586 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 606 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 626 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 646 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 666 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 686 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 706 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 726 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 746 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 766 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 786 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 806 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 826 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 846 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 866 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 886 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 905 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 925 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 945 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName, 2); // 2 : sleep 2s for waiting cppcrash file HWTEST_F() local 965 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName, 2); // 2 : sleep 2s for waiting cppcrash file HWTEST_F() local 985 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1005 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 1025 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 1045 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1190 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 1226 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 1246 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1266 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1286 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1297 CheckMinidebugSymbols(const string& filePath, const pid_t& pid, const string& option) CheckMinidebugSymbols() argument 1328 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 1348 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1368 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName); HWTEST_F() local 1388 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1409 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1430 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1450 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1470 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1490 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1510 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1530 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1550 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1570 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1590 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1617 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName, 1, crashDir); HWTEST_F() local 1640 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName); HWTEST_F() local 1663 int pid = LaunchTestHap(testAbiltyName, testBundleName); HWTEST_F() local [all...] |
/base/hiviewdfx/hidumper/test/innerkits_test/ |
H A D | main.cpp | 22 static uint64_t GetPss(const int &pid) in GetPss() argument 25 return dumpUsage->GetPss(pid); in GetPss() 28 static uint64_t GetPrivateDirty(const int &pid) in GetPrivateDirty() argument 31 return dumpUsage->GetPrivateDirty(pid); in GetPrivateDirty() 34 static uint64_t GetSharedDirty(const int &pid) in GetSharedDirty() argument 37 return dumpUsage->GetSharedDirty(pid); in GetSharedDirty() 40 static bool GetMemInfo(const int &pid, OHOS::HiviewDFX::MemInfoData::MemInfo &data) in GetMemInfo() argument 43 return dumpUsage->GetMemInfo(pid, data); in GetMemInfo() 47 static float GetCpuUsage(const int &pid) in GetCpuUsage() argument 50 return dumpUsage->GetCpuUsage(pid); in GetCpuUsage() 56 int pid; main() local 58 cin >> pid; main() local [all...] |
/base/hiviewdfx/faultloggerd/test/unittest/signal_handler/ |
H A D | signal_handler_test.cpp | 61 static bool CheckThreadCrashKeyWords(const string& filePath, pid_t pid, int sig) in CheckThreadCrashKeyWords() argument 63 if (filePath.empty() || pid <= 0) { in CheckThreadCrashKeyWords() 77 "Pid:" + to_string(pid), "Uid:", "name:./test_signalhandler", sigKeyword, in CheckThreadCrashKeyWords() 84 static bool CheckCrashKeyWords(const string& filePath, pid_t pid, int sig) in CheckCrashKeyWords() argument 86 if (filePath.empty() || pid <= 0) { in CheckCrashKeyWords() 105 "Pid:" + to_string(pid), "Uid:", "name:./test_signalhandler", sigKeyword, in CheckCrashKeyWords() 144 pid_t pid = fork(); in HWTEST_F() local 145 if (pid < 0) { in HWTEST_F() 147 } else if (pid == 0) { in HWTEST_F() 154 GTEST_LOG_(INFO) << "process(" << getpid() << ") is ready to kill process(" << pid << ")"; in HWTEST_F() 171 pid_t pid = fork(); HWTEST_F() local 198 pid_t pid = fork(); HWTEST_F() local 225 pid_t pid = fork(); HWTEST_F() local 248 pid_t pid = fork(); HWTEST_F() local 271 pid_t pid = fork(); HWTEST_F() local 299 pid_t pid = fork(); HWTEST_F() local 349 pid_t pid = fork(); HWTEST_F() local 379 pid_t pid = fork(); HWTEST_F() local 413 pid_t pid = fork(); HWTEST_F() local 441 pid_t pid = fork(); HWTEST_F() local 475 pid_t pid = fork(); HWTEST_F() local [all...] |
/base/hiviewdfx/hiview/framework/native/unified_collection/graphic_memory/ |
H A D | graphic_memory.cpp | 36 uint32_t pid = 0; member 42 int32_t MemoryTrackerGetGLByPid(int32_t pid) in MemoryTrackerGetGLByPid() argument 50 if (memtrack->GetDevMem(pid, MEMORY_TRACKER_TYPE_GL, records) != HDF_SUCCESS) { in MemoryTrackerGetGLByPid() 62 int32_t RsGetGLByPid(int32_t pid) in RsGetGLByPid() argument 66 std::make_unique<MemoryGraphic>(RSInterfaces::GetInstance().GetMemoryGraphic(pid)); in RsGetGLByPid() 73 int32_t GetGLByPid(int32_t pid) in GetGLByPid() argument 75 return MemoryTrackerGetGLByPid(pid) + RsGetGLByPid(pid); in GetGLByPid() 83 name, sizeof(name), &dmaInfo.pid, &dmaInfo.size, &dmaInfo.ino) == 0) { in CreateDmaInfo() 93 it->second.pid in CreateDmaInfo() 97 GetGraphByPid(pid_t pid) GetGraphByPid() argument 118 GetGraphicUsage(int32_t pid, Type type) GetGraphicUsage() argument [all...] |
/base/hiviewdfx/hidumper/interfaces/innerkits/ |
H A D | dump_usage.cpp | 32 bool DumpUsage::GetMemInfo(const int &pid, MemInfoData::MemInfo &info) in GetMemInfo() argument 36 return parseSmapsRollupInfo->GetMemInfo(pid, info); in GetMemInfo() 39 uint64_t DumpUsage::GetPss(const int &pid) in GetPss() argument 42 return GetMemInfo(pid, info) ? info.pss + info.swapPss : 0; in GetPss() 45 uint64_t DumpUsage::GetPrivateDirty(const int &pid) in GetPrivateDirty() argument 48 return GetMemInfo(pid, info) ? info.privateDirty : 0; in GetPrivateDirty() 51 uint64_t DumpUsage::GetSharedDirty(const int &pid) in GetSharedDirty() argument 54 return GetMemInfo(pid, info) ? info.sharedDirty : 0; in GetSharedDirty() 57 double DumpUsage::GetCpuUsage(const int &pid) in GetCpuUsage() argument 62 dumpManagerCpuClient.GetCpuUsageByPid(pid, cpuUsag in GetCpuUsage() [all...] |
/base/hiviewdfx/hidumper/test/fuzztest/dumpusage_fuzzer/ |
H A D | dumpusage_fuzzer.cpp | 29 int pid = 0;
in GetPidFromData() local 31 pid = static_cast<int>(data[0]);
in GetPidFromData() 33 pid = static_cast<int>(data[0]) | (static_cast<int>(data[1]) << OFFSET);
in GetPidFromData() 35 return pid;
in GetPidFromData() 40 int pid = GetPidFromData(data, size);
in GetCpuUsageFuzzTest() local 42 auto result = dumpUsage->GetCpuUsage(pid);
in GetCpuUsageFuzzTest() 43 std::cout << "pid:" << pid << " cpuusage:" << result << std::endl;
in GetCpuUsageFuzzTest() 49 int pid = GetPidFromData(data, size);
in GetPssFuzzTest() local 51 auto result = dumpUsage->GetPss(pid);
in GetPssFuzzTest() 58 int pid = GetPidFromData(data, size); GetPrivateDirtyFuzzTest() local 67 int pid = GetPidFromData(data, size); GetSharedDirtyFuzzTest() local 76 int pid = GetPidFromData(data, size); GetMemInfoFuzzTest() local [all...] |
/base/hiviewdfx/hiview/plugins/eventlogger/log_catcher/ |
H A D | open_stacktrace_catcher.cpp | 40 bool OpenStacktraceCatcher::Initialize(const std::string& packageNam, int pid, int intParam) in Initialize() argument 42 if (pid <= 0 && packageNam.length() == 0) { in Initialize() 43 description_ = "OpenStacktraceCatcher -- pid is null, packageName is null\n"; in Initialize() 47 if (pid > 0) { in Initialize() 48 pid_ = pid; in Initialize() 54 description_ = "OpenStacktraceCatcher -- packageName is " + packageName_ + " pid is null\n"; in Initialize() 62 description_ = "OpenStacktraceCatcher -- pid==" + std::to_string(pid_) + " packageName is " + packageName_ + "\n"; in Initialize() 83 inline void OpenStacktraceCatcher::WaitChildPid(pid_t pid) in WaitChildPid() argument 87 if (waitpid(pid, NULL, WNOHANG) != 0) { in WaitChildPid() 97 int pid in ForkAndDumpStackTrace() local [all...] |
/base/web/webview/ohos_interface/ohos_glue/ohos_adapter/bridge/webview/ |
H A D | ark_res_sched_client_adapter_impl.cpp | 23 bool ArkResSchedClientAdapter::ReportKeyThread(int32_t statusAdapter, pid_t pid, pid_t tid, int32_t roleAdapter) in ReportKeyThread() argument 26 (NWeb::ResSchedStatusAdapter)statusAdapter, pid, tid, (NWeb::ResSchedRoleAdapter)roleAdapter); in ReportKeyThread() 29 bool ArkResSchedClientAdapter::ReportWindowStatus(int32_t statusAdapter, pid_t pid, uint32_t windowId, int32_t nwebId) in ReportWindowStatus() argument 32 (NWeb::ResSchedStatusAdapter)statusAdapter, pid, windowId, nwebId); in ReportWindowStatus() 41 bool ArkResSchedClientAdapter::ReportAudioData(int32_t statusAdapter, pid_t pid, pid_t tid) in ReportAudioData() argument 43 return NWeb::ResSchedClientAdapter::ReportAudioData((NWeb::ResSchedStatusAdapter)statusAdapter, pid, tid); in ReportAudioData() 56 void ArkResSchedClientAdapter::ReportRenderProcessStatus(int32_t statusAdapter, pid_t pid) in ReportRenderProcessStatus() argument 58 NWeb::ResSchedClientAdapter::ReportRenderProcessStatus((NWeb::ResSchedStatusAdapter)statusAdapter, pid); in ReportRenderProcessStatus() 61 bool ArkResSchedClientAdapter::ReportScreenCapture(int32_t statusAdapter, pid_t pid) in ReportScreenCapture() argument 63 return NWeb::ResSchedClientAdapter::ReportScreenCapture((NWeb::ResSchedStatusAdapter)statusAdapter, pid); in ReportScreenCapture() 66 ReportVideoPlaying(int32_t statusAdapter, pid_t pid) ReportVideoPlaying() argument 71 ReportProcessInUse(pid_t pid) ReportProcessInUse() argument [all...] |
/base/web/webview/ohos_interface/ohos_glue/ohos_adapter/bridge/webcore/ |
H A D | ark_res_sched_client_adapter_wrapper.cpp | 22 ResSchedStatusAdapter statusAdapter, pid_t pid, pid_t tid, ResSchedRoleAdapter roleAdapter) in ReportKeyThread() 25 (int32_t)statusAdapter, pid, tid, (int32_t)roleAdapter); in ReportKeyThread() 29 ResSchedStatusAdapter statusAdapter, pid_t pid, uint32_t windowId, int32_t nwebId) in ReportWindowStatus() 31 return OHOS::ArkWeb::ArkResSchedClientAdapter::ReportWindowStatus((int32_t)statusAdapter, pid, windowId, nwebId); in ReportWindowStatus() 40 bool ResSchedClientAdapter::ReportAudioData(ResSchedStatusAdapter statusAdapter, pid_t pid, pid_t tid) in ReportAudioData() argument 42 return OHOS::ArkWeb::ArkResSchedClientAdapter::ReportAudioData((int32_t)statusAdapter, pid, tid); in ReportAudioData() 55 void ResSchedClientAdapter::ReportRenderProcessStatus(ResSchedStatusAdapter statusAdapter, pid_t pid) in ReportRenderProcessStatus() argument 57 return OHOS::ArkWeb::ArkResSchedClientAdapter::ReportRenderProcessStatus((int32_t)statusAdapter, pid); in ReportRenderProcessStatus() 60 bool ResSchedClientAdapter::ReportScreenCapture(ResSchedStatusAdapter statusAdapter, pid_t pid) in ReportScreenCapture() argument 62 return OHOS::ArkWeb::ArkResSchedClientAdapter::ReportScreenCapture((int32_t)statusAdapter, pid); in ReportScreenCapture() 21 ReportKeyThread( ResSchedStatusAdapter statusAdapter, pid_t pid, pid_t tid, ResSchedRoleAdapter roleAdapter) ReportKeyThread() argument 28 ReportWindowStatus( ResSchedStatusAdapter statusAdapter, pid_t pid, uint32_t windowId, int32_t nwebId) ReportWindowStatus() argument 65 ReportVideoPlaying(ResSchedStatusAdapter statusAdapter, pid_t pid) ReportVideoPlaying() argument 70 ReportProcessInUse(pid_t pid) ReportProcessInUse() argument [all...] |
/base/security/access_token/services/privacymanager/src/seccomp/ |
H A D | privacy_sec_comp_enhance_agent.cpp | 36 ACCESSTOKEN_LOG_INFO(LABEL, "OnProcessDied pid %{public}d", processData.pid); in OnProcessDied() 37 PrivacySecCompEnhanceAgent::GetInstance().RemoveSecCompEnhance(processData.pid); in OnProcessDied() 101 void PrivacySecCompEnhanceAgent::RemoveSecCompEnhance(int pid) in RemoveSecCompEnhance() argument 105 if (iter->pid == pid) { in RemoveSecCompEnhance() 107 ACCESSTOKEN_LOG_INFO(LABEL, "Remove pid %{public}d data.", pid); in RemoveSecCompEnhance() 111 ACCESSTOKEN_LOG_ERROR(LABEL, "Not found pid %{public}d data.", pid); in RemoveSecCompEnhance() 119 int pid = IPCSkeleton::GetCallingPid(); RegisterSecCompEnhance() local 141 UpdateSecCompEnhance(int32_t pid, uint32_t seqNum) UpdateSecCompEnhance() argument 155 GetSecCompEnhance(int32_t pid, SecCompEnhanceData& enhanceData) GetSecCompEnhance() argument [all...] |
/base/startup/appspawn/test/moduletest/ |
H A D | appspawn_module_test.cpp | 77 bool ReadFileInfo(char *buffer, const int32_t &pid, const char *fileName) in ReadFileInfo() argument 81 if (sprintf_s(filePath, sizeof(filePath), "/proc/%d/%s", pid, fileName) <= 0) { in ReadFileInfo() 110 bool CheckUid(const int32_t &pid, const int newUid) in CheckUid() argument 112 if (ReadFileInfo(g_buffer, pid, "status")) { in CheckUid() 113 GTEST_LOG_(INFO) << "CheckUid pid " << pid << " buffer :" << g_buffer; in CheckUid() 125 HILOG_INFO(LOG_CORE, "new proc(%{public}d) uid = %{public}d, setUid=%{public}d.", pid, uid, newUid); in CheckUid() 133 bool CheckGid(const int32_t &pid, const int newGid) in CheckGid() argument 135 if (ReadFileInfo(g_buffer, pid, "status")) { in CheckGid() 136 GTEST_LOG_(INFO) << "CheckGid pid " << pi in CheckGid() 160 GetGids(const int32_t &pid, std::vector<int32_t> &gids) GetGids() argument 194 CheckGids(const int32_t &pid, const std::vector<int32_t> newGids) CheckGids() argument 205 CheckGidsCount(const int32_t &pid, const std::vector<int32_t> newGids) CheckGidsCount() argument 216 CheckProcName(const int32_t &pid, const std::string &newProcessName) CheckProcName() argument 234 CheckProcessIsDestroyed(const int32_t &pid) CheckProcessIsDestroyed() argument [all...] |
/base/hiviewdfx/hiview/framework/native/unified_collection/process/include/ |
H A D | process_status.h | 42 std::string GetProcessName(int32_t pid);
43 ProcessState GetProcessState(int32_t pid);
44 uint64_t GetProcessLastForegroundTime(int32_t pid);
45 void NotifyProcessState(int32_t pid, ProcessState procState);
48 bool UpdateProcessName(int32_t pid, const std::string& procName);
49 void UpdateProcessState(int32_t pid, ProcessState procState);
50 void UpdateProcessForegroundState(int32_t pid);
51 void UpdateProcessBackgroundState(int32_t pid);
54 void ClearProcessInfo(int32_t pid);
58 /* map<pid, ProcessInf [all...] |
/base/sensors/sensor/services/src/ |
H A D | sensor_power_policy.cpp | 45 ErrCode SensorPowerPolicy::SuspendSensors(int32_t pid) in SuspendSensors() argument 48 std::vector<int32_t> sensorIdList = clientInfo_.GetSensorIdByPid(pid); in SuspendSensors() 50 SEN_HILOGD("Suspend sensors failed, sensorIdList is empty, pid:%{public}d", pid); in SuspendSensors() 54 auto pidSensorInfoIt = pidSensorInfoMap_.find(pid); in SuspendSensors() 57 if (!Suspend(pid, sensorIdList, sensorInfoMap)) { in SuspendSensors() 58 SEN_HILOGE("Suspend part sensors, but some failed, pid:%{public}d", pid); in SuspendSensors() 61 SEN_HILOGI("Suspend sensors success, pid:%{public}d", pid); in SuspendSensors() 75 Suspend(int32_t pid, const std::vector<int32_t> &sensorIdList, std::unordered_map<int32_t, SensorBasicInfo> &sensorInfoMap) Suspend() argument 104 ResumeSensors(int32_t pid) ResumeSensors() argument 136 Resume(int32_t pid, int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) Resume() argument 170 RestoreSensorInfo(int32_t pid, int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) RestoreSensorInfo() argument 195 int32_t pid = pidSensorInfo.first; GetSuspendPidList() local 219 GetActiveInfoList(int32_t pid) GetActiveInfoList() argument [all...] |
/base/hiviewdfx/hidumper/test/scripts/testModule/ |
H A D | test_memory.py | 100 pid = GetPidByProcessName(processName)
101 command = f"hidumper --mem {pid}"
129 pid = None
131 pid = GetPidByProcessName("com.ohos.launcher")
133 pid = GetPidByProcessName("com.ohos.sceneboard")
135 pid = GetPidByProcessName("com.example.myapplication")
136 if pid == "":
138 command = f"hdc shell \"hidumper --mem-jsheap {pid}\""
148 pid = None
150 pid [all...] |
/base/hiviewdfx/faultloggerd/test/unittest/unwind/ |
H A D | unwinder_pac_test.cpp | 53 static pid_t pid = getpid(); in HWTEST_F() local 56 GTEST_LOG_(INFO) << "pid: " << pid << ", ppid:" << getppid(); in HWTEST_F() 57 auto unwinder = std::make_shared<Unwinder>(pid); in HWTEST_F() 58 bool unwRet = DfxPtrace::Attach(pid); in HWTEST_F() 60 auto regs = DfxRegs::CreateRemoteRegs(pid); in HWTEST_F() 61 auto maps = DfxMaps::Create(pid); in HWTEST_F() 64 context.pid = pid; in HWTEST_F() 72 DfxPtrace::Detach(pid); in HWTEST_F() 92 static pid_t pid = getpid(); HWTEST_F() local [all...] |
/base/hiviewdfx/faultloggerd/test/funchook/ |
H A D | dfx_func_hook_unittest.cpp | 54 pid_t pid = fork(); in HWTEST_F() local 55 bool isSuccess = pid >= 0; in HWTEST_F() 60 if (pid == 0) { in HWTEST_F() 64 int ret = waitpid(pid, &status, 0); in HWTEST_F() 65 printf("child ret with pid:%d status:%d\n", ret, status); in HWTEST_F() 83 pid_t pid = fork(); in HWTEST_F() local 84 bool isSuccess = pid >= 0; in HWTEST_F() 89 if (pid == 0) { in HWTEST_F() 94 printf("child pid:%d\n", pid); in HWTEST_F() [all...] |
/base/hiviewdfx/hiview/base/utility/ |
H A D | common_utils.cpp | 37 std::string GetProcessNameFromProcCmdline(int32_t pid) in GetProcessNameFromProcCmdline() argument 39 std::string procCmdlinePath = "/proc/" + std::to_string(pid) + "/cmdline"; in GetProcessNameFromProcCmdline() 60 std::string GetProcessNameFromProcStat(int32_t pid) in GetProcessNameFromProcStat() argument 62 std::string procStatFilePath = "/proc/" + std::to_string(pid) + "/stat"; in GetProcessNameFromProcStat() 85 pid_t pid = fork(); in ExecCommand() local 86 if (pid < 0) { in ExecCommand() 88 } else if (pid == 0) { in ExecCommand() 110 waitpid(pid, &status, WNOHANG); in ExecCommand() 122 std::string GetProcNameByPid(pid_t pid) in GetProcNameByPid() argument 126 (void)snprintf_s(buf, BUF_SIZE_256, BUF_SIZE_256 - 1, "/proc/%d/comm", pid); in GetProcNameByPid() 136 GetProcFullNameByPid(pid_t pid) GetProcFullNameByPid() argument 147 pid_t pid = -1; GetPidByName() local 155 istr >> pid; GetPidByName() local 161 IsTheProcessExist(pid_t pid) IsTheProcessExist() argument 170 IsPidExist(pid_t pid) IsPidExist() argument 205 pid_t pid = fork(); WriteCommandResultToFile() local [all...] |
/base/hiviewdfx/faultloggerd/interfaces/innerkits/procinfo/ |
H A D | procinfo.cpp | 51 int pid = 0; in GetProcStatusByPath() local 62 if (sscanf_s(buf, "%*[^0-9]%d", &pid) != ARGS_COUNT_ONE) { in GetProcStatusByPath() 63 procInfo.pid = getpid(); in GetProcStatusByPath() 65 procInfo.pid = pid; in GetProcStatusByPath() 67 procInfo.nsPid = pid; in GetProcStatusByPath() 83 if (sscanf_s(buf, "%*[^0-9]%d%*[^0-9]%d", &pid, &nsPid) != ARGS_COUNT_TWO) { in GetProcStatusByPath() 85 procInfo.nsPid = pid; in GetProcStatusByPath() 90 procInfo.pid = pid; in GetProcStatusByPath() 98 TidToNstid(const int pid, const int tid, int& nstid) TidToNstid() argument 127 IsThreadInPid(int32_t pid, int32_t tid) IsThreadInPid() argument 138 GetTidsByPidWithFunc(const int pid, std::vector<int>& tids, std::function<bool(int)> const& func) GetTidsByPidWithFunc() argument 164 GetTidsByPid(const int pid, std::vector<int>& tids, std::vector<int>& nstids) GetTidsByPid() argument 187 pid_t pid = getpid(); GetStacktraceHeader() local 212 ReadThreadNameByPidAndTid(const int pid, const int tid, std::string& str) ReadThreadNameByPidAndTid() argument 220 ReadProcessName(const int pid, std::string& str) ReadProcessName() argument 233 ReadProcessStatus(std::string& result, const int pid) ReadProcessStatus() argument 248 ReadProcessWchan(std::string& result, const int pid, bool onlyPid, bool withThreadName) ReadProcessWchan() argument [all...] |
/base/hiviewdfx/faultloggerd/test/unittest/process_dump/ |
H A D | process_dump_test.cpp | 86 GTEST_LOG_(INFO) << "DfxProcessTest002: get pid failed."; in HWTEST_F() 89 pid_t pid = accountmgrPid; in HWTEST_F() local 91 auto keyThread = DfxThread::Create(pid, tid, tid); in HWTEST_F() 92 auto process = DfxProcess::Create(pid, pid); in HWTEST_F() 140 pid_t pid = getpid(); in HWTEST_F() local 141 std::shared_ptr<DfxProcess> process1 = DfxProcess::Create(pid, pid); in HWTEST_F() 142 pid_t ret = process1->ChangeTid(pid, false); in HWTEST_F() 145 ASSERT_EQ(ret, pid); in HWTEST_F() 166 int32_t pid = 1, tid = 1; HWTEST_F() local 180 int32_t pid = 243, tid = 243; HWTEST_F() local 197 pid_t pid = GetProcessPid(ACCOUNTMGR_NAME); HWTEST_F() local 221 pid_t pid = GetProcessPid(ACCOUNTMGR_NAME); HWTEST_F() local 288 pid_t pid = GetProcessPid(ACCOUNTMGR_NAME); HWTEST_F() local 315 pid_t pid = GetProcessPid(ACCOUNTMGR_NAME); HWTEST_F() local [all...] |