修改告警

Signed-off-by: frank-huangran <frank.huangran@huawei.com>
This commit is contained in:
frank-huangran 2024-08-22 18:25:36 +08:00
parent b9d9201a8e
commit 6d3a0307bc
3 changed files with 9 additions and 4 deletions

View File

@ -39,7 +39,7 @@ void ByTrace::ThreadGetTrace() const
if (SPUtils::IsHmKernel()) {
cmdString = CMD_COMMAND_MAP.at(CmdCommand::HITRACE_1024);
} else {
cmdString = CMD_COMMAND_MAP.at(CmdCommand::HITRACE_2048);;
cmdString = CMD_COMMAND_MAP.at(CmdCommand::HITRACE_2048);
}
std::string time = std::to_string(SPUtils::GetCurTime());
std::string traceFile = "/data/local/tmp/sptrace_" + time + ".ftrace";

View File

@ -213,6 +213,10 @@ void FPS::ReadDataFromPipe(int fd)
LOGI("FPS::fpsInfo.curTime: %s", std::to_string(fpsInfo.curTime).c_str());
LOGI("FPS::psInfo.currTimeDump: %s", std::to_string(fpsInfo.currTimeDump).c_str());
FILE *fp = fdopen(fd, "r");
if (!fp) {
LOGE("FPS::Failed to open file descriptor");
return;
}
while (fgets(tmp, sizeof(tmp), fp) != nullptr) {
std::string str(tmp);
LOGD("FPS::dump time: %s", str.c_str());
@ -225,7 +229,9 @@ void FPS::ReadDataFromPipe(int fd)
}
CalcFpsAndJitters();
}
fclose(fp);
if (fclose(fp) == EOF) {
LOGE("FPS::Failed to close file descriptor");
}
}
void FPS::CalcFpsAndJitters()

View File

@ -247,8 +247,7 @@ std::string StartUpDelay::GetPidByPkg(const std::string &curPkgName)
return resultPid;
}
resultPid = std::string(buf, nread);
size_t splitFlag = resultPid.find(" ");
resultProcId = resultPid.substr(0, splitFlag.size() - 1);
resultProcId = resultPid.substr(0, resultPid.size() - 1);
close(pipefd[0]);
waitpid(pid, nullptr, 0);
}