update to v2.0.3

(cherry picked from commit ecc41982cb67083c6e56b1871509294b4daccf26)
This commit is contained in:
ye yiyang 2025-05-07 19:04:37 +08:00 committed by openeuler-sync-bot
parent 2496081b13
commit 416e4f174c
12 changed files with 21 additions and 684 deletions

View File

@ -1,23 +0,0 @@
From 302dd0423610204859a30dc6c702252108184b06 Mon Sep 17 00:00:00 2001
From: zhaolichang <z00577012@china.huawei.com>
Date: Mon, 24 Feb 2025 15:59:12 +0800
Subject: [PATCH] convert preload_tune from dynamic library to static library
---
src/plugin/tune/system/preload/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugin/tune/system/preload/CMakeLists.txt b/src/plugin/tune/system/preload/CMakeLists.txt
index d704c6b..0e1a1a9 100644
--- a/src/plugin/tune/system/preload/CMakeLists.txt
+++ b/src/plugin/tune/system/preload/CMakeLists.txt
@@ -1,5 +1,5 @@
project(preload_tune)
-add_library(preload_tune SHARED
+add_library(preload_tune STATIC
preload_tune.cpp
)
--
2.33.0

View File

@ -1,155 +0,0 @@
From 5906dfe108fcd6ecee57c6ed508f19e59b99b81a Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Tue, 4 Mar 2025 14:00:27 +0800
Subject: [PATCH 1/3] add analysis tlb miss parameter
---
src/client/analysis/analysis_cli.cpp | 2 +-
src/client/analysis/analysis_report.cpp | 5 ++++-
src/client/analysis/analysis_report.h | 3 ++-
src/client/analysis/config.cpp | 9 ++++++++-
src/client/analysis/config.h | 14 ++++++++++++++
5 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/client/analysis/analysis_cli.cpp b/src/client/analysis/analysis_cli.cpp
index 7917517..47736a6 100644
--- a/src/client/analysis/analysis_cli.cpp
+++ b/src/client/analysis/analysis_cli.cpp
@@ -64,7 +64,7 @@ static void PrintProgressBar(const std::string &head, float progress, int barWid
void AnalysisCli::Run()
{
auto &analysisReport = oeaware::AnalysisReport::GetInstance();
- analysisReport.Init(std::vector<std::string>{MEMORY_ANALYSIS});
+ analysisReport.Init(std::vector<std::string>{MEMORY_ANALYSIS}, config);
sleep(analysisTime);
analysisReport.AnalyzeResult();
analysisReport.Print();
diff --git a/src/client/analysis/analysis_report.cpp b/src/client/analysis/analysis_report.cpp
index 9e1ada8..801a81e 100644
--- a/src/client/analysis/analysis_report.cpp
+++ b/src/client/analysis/analysis_report.cpp
@@ -13,6 +13,7 @@
#include <iostream>
#include <securec.h>
#include "oe_client.h"
+#include "config.h"
#include "data_register.h"
namespace oeaware {
@@ -39,7 +40,7 @@ void AnalysisReport::UpdateTlbMiss(const TlbMiss &tempTlbMiss)
tlbMissAnalysis.Add(tempTlbMiss);
}
-void AnalysisReport::Init(const std::vector<std::string> &topics)
+void AnalysisReport::Init(const std::vector<std::string> &topics, const Config &config)
{
for (auto &topic : topics) {
char *name = new char[topic.size() + 1];
@@ -48,6 +49,8 @@ void AnalysisReport::Init(const std::vector<std::string> &topics)
OeSubscribe(&cTopic, CallBack);
delete []name;
}
+ tlbMissAnalysis.threshold1 = config.GetL1MissThreshold();
+ tlbMissAnalysis.threshold2 = config.GetL2MissThreshold();
analysisTemplate.suggestions.Init(DEFAULT_ROW, "suggestion");
analysisTemplate.suggestions.SetColumnWidth(DEFAULT_SUGGESTION_WIDTH);
analysisTemplate.suggestions.AddRow({"suggestion", "operation", "result"});
diff --git a/src/client/analysis/analysis_report.h b/src/client/analysis/analysis_report.h
index d342131..984c4e6 100644
--- a/src/client/analysis/analysis_report.h
+++ b/src/client/analysis/analysis_report.h
@@ -13,6 +13,7 @@
#define CLIENT_ANALYSIS_REPORT_H
#include "table.h"
#include "oeaware/data/analysis_data.h"
+#include "config.h"
namespace oeaware {
const int DEFAULT_ROW = 3;
@@ -43,7 +44,7 @@ public:
}
AnalysisReport(const AnalysisReport &) = delete;
AnalysisReport &operator=(const AnalysisReport &) = delete;
- void Init(const std::vector<std::string> &topics);
+ void Init(const std::vector<std::string> &topics, const Config &config);
void Print();
void SetAnalysisTemplate(const AnalysisTemplate &data);
void UpdateMemoryData(const MemoryAnalysisData &memoryAnalysisData);
diff --git a/src/client/analysis/config.cpp b/src/client/analysis/config.cpp
index 32a3bf4..03298f2 100644
--- a/src/client/analysis/config.cpp
+++ b/src/client/analysis/config.cpp
@@ -22,6 +22,8 @@ void Config::PrintHelp()
usage += " -r|--realtime show real time report.\n";
usage += " -v|--verbose show verbose information.\n";
usage += " -h|--help show this help message.\n";
+ usage += " --l1-miss-threshold set l1 tlbmiss threshold.\n";
+ usage += " --l2-miss-threshold set l2 tlbmiss threshold.\n";
std::cout << usage;
}
@@ -58,13 +60,18 @@ bool Config::Init(int argc, char **argv)
case 'v':
showVerbose = true;
break;
+ case L1_MISS_THRESHOLD:
+ l1MissThreshold = atoi(optarg);
+ break;
+ case L2_MISS_THRESHOLD:
+ l2MissThreshold = atoi(optarg);
+ break;
case 'h':
default:
PrintHelp();
return false;
}
}
-
if (optind != argc) {
PrintHelp();
return false;
diff --git a/src/client/analysis/config.h b/src/client/analysis/config.h
index e1a0ff2..2a89f90 100644
--- a/src/client/analysis/config.h
+++ b/src/client/analysis/config.h
@@ -18,6 +18,8 @@
#include <getopt.h>
#include <iostream>
+const int L1_MISS_THRESHOLD = 200;
+const int L2_MISS_THRESHOLD = 201;
class Config {
public:
@@ -34,16 +36,28 @@ public:
{
return showVerbose;
}
+ int GetL1MissThreshold() const
+ {
+ return l1MissThreshold;
+ }
+ int GetL2MissThreshold() const
+ {
+ return l2MissThreshold;
+ }
private:
const int minAnalyzeTime = 1;
const int maxAnalyzeTime = 100;
int analysisTime = 30; // default 30s
+ int l1MissThreshold = 5;
+ int l2MissThreshold = 10;
const std::string shortOptions = "t:hrv";
const std::vector<option> longOptions = {
{"help", no_argument, nullptr, 'h'},
{"realtime", no_argument, nullptr, 'r'},
{"time", required_argument, nullptr, 't'},
{"verbose", no_argument, nullptr, 'v'},
+ {"l1-miss-threshold", required_argument, nullptr, L1_MISS_THRESHOLD},
+ {"l2-miss-threshold", required_argument, nullptr, L2_MISS_THRESHOLD},
{nullptr, 0, nullptr, 0}
};
bool isShowRealTimeReport = false;
--
2.33.0

View File

@ -1,24 +0,0 @@
From cf665d58c56cf5df6d5672b4401075b7fc9e1770 Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Wed, 5 Mar 2025 06:18:58 +0800
Subject: [PATCH 2/3] update numafast version
---
config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.yaml b/config.yaml
index 4498c89..531cee6 100644
--- a/config.yaml
+++ b/config.yaml
@@ -5,4 +5,4 @@ plugin_list:
- name: numafast
description: numafast is a userspace tool designed for Kunpeng Chips that aims to improve
system performance by reducing cross-NUMA memory access.
- url: https://repo.oepkgs.net/openeuler/rpm/openEuler-22.03-LTS-SP4/extras/aarch64/Packages/n/numafast-v2.2.2-1.aarch64.rpm
\ No newline at end of file
+ url: https://repo.oepkgs.net/openeuler/rpm/openEuler-22.03-LTS-SP4/extras/aarch64/Packages/n/numafast-v2.2.3-1.aarch64.rpm
\ No newline at end of file
--
2.33.0

View File

@ -1,130 +0,0 @@
From 35477f607907bfdbe0b312c31d8770e7e858548f Mon Sep 17 00:00:00 2001
From: ye yiyang <850219375@qq.com>
Date: Fri, 7 Mar 2025 11:22:57 +0800
Subject: [PATCH 3/3] InfocmdHandler add the display of running status
---
src/plugin_mgr/event/info_cmd_handler.cpp | 53 +++++++++++++----------
src/plugin_mgr/event/info_cmd_handler.h | 2 +
src/plugin_mgr/plugin.cpp | 6 +++
src/plugin_mgr/plugin.h | 1 +
4 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/src/plugin_mgr/event/info_cmd_handler.cpp b/src/plugin_mgr/event/info_cmd_handler.cpp
index 2d9f72d..8b8dc8c 100644
--- a/src/plugin_mgr/event/info_cmd_handler.cpp
+++ b/src/plugin_mgr/event/info_cmd_handler.cpp
@@ -98,6 +98,34 @@ std::vector<std::string> wrapText(const std::string& text, size_t width)
return wrapped;
}
+void InfoCmdHandler::FormatAndPrint(const std::string& instanceName, const std::string& description,
+ const std::string& effect, std::ostringstream &formattedRes)
+{
+ auto instanceNames = wrapText(instanceName, instanceWidth);
+ auto descriptions = wrapText(description, descriptionWidth);
+ auto effects = wrapText(effect, effectWidth);
+ size_t maxLines = std::max({descriptions.size(), effects.size(), static_cast<size_t>(1)});
+ for (size_t j = 0; j < maxLines; ++j) {
+ if (j < instanceNames.size()) {
+ formattedRes << std::left << std::setw(instanceWidth) << instanceNames[j];
+ } else {
+ formattedRes << std::left << std::setw(instanceWidth) << "";
+ }
+ if (j < descriptions.size()) {
+ formattedRes << "|" << std::setw(descriptionWidth) << descriptions[j];
+ } else {
+ formattedRes << "|" << std::setw(descriptionWidth) << "";
+ }
+ if (j < effects.size()) {
+ formattedRes << "|" << std::setw(effectWidth) << effects[j];
+ } else {
+ formattedRes << "|" << std::setw(effectWidth) << "";
+ }
+ formattedRes << "\n";
+ }
+ formattedRes << std::string(instanceWidth + 1 + descriptionWidth + 1 + effectWidth, '-') << "\n";
+}
+
ErrorCode InfoCmdHandler::AddList(std::string &res)
{
std::vector<std::shared_ptr<Plugin>> allPlugins = memoryStore->GetAllPlugins();
@@ -119,31 +147,10 @@ ErrorCode InfoCmdHandler::AddList(std::string &res)
for (size_t i = 0; i < p->GetInstanceLen(); ++i) {
auto instance = p->GetInstance(i);
auto infoPartner = GetInfo(instance->GetName());
- std::string instanceName = infoPartner.instance;
+ std::string instanceName = instance->GetRun();
std::string description = infoPartner.description;
std::string effect = infoPartner.effect;
- auto descriptions = wrapText(description, descriptionWidth);
- auto effects = wrapText(effect, effectWidth);
- size_t maxLines = std::max({descriptions.size(), effects.size(), static_cast<size_t>(1)});
- formattedRes << std::left << std::setw(instanceWidth) << instanceName;
- formattedRes << "|" << std::setw(descriptionWidth) << descriptions[0];
- formattedRes << "|" << std::setw(effectWidth) << effects[0];
- formattedRes << "\n";
- for (size_t j = 1; j < maxLines; ++j) {
- formattedRes << std::left << std::setw(instanceWidth) << "";
- if (j < descriptions.size()) {
- formattedRes << "|" << std::setw(descriptionWidth) << descriptions[j];
- } else {
- formattedRes << "|" << std::setw(descriptionWidth) << "";
- }
- if (j < effects.size()) {
- formattedRes << "|" << std::setw(effectWidth) << effects[j];
- } else {
- formattedRes << "|" << std::setw(effectWidth) << "";
- }
- formattedRes << "\n";
- }
- formattedRes << std::string(instanceWidth + 1 + descriptionWidth + 1 + effectWidth, '-') << "\n";
+ FormatAndPrint(instanceName, description, effect, formattedRes);
}
}
res = formattedRes.str();
diff --git a/src/plugin_mgr/event/info_cmd_handler.h b/src/plugin_mgr/event/info_cmd_handler.h
index 9ecc246..8eeec2e 100644
--- a/src/plugin_mgr/event/info_cmd_handler.h
+++ b/src/plugin_mgr/event/info_cmd_handler.h
@@ -26,6 +26,8 @@ public:
EventResult Handle(const Event &event) override;
InfoCmd GetInfo(const std::string& name);
bool CreateInfoCmdInstances(const std::string& filePath, std::vector<InfoCmd>& infoCmds);
+ void FormatAndPrint(const std::string& instanceName, const std::string& description,
+ const std::string& effect, std::ostringstream &formattedRes);
private:
ErrorCode AddList(std::string &res);
std::vector<InfoCmd> infoCmd;
diff --git a/src/plugin_mgr/plugin.cpp b/src/plugin_mgr/plugin.cpp
index ed666cb..2dde7e0 100644
--- a/src/plugin_mgr/plugin.cpp
+++ b/src/plugin_mgr/plugin.cpp
@@ -75,6 +75,12 @@ std::string Instance::GetInfo() const
return name + "(" + stateText + ", " + runText + ", count: " + std::to_string(enableCnt) + ")";
}
+std::string Instance::GetRun() const
+{
+ std::string runText = this->enabled ? pluginEnabled : pluginDisabled;
+ return name + " (" + runText + ")";
+}
+
std::string Instance::GetName() const
{
return name;
diff --git a/src/plugin_mgr/plugin.h b/src/plugin_mgr/plugin.h
index 64a79f5..3d34802 100644
--- a/src/plugin_mgr/plugin.h
+++ b/src/plugin_mgr/plugin.h
@@ -32,6 +32,7 @@ struct Instance {
const static std::string pluginStateOff;
std::string GetInfo() const;
std::string GetName() const;
+ std::string GetRun() const;
};
class Plugin {
--
2.33.0

View File

@ -1,44 +0,0 @@
From a0e5625a256fb55e68f1c83ce997e44017e72358 Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Wed, 5 Mar 2025 23:18:09 +0800
Subject: [PATCH] add parameter detection
---
src/client/arg_parse.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/client/arg_parse.cpp b/src/client/arg_parse.cpp
index cb97054..afe95d2 100644
--- a/src/client/arg_parse.cpp
+++ b/src/client/arg_parse.cpp
@@ -81,6 +81,8 @@ int ArgParse::InitCmd(int &cmd, int opt)
if (optarg) {
SetArg(optarg);
}
+ } else {
+ return -1;
}
return 0;
}
@@ -120,11 +122,17 @@ int ArgParse::Init(int argc, char *argv[])
break;
}
default: {
- InitCmd(cmd, opt);
+ if (InitCmd(cmd, opt) < 0) {
+ return -1;
+ }
break;
}
}
}
+ for (int i = optind; i < argc; ++i) {
+ ArgError("invalid option [" + std::string(argv[i]) + "].");
+ return -1;
+ }
if (help) {
PrintHelp();
exit(EXIT_SUCCESS);
--
2.33.0

View File

@ -1,154 +0,0 @@
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

View File

@ -1,30 +0,0 @@
From ce33a2407474a0a061b29ff8dd14ceb9f4515807 Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Sat, 15 Mar 2025 16:04:23 +0800
Subject: [PATCH] fix return value type of the function
---
src/client/analysis/config.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/client/analysis/config.h b/src/client/analysis/config.h
index 052d9e0..179c510 100644
--- a/src/client/analysis/config.h
+++ b/src/client/analysis/config.h
@@ -36,11 +36,11 @@ public:
{
return showVerbose;
}
- int GetL1MissThreshold() const
+ double GetL1MissThreshold() const
{
return l1MissThreshold;
}
- int GetL2MissThreshold() const
+ double GetL2MissThreshold() const
{
return l2MissThreshold;
}
--
2.33.0

View File

@ -1,26 +0,0 @@
From f829a8fbee8a094c7793cea045db9719f10062bc Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Sun, 16 Mar 2025 03:59:56 +0800
Subject: [PATCH] smc_tune: add insmod to the whilelist
---
src/plugin/tune/system/network/smc_tune/smc_ueid.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/plugin/tune/system/network/smc_tune/smc_ueid.cpp b/src/plugin/tune/system/network/smc_tune/smc_ueid.cpp
index 6b57eb1..599e774 100644
--- a/src/plugin/tune/system/network/smc_tune/smc_ueid.cpp
+++ b/src/plugin/tune/system/network/smc_tune/smc_ueid.cpp
@@ -20,7 +20,8 @@ const struct nla_policy smc_gen_ueid_policy[SMC_ACC_NLA_EID_TABLE_MAX + 1] = {
const std::vector<std::string> whiteList ={
"lsmod",
"grep",
- "rmmod"
+ "rmmod",
+ "insmod"
};
static int HandleGenUeidReply(struct nl_msg *msg, void *arg)
--
2.33.0

View File

@ -1,86 +0,0 @@
From be52353bd6781be33ddcd5a665f94c2b3a01908c Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Mon, 24 Mar 2025 23:15:11 +0800
Subject: [PATCH] add analysis args check
---
src/client/analysis/analysis_cli.cpp | 1 +
src/client/analysis/analysis_report.cpp | 3 +++
src/client/analysis/config.cpp | 18 ++++++++++++++++++
3 files changed, 22 insertions(+)
diff --git a/src/client/analysis/analysis_cli.cpp b/src/client/analysis/analysis_cli.cpp
index 47736a6..6497da6 100644
--- a/src/client/analysis/analysis_cli.cpp
+++ b/src/client/analysis/analysis_cli.cpp
@@ -65,6 +65,7 @@ void AnalysisCli::Run()
{
auto &analysisReport = oeaware::AnalysisReport::GetInstance();
analysisReport.Init(std::vector<std::string>{MEMORY_ANALYSIS}, config);
+ std::cout << "Analyzing... Please wait " << analysisTime << "s.\n";
sleep(analysisTime);
analysisReport.AnalyzeResult();
analysisReport.Print();
diff --git a/src/client/analysis/analysis_report.cpp b/src/client/analysis/analysis_report.cpp
index 801a81e..3f5c92e 100644
--- a/src/client/analysis/analysis_report.cpp
+++ b/src/client/analysis/analysis_report.cpp
@@ -67,6 +67,9 @@ void AnalysisReport::MemoryAnalyze()
memoryTable.SetColumnWidth(DEFAULT_SUGGESTION_WIDTH);
const TlbMiss &tlbMiss = tlbMissAnalysis.tlbMiss;
int cnt = tlbMissAnalysis.cnt;
+ if (cnt == 0) {
+ cnt = 1;
+ }
double l1dTlbMiss = tlbMiss.l1dTlbMiss * PERCENT / cnt;
double l1iTlbMiss = tlbMiss.l1iTlbMiss * PERCENT / cnt;
double l2dTlbMiss = tlbMiss.l2dTlbMiss * PERCENT / cnt;
diff --git a/src/client/analysis/config.cpp b/src/client/analysis/config.cpp
index 5760b91..ca4407f 100644
--- a/src/client/analysis/config.cpp
+++ b/src/client/analysis/config.cpp
@@ -11,6 +11,8 @@
******************************************************************************/
#include "config.h"
+#include <regex>
+
void Config::PrintHelp()
{
std::string usage = "";
@@ -40,6 +42,12 @@ bool Config::ParseTime(const char *arg)
return true;
}
+static bool IsNum(const std::string &s)
+{
+ std::regex num(R"(^[+]?\d+(\.\d+)?$)");
+ return std::regex_match(s, num);
+}
+
bool Config::Init(int argc, char **argv)
{
if (argv == nullptr) {
@@ -61,9 +69,19 @@ bool Config::Init(int argc, char **argv)
showVerbose = true;
break;
case L1_MISS_THRESHOLD:
+ if (!IsNum(optarg)) {
+ std::cerr << "Error: Invalid l1-miss-threshold: '" << optarg << "'\n";
+ PrintHelp();
+ return false;
+ }
l1MissThreshold = atof(optarg);
break;
case L2_MISS_THRESHOLD:
+ if (!IsNum(optarg)) {
+ std::cerr << "Error: Invalid l2-miss-threshold: '" << optarg << "'\n";
+ PrintHelp();
+ return false;
+ }
l2MissThreshold = atof(optarg);
break;
case 'h':
--
2.33.0

Binary file not shown.

Binary file not shown.

View File

@ -1,19 +1,10 @@
Name: oeAware-manager
Version: v2.0.2
Release: 7
Version: v2.0.3
Release: 1
Summary: OeAware is a framework for implementing low-load collection, sensing, and tuning on openEuler.
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
Source0: %{name}-%{version}.tar.gz
Patch1: 0001-convert-preload_tune-from-dynamic-library-to-static-.patch
Patch2: 0002-add-analysis-tlb-miss-parameter.patch
Patch3: 0003-update-numafast-version.patch
Patch4: 0004-InfocmdHandler-add-the-display-of-running-status.patch
Patch5: 0005-add-parameter-detection.patch
Patch6: 0006-fix-issues.patch
Patch7: 0007-fix-return-value-type-of-the-function.patch
Patch8: 0008-smc_tune-add-insmod-to-the-whilelist.patch
Patch9: 0009-add-analysis-args-check.patch
BuildRequires: cmake make gcc-c++
BuildRequires: boost-devel
@ -28,6 +19,9 @@ Requires: libkperf
BuildRequires: libnl3 libnl3-devel
BuildRequires: numactl-devel
BuildRequires: kernel-devel
BuildRequires: libbpf-devel
BuildRequires: clang
BuildRequires: bpftool
Requires: graphviz yaml-cpp curl log4cplus boost systemd libboundscheck
Requires: libnl3 acl
Requires: sysstat
@ -58,7 +52,6 @@ install -D -m 0750 build/output/bin/oeaware %{buildroot}%{_bindir}/oeaware
install -D -m 0750 build/output/bin/oeawarectl %{buildroot}%{_bindir}/oeawarectl
install -D -m 0640 config.yaml %{buildroot}%{_sysconfdir}/oeAware/config.yaml
install -D -m 0640 info_cmd.yaml %{buildroot}%{_sysconfdir}/oeAware/info_cmd.yaml
install -D -m 0640 preload.yaml %{buildroot}%{_sysconfdir}/oeAware/preload.yaml
install -D -p -m 0644 oeaware.service %{buildroot}%{_unitdir}/oeaware.service
#install plugin
@ -66,6 +59,11 @@ mkdir -p %{buildroot}%{_libdir}/oeAware-plugin/
mkdir -p %{buildroot}%{_includedir}/oeaware/data
install -dm 0755 %{buildroot}%{_prefix}/lib/smc
install -D -m 0640 preload.yaml %{buildroot}%{_sysconfdir}/oeAware/preload.yaml
install -D -m 0640 etc/analysis_config.yaml %{buildroot}%{_sysconfdir}/oeAware/analysis_config.yaml
%ifarch aarch64
install -D -m 0640 etc/hardirq_tune.conf %{buildroot}%{_libdir}/oeAware-plugin/
%endif
install -b -m740 ./build/output/plugin/lib/*.so %{buildroot}%{_libdir}/oeAware-plugin/
install -b -m740 ./build/output/include/oeaware/*.h %{buildroot}%{_includedir}/oeaware
install -b -m740 ./build/output/include/oeaware/data/*.h %{buildroot}%{_includedir}/oeaware/data
@ -100,12 +98,16 @@ fi
%attr(0640, root, root) %{_sysconfdir}/oeAware/config.yaml
%attr(0640, root, root) %{_sysconfdir}/oeAware/info_cmd.yaml
%attr(0640, root, root) %{_sysconfdir}/oeAware/preload.yaml
%attr(0640, root, root) %{_sysconfdir}/oeAware/analysis_config.yaml
%attr(0644, root, root) %{_unitdir}/oeaware.service
%attr(0640, root, root) %{_libdir}/oeAware-plugin/ub_tune.conf
%attr(0640, root, root) %{_libdir}/oeAware-plugin/thread_scenario.conf
%attr(0640, root, root) %{_libdir}/oeAware-plugin/xcall.yaml
%attr(0640, root, root) %{_libdir}/oeAware-plugin/smc_acc.yaml
%attr(0400, root, root) %{_prefix}/lib/smc/smc_acc.ko
%ifarch aarch64
%attr(0640, root, root) %{_libdir}/oeAware-plugin/hardirq_tune.conf
%endif
%attr(0440, root, root) %{_libdir}/oeAware-plugin/*.so
%attr(0440, root, root) %{_libdir}/liboeaware-sdk.so
@ -114,6 +116,13 @@ fi
%attr(0644, root, root) %{_includedir}/oeaware/data/*.h
%changelog
* Wed May 07 2025 yeyiyang <yeyiyang3@h-partners.com> -v2.0.3-1
- Refactored and enhanced the analysis module:
- Added scenario-aware analysis for multiple optimization plugins
- Introduced command-line result viewing capability
- Implemented Markdown format output support
- Add new plugin: smt,binary,hirq
* Tue Mar 25 2025 fly_1997 <flylove7@outlook.com> -v2.0.2-7
- add analysis args check