!99 [sync] PR-97: fix issues
From: @openeuler-sync-bot Reviewed-by: @ksana123 Signed-off-by: @ksana123
This commit is contained in:
commit
ea80deea5c
155
0002-add-analysis-tlb-miss-parameter.patch
Normal file
155
0002-add-analysis-tlb-miss-parameter.patch
Normal file
@ -0,0 +1,155 @@
|
||||
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
|
||||
|
||||
24
0003-update-numafast-version.patch
Normal file
24
0003-update-numafast-version.patch
Normal file
@ -0,0 +1,24 @@
|
||||
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
|
||||
|
||||
130
0004-InfocmdHandler-add-the-display-of-running-status.patch
Normal file
130
0004-InfocmdHandler-add-the-display-of-running-status.patch
Normal file
@ -0,0 +1,130 @@
|
||||
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
|
||||
|
||||
Binary file not shown.
@ -1,11 +1,14 @@
|
||||
Name: oeAware-manager
|
||||
Version: v2.0.2
|
||||
Release: 1
|
||||
Release: 2
|
||||
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
|
||||
|
||||
BuildRequires: cmake make gcc-c++
|
||||
BuildRequires: boost-devel
|
||||
@ -104,6 +107,10 @@ fi
|
||||
%attr(0644, root, root) %{_includedir}/oeaware/data/*.h
|
||||
|
||||
%changelog
|
||||
* Sat Mar 8 2025 fly_1997 <flylove7@outlook.com> -v2.0.2-2
|
||||
- add analysis tlb parameter
|
||||
- update numafast version
|
||||
|
||||
* Mon Feb 24 2025 fly_1997 <flylove7@outlook.com> -v2.0.2-1
|
||||
- add hugepage detection report
|
||||
- add transparent hugepage, preload tune instances
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user