mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-27 00:51:47 +00:00
修改告警
Signed-off-by: frank-huangran <frank.huangran@huawei.com>
This commit is contained in:
parent
b9d9201a8e
commit
6d3a0307bc
@ -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";
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user