oeAware-manager/0006-fix-issues.patch

155 lines
6.1 KiB
Diff
Raw Normal View History

From f300ba0b4f5fbfd472aebea6f3c85c0ae6532f34 Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Thu, 13 Mar 2025 14:20:14 +0800
Subject: [PATCH] fix issues
---
src/client/analysis/analysis_report.h | 4 ++--
src/client/analysis/config.cpp | 4 ++--
src/client/analysis/config.h | 4 ++--
.../collect/system/system_collector.cpp | 1 -
.../tune/system/network/smc_tune/smc_tune.cpp | 19 ++++++++++---------
.../tune/system/network/smc_tune/smc_tune.h | 2 +-
src/plugin/tune/system/system_tune.cpp | 3 ---
7 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/src/client/analysis/analysis_report.h b/src/client/analysis/analysis_report.h
index 984c4e6..07b1831 100644
--- a/src/client/analysis/analysis_report.h
+++ b/src/client/analysis/analysis_report.h
@@ -29,8 +29,8 @@ struct AnalysisTemplate {
struct TlbMissAnalysis {
TlbMiss tlbMiss;
int cnt = -1; // The first data is invalid.
- int threshold1 = 5;
- int threshold2 = 5;
+ double threshold1 = 5;
+ double threshold2 = 10;
bool IsHighMiss();
void Add(const TlbMiss &tempTlbMiss);
};
diff --git a/src/client/analysis/config.cpp b/src/client/analysis/config.cpp
index 03298f2..5760b91 100644
--- a/src/client/analysis/config.cpp
+++ b/src/client/analysis/config.cpp
@@ -61,10 +61,10 @@ bool Config::Init(int argc, char **argv)
showVerbose = true;
break;
case L1_MISS_THRESHOLD:
- l1MissThreshold = atoi(optarg);
+ l1MissThreshold = atof(optarg);
break;
case L2_MISS_THRESHOLD:
- l2MissThreshold = atoi(optarg);
+ l2MissThreshold = atof(optarg);
break;
case 'h':
default:
diff --git a/src/client/analysis/config.h b/src/client/analysis/config.h
index 2a89f90..052d9e0 100644
--- a/src/client/analysis/config.h
+++ b/src/client/analysis/config.h
@@ -48,8 +48,8 @@ private:
const int minAnalyzeTime = 1;
const int maxAnalyzeTime = 100;
int analysisTime = 30; // default 30s
- int l1MissThreshold = 5;
- int l2MissThreshold = 10;
+ double l1MissThreshold = 5;
+ double l2MissThreshold = 10;
const std::string shortOptions = "t:hrv";
const std::vector<option> longOptions = {
{"help", no_argument, nullptr, 'h'},
diff --git a/src/plugin/collect/system/system_collector.cpp b/src/plugin/collect/system/system_collector.cpp
index 1eb934b..75edc4a 100644
--- a/src/plugin/collect/system/system_collector.cpp
+++ b/src/plugin/collect/system/system_collector.cpp
@@ -19,5 +19,4 @@ extern "C" void GetInstance(std::vector<std::shared_ptr<oeaware::Interface>> &in
interface.emplace_back(std::make_shared<ThreadCollector>());
interface.emplace_back(std::make_shared<KernelConfig>());
interface.emplace_back(std::make_shared<CommandCollector>());
- interface.emplace_back(std::make_shared<EnvInfo>());
}
diff --git a/src/plugin/tune/system/network/smc_tune/smc_tune.cpp b/src/plugin/tune/system/network/smc_tune/smc_tune.cpp
index 30ab8c5..a12b171 100644
--- a/src/plugin/tune/system/network/smc_tune/smc_tune.cpp
+++ b/src/plugin/tune/system/network/smc_tune/smc_tune.cpp
@@ -48,8 +48,10 @@ void SmcTune::UpdateData(const DataList &dataList)
oeaware::Result SmcTune::Enable(const std::string &param)
{
(void)param;
- auto listpair = ReadConfig(SMC_ACC_YAML_PATH);
- SMC_OP->InputPortList(listpair.first, listpair.second);
+ if (ReadConfig(SMC_ACC_YAML_PATH) < 0) {
+ return oeaware::Result(FAILED);
+ }
+ SMC_OP->InputPortList(blackPortList, whitePortList);
int ret = (SMC_OP->EnableSmcAcc() == EXIT_SUCCESS ? OK : FAILED);
return oeaware::Result(ret);
}
@@ -63,23 +65,22 @@ void SmcTune::Disable()
void SmcTune::Run()
{
- auto listpair = ReadConfig(SMC_ACC_YAML_PATH);
- if (SMC_OP->IsSamePortList(listpair.first, listpair.second)) {
+ ReadConfig(SMC_ACC_YAML_PATH);
+ if (SMC_OP->IsSamePortList(blackPortList, whitePortList)) {
return;
}
- SMC_OP->InputPortList(listpair.first, listpair.second);
+ SMC_OP->InputPortList(blackPortList, whitePortList);
if (SMC_OP->ReRunSmcAcc() != EXIT_SUCCESS)
WARN(logger, "failed to ReRunSmcAcc");
}
-std::pair<std::string, std::string> oeaware::SmcTune::ReadConfig(const std::string &path)
+int oeaware::SmcTune::ReadConfig(const std::string &path)
{
std::ifstream sysFile(path);
- std::string blackPortList, whitePortList;
if (!sysFile.is_open()) {
WARN(logger, "smc_acc.yaml config open failed.");
- return std::make_pair("", "");
+ return -1;
}
YAML::Node node = YAML::LoadFile(path);
@@ -88,5 +89,5 @@ std::pair<std::string, std::string> oeaware::SmcTune::ReadConfig(const std::stri
whitePortList = node["white_port_list_param"] ? node["white_port_list_param"].as<std::string>() : "";
sysFile.close();
- return std::make_pair(blackPortList, whitePortList);
+ return 0;
}
diff --git a/src/plugin/tune/system/network/smc_tune/smc_tune.h b/src/plugin/tune/system/network/smc_tune/smc_tune.h
index c22142d..8501696 100644
--- a/src/plugin/tune/system/network/smc_tune/smc_tune.h
+++ b/src/plugin/tune/system/network/smc_tune/smc_tune.h
@@ -27,7 +27,7 @@ public:
void Run() override;
private:
- std::pair<std::string, std::string> ReadConfig(const std::string &path);
+ int ReadConfig(const std::string &path);
std::string blackPortList;
std::string whitePortList;
};
diff --git a/src/plugin/tune/system/system_tune.cpp b/src/plugin/tune/system/system_tune.cpp
index 90b1d66..3e1224a 100644
--- a/src/plugin/tune/system/system_tune.cpp
+++ b/src/plugin/tune/system/system_tune.cpp
@@ -30,7 +30,4 @@ extern "C" void GetInstance(std::vector<std::shared_ptr<oeaware::Interface>> &in
interface.emplace_back(std::make_shared<TransparentHugepageTune>());
interface.emplace_back(std::make_shared<Seep>());
interface.emplace_back(std::make_shared<PreloadTune>());
-#ifdef BUILD_NETIRQ_TUNE
- interface.emplace_back(std::make_shared<NetHardIrq>());
-#endif
}
\ No newline at end of file
--
2.33.0