From 43580ffe0119d3cb2a8a13b80709be1f70cda83c Mon Sep 17 00:00:00 2001 From: Dai Li Date: Tue, 22 Nov 2022 19:19:16 +0800 Subject: [PATCH] Codex fix for frame_aware_sched Signed-off-by: Dai Li --- common/include/rtg_interface.h | 4 ++-- .../core/frame_aware_policy/include/app_info.h | 7 ++----- .../core/frame_aware_policy/src/app_info.cpp | 14 -------------- interfaces/innerkits/frameintf/rtg_interface.cpp | 10 +++++----- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/common/include/rtg_interface.h b/common/include/rtg_interface.h index 68d5a60..f8642bd 100644 --- a/common/include/rtg_interface.h +++ b/common/include/rtg_interface.h @@ -100,9 +100,9 @@ extern "C" { int SetMargin(int grpId, int stateParam); int ListRtgThread(int grpId, vector *rs); // list all tasks of grpId; int ListRtgGroup(vector *rs); - int SearchRtgForTid(int stateParam); + int SearchRtgForTid(int tid); int GetRtgEnable(); } } // namespace RME } // namespace OHOS -#endif // OHOS_FRAME_AWARE_SCHED_COMMON_INCLUDE_RTG_INTERFACE_H \ No newline at end of file +#endif // OHOS_FRAME_AWARE_SCHED_COMMON_INCLUDE_RTG_INTERFACE_H diff --git a/frameworks/core/frame_aware_policy/include/app_info.h b/frameworks/core/frame_aware_policy/include/app_info.h index ba2d5d8..8af5afc 100644 --- a/frameworks/core/frame_aware_policy/include/app_info.h +++ b/frameworks/core/frame_aware_policy/include/app_info.h @@ -21,10 +21,8 @@ namespace OHOS { namespace RME { -namespace { - constexpr int RT_PRIO = 0; - constexpr int RT_NUM = 4; -} +constexpr int RT_PRIO = 0; +constexpr int RT_NUM = 4; enum class AppState { APP_FOREGROUND, @@ -45,7 +43,6 @@ enum class CgroupPolicy { class AppInfo { public: - AppInfo(std::string appName, int pid, int uiTid, int renderTid, int isFocus, AppState state); AppInfo(int pid); ~AppInfo() = default; diff --git a/frameworks/core/frame_aware_policy/src/app_info.cpp b/frameworks/core/frame_aware_policy/src/app_info.cpp index de29658..322f846 100644 --- a/frameworks/core/frame_aware_policy/src/app_info.cpp +++ b/frameworks/core/frame_aware_policy/src/app_info.cpp @@ -17,20 +17,6 @@ namespace OHOS { namespace RME { -namespace { - constexpr int RTG_GRP_INIT = -1; -} - -AppInfo::AppInfo(std::string appName, int pid, int uiTid, int renderTid, int isFocus, AppState state) - : m_appName(appName), - m_pid(pid), - m_uiTid(uiTid), - m_renderTid(renderTid), - m_isFocus(isFocus), - m_rtGrp(RTG_GRP_INIT), - m_appState(state) -{} - AppInfo::AppInfo(int pid) : m_appName(""), m_pid(pid), diff --git a/interfaces/innerkits/frameintf/rtg_interface.cpp b/interfaces/innerkits/frameintf/rtg_interface.cpp index 49f3e1c..bcfcfbb 100644 --- a/interfaces/innerkits/frameintf/rtg_interface.cpp +++ b/interfaces/innerkits/frameintf/rtg_interface.cpp @@ -194,7 +194,7 @@ int RemoveRtgThread(int tid) return ret; }; -int ClearRtgGrp(int GrpId) +int ClearRtgGrp(int grpId) { struct rtg_grp_data grp_data; int ret; @@ -204,7 +204,7 @@ int ClearRtgGrp(int GrpId) } (void)memset_s(&grp_data, sizeof(struct rtg_grp_data), 0, sizeof(struct rtg_grp_data)); grp_data.rtg_cmd = CMD_CLEAR_RTG_GRP; - grp_data.grp_id = GrpId; + grp_data.grp_id = grpId; ret = ioctl(fd, CMD_ID_SET_RTG, &grp_data); if (ret < 0) { RME_LOGE("clear rtg grp failed, errno = %{public}d (%{public}s)", errno, strerror(errno)); @@ -215,7 +215,7 @@ int ClearRtgGrp(int GrpId) return ret; }; -int DestroyRtgGrp(int GrpId) +int DestroyRtgGrp(int grpId) { struct rtg_grp_data grp_data; int ret; @@ -225,12 +225,12 @@ int DestroyRtgGrp(int GrpId) } (void)memset_s(&grp_data, sizeof(struct rtg_grp_data), 0, sizeof(struct rtg_grp_data)); grp_data.rtg_cmd = CMD_DESTROY_RTG_GRP; - grp_data.grp_id = GrpId; + grp_data.grp_id = grpId; ret = ioctl(fd, CMD_ID_SET_RTG, &grp_data); if (ret < 0) { RME_LOGE("destroy rtg grp failed, errno = %{public}d (%{public}s)", errno, strerror(errno)); } else { - RME_LOGI("destroy rtg grp success, get rtg id:%{public}d, ret:%{public}d.", GrpId, ret); + RME_LOGI("destroy rtg grp success, get rtg id:%{public}d, ret:%{public}d.", grpId, ret); } close(fd); return ret; -- Gitee