revert socperf

Signed-off-by: 林思成 <linsicheng1@huawei.com>
This commit is contained in:
林思成
2025-05-09 08:08:00 +00:00
committed by Gitee
parent aec573dc07
commit 70ddc91c32
4 changed files with 0 additions and 66 deletions
-1
View File
@@ -105,7 +105,6 @@
"sandbox_manager",
"screenlock_mgr",
"selinux_adapter",
"soc_perf",
"storage_service",
"toolchain",
"webview",
@@ -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"
@@ -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<AppfreezeManager> instance_;
-56
View File
@@ -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<std::string> 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> AppfreezeManager::instance_ = nullptr;
ffrt::mutex AppfreezeManager::singletonMutex_;
ffrt::mutex AppfreezeManager::freezeMutex_;
@@ -346,7 +333,6 @@ int AppfreezeManager::NotifyANR(const FaultData& faultData, const AppfreezeManag
DelayedSingleton<AppExecFwk::AppMgrClient>::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