diff --git a/bundle.json b/bundle.json index 8816d979f3..38fc7eb4e9 100644 --- a/bundle.json +++ b/bundle.json @@ -105,7 +105,6 @@ "sandbox_manager", "screenlock_mgr", "selinux_adapter", - "soc_perf", "storage_service", "toolchain", "webview", diff --git a/interfaces/inner_api/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index 7334825844..4665831bc5 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_manager/BUILD.gn @@ -173,12 +173,6 @@ ohos_shared_library("app_manager") { defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] } - if (defined(global_parts_info) && - defined(global_parts_info.resourceschedule_soc_perf)) { - external_deps += [ "soc_perf:socperf_client" ] - defines += [ "SOC_PERF_ENABLE" ] - } - innerapi_tags = [ "platformsdk" ] subsystem_name = "ability" part_name = "ability_runtime" diff --git a/services/appdfr/include/appfreeze_manager.h b/services/appdfr/include/appfreeze_manager.h index 9c49b959ae..e5db5c8858 100644 --- a/services/appdfr/include/appfreeze_manager.h +++ b/services/appdfr/include/appfreeze_manager.h @@ -131,9 +131,6 @@ private: int MergeNotifyInfo(FaultData& faultNotifyData, const AppfreezeManager::AppInfo& appInfo); static const inline std::string LOGGER_DEBUG_PROC_PATH = "/proc/transaction_proc"; - int64_t perfTime = 0; - void PerfStart(std::string eventName); - std::string GetFirstLine(const std::string &path); std::string name_; static ffrt::mutex singletonMutex_; static std::shared_ptr instance_; diff --git a/services/appdfr/src/appfreeze_manager.cpp b/services/appdfr/src/appfreeze_manager.cpp index 5be50f28fb..f7dfdf4bef 100644 --- a/services/appdfr/src/appfreeze_manager.cpp +++ b/services/appdfr/src/appfreeze_manager.cpp @@ -34,9 +34,6 @@ #include "parameters.h" #include "singleton.h" -#ifdef SOC_PERF_ENABLE -#include "socperf_client.h" -#endif #include "app_mgr_client.h" #include "hilog_tag_wrapper.h" #include "time_util.h" @@ -73,16 +70,6 @@ static bool g_betaVersion = OHOS::system::GetParameter("const.logsystem.versiont static bool g_developMode = (OHOS::system::GetParameter("persist.hiview.leak_detector", "unknown") == "enable") || (OHOS::system::GetParameter("persist.hiview.leak_detector", "unknown") == "true"); } -static constexpr const char *const TWELVE_BIG_CPU_CUR_FREQ = "/sys/devices/system/cpu/cpufreq/policy2/scaling_cur_freq"; -static constexpr const char *const TWELVE_BIG_CPU_MAX_FREQ = "/sys/devices/system/cpu/cpufreq/policy2/scaling_max_freq"; -static constexpr const char *const TWELVE_MID_CPU_CUR_FREQ = "/sys/devices/system/cpu/cpufreq/policy1/scaling_cur_freq"; -static constexpr const char *const TWELVE_MID_CPU_MAX_FREQ = "/sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq"; -static constexpr const char *const TWELVE_LIT_CPU_CUR_FREQ = "/sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq"; -static constexpr const char *const TWELVE_LIT_CPU_MAX_FREQ = "/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq"; -const static std::set HALF_EVENT_CONFIGS = {"UI_BLOCK_3S", "THREAD_BLOCK_3S", "BUSSNESS_THREAD_BLOCK_3S", - "LIFECYCLE_HALF_TIMEOUT"}; -static constexpr int PERF_TIME = 60000; -static constexpr int PERF_NUM = 10202; std::shared_ptr AppfreezeManager::instance_ = nullptr; ffrt::mutex AppfreezeManager::singletonMutex_; ffrt::mutex AppfreezeManager::freezeMutex_; @@ -346,7 +333,6 @@ int AppfreezeManager::NotifyANR(const FaultData& faultData, const AppfreezeManag DelayedSingleton::GetInstance()->GetAppRunningUniqueIdByPid(appInfo.pid, appRunningUniqueId); int ret = 0; - this->PerfStart(faultData.errorObject.name); int64_t startTime = AbilityRuntime::TimeUtil::CurrentTimeMillis(); if (faultData.errorObject.name == AppFreezeType::APP_INPUT_BLOCK) { ret = HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK, faultData.errorObject.name, @@ -758,47 +744,5 @@ bool AppfreezeManager::IsValidFreezeFilter(int32_t pid, const std::string& bundl "pid:%{public}d", ret, bundleName.c_str(), pid); return ret; } -void AppfreezeManager::PerfStart(std::string eventName) -{ - const int buffSize = 128; - char paramOutBuff[buffSize] = {0}; - GetParameter("const.dfx.sub_health_recovery.enable", "", paramOutBuff, buffSize - 1); - std::string str(paramOutBuff); - if (str != "true") { - return; - } - auto it = HALF_EVENT_CONFIGS.find(eventName); - if (it == HALF_EVENT_CONFIGS.end()) { - return; - } - auto curTime = AbilityRuntime::TimeUtil::SystemTimeMillisecond(); - if (curTime - perfTime < PERF_TIME) { - TAG_LOGI(AAFwkTag::APPDFR, "perf time is less than 60s"); - return; - } - std::string bigCpuCurFreq = this->GetFirstLine(TWELVE_BIG_CPU_CUR_FREQ); - std::string bigCpuMaxFreq = this->GetFirstLine(TWELVE_BIG_CPU_MAX_FREQ); - std::string midCpuCurFreq = this->GetFirstLine(TWELVE_MID_CPU_CUR_FREQ); - std::string midCpuMaxFreq = this->GetFirstLine(TWELVE_MID_CPU_MAX_FREQ); - if (bigCpuCurFreq == bigCpuMaxFreq || midCpuCurFreq == midCpuMaxFreq) { - perfTime = curTime; - TAG_LOGI(AAFwkTag::APPDFR, "perf start"); -#ifdef SOC_PERF_ENABLE - OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequest(PERF_NUM, ""); -#endif - TAG_LOGI(AAFwkTag::APPDFR, "perf end"); - } -} -std::string AppfreezeManager::GetFirstLine(const std::string &path) -{ - std::ifstream inFile(path.c_str()); - if (!inFile) { - return ""; - } - std::string firstLine; - getline(inFile, firstLine); - inFile.close(); - return firstLine; -} } // namespace AAFwk } // namespace OHOS \ No newline at end of file