thread_cpu回退为getpid

Signed-off-by: yuhaoqiang <yuhaoqiang@huawei.com>
This commit is contained in:
yuhaoqiang 2024-03-23 16:26:40 +08:00
commit 5a2e36c273

View File

@ -39,7 +39,7 @@ void HidebugAppThreadCpu::InitThreadCpuCollector()
HILOG_ERROR(LOG_CORE, "InitThreadCpuCollector fail, CpuCollector create fail!"); HILOG_ERROR(LOG_CORE, "InitThreadCpuCollector fail, CpuCollector create fail!");
return; return;
} }
int pid = getprocpid(); int pid = getpid();
threadStatInfoCollector_ = cpuCollector->CreateThreadCollector(pid); threadStatInfoCollector_ = cpuCollector->CreateThreadCollector(pid);
if (!threadStatInfoCollector_) { if (!threadStatInfoCollector_) {
HILOG_ERROR(LOG_CORE, "InitThreadCpuCollector fail, CreateThreadStatInfoCollector fail!"); HILOG_ERROR(LOG_CORE, "InitThreadCpuCollector fail, CreateThreadStatInfoCollector fail!");