!107 [sync] PR-105: fix issues
From: @openeuler-sync-bot Reviewed-by: @ksana123 Signed-off-by: @ksana123
This commit is contained in:
commit
e13989ac2d
154
0006-fix-issues.patch
Normal file
154
0006-fix-issues.patch
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
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 ¶m)
|
||||||
|
{
|
||||||
|
(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
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: oeAware-manager
|
Name: oeAware-manager
|
||||||
Version: v2.0.2
|
Version: v2.0.2
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: OeAware is a framework for implementing low-load collection, sensing, and tuning on openEuler.
|
Summary: OeAware is a framework for implementing low-load collection, sensing, and tuning on openEuler.
|
||||||
License: MulanPSL2
|
License: MulanPSL2
|
||||||
URL: https://gitee.com/openeuler/%{name}
|
URL: https://gitee.com/openeuler/%{name}
|
||||||
@ -10,6 +10,7 @@ Patch2: 0002-add-analysis-tlb-miss-parameter.patch
|
|||||||
Patch3: 0003-update-numafast-version.patch
|
Patch3: 0003-update-numafast-version.patch
|
||||||
Patch4: 0004-InfocmdHandler-add-the-display-of-running-status.patch
|
Patch4: 0004-InfocmdHandler-add-the-display-of-running-status.patch
|
||||||
Patch5: 0005-add-parameter-detection.patch
|
Patch5: 0005-add-parameter-detection.patch
|
||||||
|
Patch6: 0006-fix-issues.patch
|
||||||
|
|
||||||
BuildRequires: cmake make gcc-c++
|
BuildRequires: cmake make gcc-c++
|
||||||
BuildRequires: boost-devel
|
BuildRequires: boost-devel
|
||||||
@ -108,6 +109,11 @@ fi
|
|||||||
%attr(0644, root, root) %{_includedir}/oeaware/data/*.h
|
%attr(0644, root, root) %{_includedir}/oeaware/data/*.h
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Mar 15 2025 fly_1997 <flylove7@outlook.com> -v2.0.2-4
|
||||||
|
- use double for analysis tlb parameters
|
||||||
|
- if an error occurs during smc config loading, smc_tune fails to be enabled
|
||||||
|
- remove unused instance
|
||||||
|
|
||||||
* Tue Mar 11 2025 fly_1997 <flylove7@outlook.com> -v2.0.2-3
|
* Tue Mar 11 2025 fly_1997 <flylove7@outlook.com> -v2.0.2-3
|
||||||
- add parameter detection
|
- add parameter detection
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user