|
@@ -345,6 +345,10 @@ ErrorCodeEnum ResourceWatcherFSM::OnInit()
|
|
|
m_skipDesktopDetect = TRUE;
|
|
|
}
|
|
|
spRunConfig->ReadConfigValueInt("WarnRecord", "disk", m_diskLastWarnHour);
|
|
|
+
|
|
|
+ UploadSysProcInfoTask* uploadProcInfo = new UploadSysProcInfoTask(this);
|
|
|
+ GetEntityBase()->GetFunction()->PostThreadPoolTask(uploadProcInfo);
|
|
|
+
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
@@ -5144,3 +5148,39 @@ void ResourceWatcherFSM::ConfirmWindowEffectHasBeenOpen()
|
|
|
}
|
|
|
#endif // RVC_OS_LINUX
|
|
|
|
|
|
+void ResourceWatcherFSM::GetSystemProccess()
|
|
|
+{
|
|
|
+ if(processName.empty())
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Get Sys Process error, it's empty!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ int len = 0;
|
|
|
+ CSimpleStringA startStr = "{";
|
|
|
+ CSimpleStringA curProcStr = "";
|
|
|
+ CSimpleStringA endStr = ",";
|
|
|
+ CSimpleStringA totalProcStr = "";
|
|
|
+ unordered_map<int, CSimpleStringA>::iterator it;
|
|
|
+ for (it = processName.begin(); it != processName.end(); ++it)
|
|
|
+ {
|
|
|
+ //"pid1":"name1"
|
|
|
+ curProcStr = CSimpleStringA("\"") + to_string(it->first).c_str() + "\":\"" + it->second + "\"";
|
|
|
+
|
|
|
+ //{"pid1":"name1", "pid2":"name2", …… 往后一个一个拼接,如果达到长度上限 则把“,” 替换为“ } ”
|
|
|
+ len = totalProcStr.GetLength() + curProcStr.GetLength();
|
|
|
+ if (len >= 1500)
|
|
|
+ {
|
|
|
+ endStr = "}";
|
|
|
+ totalProcStr = startStr + totalProcStr + endStr;
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetSystemProccess")(totalProcStr.GetData());
|
|
|
+ //清空进程信息,重新收集
|
|
|
+ totalProcStr.Clear();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ totalProcStr = startStr + totalProcStr + endStr;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|