mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-30 10:31:07 +00:00
hitchTime bugfix
Signed-off-by: frank-huangran <frank.huangran@huawei.com>
This commit is contained in:
parent
e1600c119c
commit
ed81fd5162
@ -37,8 +37,7 @@ public:
|
||||
double GetTimes(std::string line, const std::string &sign) const;
|
||||
void AppList(std::string line, const std::string &signS, const std::string &signF);
|
||||
void APPTabs(std::string line, const std::string &signS, const std::string &signF);
|
||||
void AppSwiperScroll(std::string line, const std::string &signS);
|
||||
void AppSwiperFrameRate(std::string line);
|
||||
void AppSwiperScroll(std::string line, const std::string &signS, const std::string &signF);
|
||||
void GetRsHardWareRate(double curFrameRate, std::string line, SWIM_TYPE type);
|
||||
void GetFrameLossTime(double curTime, double prevTime, double drawTime, double &totalFrameLossTime);
|
||||
void CalcFrameRate();
|
||||
|
@ -53,24 +53,7 @@ double StallingRateTrace::CalculateTime()
|
||||
std::string line;
|
||||
while (getline(infile, line)) {
|
||||
AppList(line, signS, signF);
|
||||
AppSwiperScroll(line, signS);
|
||||
if (line.find("H:APP_SWIPER_FLING,") != std::string::npos ||
|
||||
line.find("H:APP_SWIPER_NO_ANIMATION_SWITCH") != std::string::npos ||
|
||||
line.find("H:APP_SWITCH_FRAME_ANIMATION") != std::string::npos) {
|
||||
if (swiperFlingFlag == 1) {
|
||||
LOGI("AppSwiper FinishTime line: (%s)", line.c_str());
|
||||
swiperDynamicFinishTime = GetTimes(line, signF);
|
||||
LOGI("swiperDynamicFinishTime: (%s)", std::to_string(swiperDynamicFinishTime).c_str());
|
||||
swiperFlag = false;
|
||||
}
|
||||
if (swiperDynamicFinishTime == 0) {
|
||||
swiperFlingFlag = 0;
|
||||
} else if (swiperDynamicFinishTime != 0) {
|
||||
break;
|
||||
}
|
||||
swiperFlingFlag++;
|
||||
}
|
||||
AppSwiperFrameRate(line);
|
||||
AppSwiperScroll(line, signS, signF);
|
||||
APPTabs(line, signS, signF);
|
||||
}
|
||||
CalcFrameRate();
|
||||
@ -198,10 +181,12 @@ void StallingRateTrace::AppList(std::string line, const std::string &signS, cons
|
||||
line.find("H:LAUNCHER_APP_LAUNCH_FROM_DOCK,") != std::string::npos ||
|
||||
line.find("H:LAUNCHER_APP_LAUNCH_FROM_APPCENTER,") != std::string::npos) {
|
||||
if (listFlag) {
|
||||
LOGI("AppList finishTime line: (%s)", line.c_str());
|
||||
appListDynamicFinishTime = GetTimes(line, signF);
|
||||
LOGI("appListDynamicFinishTime: (%s)", std::to_string(appListDynamicFinishTime).c_str());
|
||||
listFlag = false;
|
||||
} else {
|
||||
LOGI("AppList startTime line: (%s)", line.c_str());
|
||||
appListDynamicStartTime = GetTimes(line, signS);
|
||||
LOGI("appListDynamicStartTime: (%s)", std::to_string(appListDynamicStartTime).c_str());
|
||||
listFlag = true;
|
||||
@ -301,21 +286,34 @@ void StallingRateTrace::UpdateRoundTime(double curFrameRate, SWIM_TYPE type)
|
||||
}
|
||||
}
|
||||
|
||||
void StallingRateTrace::AppSwiperScroll(std::string line, const std::string &signS)
|
||||
void StallingRateTrace::AppSwiperScroll(std::string line, const std::string &signS, const std::string &signF)
|
||||
{
|
||||
if (line.find("H:APP_SWIPER_NO_ANIMATION_SWITCH") != std::string::npos ||
|
||||
line.find("H:APP_SWITCH_FRAME_ANIMATION") != std::string::npos ||
|
||||
line.find("H:APP_SWIPER_SCROLL,") != std::string::npos) {
|
||||
if (swiperScrollFlag == 0) {
|
||||
LOGI("AppSwiperScroll startTime line: (%s)", line.c_str());
|
||||
swiperDynamicStartTime = GetTimes(line, signS);
|
||||
LOGI("swiperDynamicStartTime: (%s)", std::to_string(swiperDynamicStartTime).c_str());
|
||||
frameLossSwiperTime = 0;
|
||||
swiperScrollFlag = 1;
|
||||
swiperFlag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
void StallingRateTrace::AppSwiperFrameRate(std::string line)
|
||||
{
|
||||
if (line.find("H:APP_SWIPER_FLING,") != std::string::npos ||
|
||||
line.find("H:APP_SWIPER_NO_ANIMATION_SWITCH") != std::string::npos ||
|
||||
line.find("H:APP_SWITCH_FRAME_ANIMATION") != std::string::npos) {
|
||||
if (swiperFlingFlag == 1) {
|
||||
LOGI("AppSwiperScroll finishTime line: (%s)", line.c_str());
|
||||
swiperDynamicFinishTime = GetTimes(line, signF);
|
||||
LOGI("swiperDynamicFinishTime: (%s)", std::to_string(swiperDynamicFinishTime).c_str());
|
||||
swiperFlag = false;
|
||||
}
|
||||
if (swiperDynamicFinishTime == 0) {
|
||||
swiperFlingFlag = 0;
|
||||
}
|
||||
swiperFlingFlag++;
|
||||
}
|
||||
if (swiperFlag) {
|
||||
GetRsHardWareRate(nowSwiperFrameRate, line, SWIM_APPSWIPER);
|
||||
if (upperScreenSwiperFlag) {
|
||||
@ -342,10 +340,12 @@ void StallingRateTrace::APPTabs(std::string line, const std::string &signS, cons
|
||||
line.find("H:APP_TABS_FRAME_ANIMATION") != std::string::npos ||
|
||||
line.find("H:APP_TABS_SCROLL,") != std::string::npos) {
|
||||
if (tabsFlag) {
|
||||
LOGI("APPTabs finishTime line: (%s)", line.c_str());
|
||||
appTabsDynamicFinishTime = GetTimes(line, signF);
|
||||
LOGI("appTabsDynamicFinishTime: (%s)", std::to_string(appTabsDynamicFinishTime).c_str());
|
||||
tabsFlag = false;
|
||||
} else {
|
||||
LOGI("APPTabs startTime line: (%s)", line.c_str());
|
||||
appTabsDynamicStartTime = GetTimes(line, signS);
|
||||
LOGI("appTabsDynamicStartTime: (%s)", std::to_string(appTabsDynamicStartTime).c_str());
|
||||
tabsFlag = true;
|
||||
|
Loading…
Reference in New Issue
Block a user