diff --git a/0001-change-the-folder-permission-to-755-add-oeaware-grou.patch b/0001-change-the-folder-permission-to-755-add-oeaware-grou.patch deleted file mode 100644 index d7b1f30..0000000 --- a/0001-change-the-folder-permission-to-755-add-oeaware-grou.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 2b39cac80efe7327b6d68fe01934919bc41249b8 Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Tue, 10 Dec 2024 21:46:27 +0800 -Subject: [PATCH] change the folder permission to 755, add oeaware group - permission to liboeaware-sdk.so - ---- - rpm/oeAware.spec | 1 + - src/common/utils.cpp | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/rpm/oeAware.spec b/rpm/oeAware.spec -index 5fbaf1f..4c01d0a 100644 ---- a/rpm/oeAware.spec -+++ b/rpm/oeAware.spec -@@ -60,6 +60,7 @@ install -D -m 0640 ./build/output/plugin/lib/xcall.yaml %{buildroot}%{ - %post - if ! grep -q "oeaware:" /etc/group; then - groupadd oeaware -+ setfacl -m g:oeaware:r /usr/lib64/liboeaware-sdk.so - fi - systemctl start oeaware.service - chcon -t modules_object_t %{_prefix}/lib/smc/smc_acc.ko >/dev/null 2>&1 -diff --git a/src/common/utils.cpp b/src/common/utils.cpp -index 8f63a70..b118235 100644 ---- a/src/common/utils.cpp -+++ b/src/common/utils.cpp -@@ -167,7 +167,7 @@ bool CreateDir(const std::string &path) - if (stat(subPath.c_str(), &buffer) == 0) { - continue; - } -- if (mkdir(subPath.c_str(), S_IRWXU | S_IRWXG) != 0) { -+ if (mkdir(subPath.c_str(), S_IRWXU | S_IXGRP | S_IRGRP | S_IROTH | S_IXOTH) != 0) { - return false; - } - } while (pos != std::string::npos); --- -2.45.2.windows.1 - diff --git a/0001-convert-preload_tune-from-dynamic-library-to-static-.patch b/0001-convert-preload_tune-from-dynamic-library-to-static-.patch new file mode 100644 index 0000000..0414031 --- /dev/null +++ b/0001-convert-preload_tune-from-dynamic-library-to-static-.patch @@ -0,0 +1,23 @@ +From 302dd0423610204859a30dc6c702252108184b06 Mon Sep 17 00:00:00 2001 +From: zhaolichang +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 + diff --git a/0002-docker_cpu_burst-instance-add-unsubscribe-topics.patch b/0002-docker_cpu_burst-instance-add-unsubscribe-topics.patch deleted file mode 100644 index 832451b..0000000 --- a/0002-docker_cpu_burst-instance-add-unsubscribe-topics.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 2f4ac51bd93299e7dd63f2578ac21c87872680c8 Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Mon, 16 Dec 2024 09:53:04 +0800 -Subject: [PATCH 1/3] docker_cpu_burst instance add unsubscribe topics - ---- - src/plugin/tune/docker/cpu_burst_adapt.cpp | 17 ++++++++--------- - src/plugin/tune/docker/cpu_burst_adapt.h | 2 ++ - 2 files changed, 10 insertions(+), 9 deletions(-) - -diff --git a/src/plugin/tune/docker/cpu_burst_adapt.cpp b/src/plugin/tune/docker/cpu_burst_adapt.cpp -index 3fa6254..822e0c5 100644 ---- a/src/plugin/tune/docker/cpu_burst_adapt.cpp -+++ b/src/plugin/tune/docker/cpu_burst_adapt.cpp -@@ -32,6 +32,8 @@ CpuBurstAdapt::CpuBurstAdapt() - topic.instanceName = this->name; - topic.topicName = this->name; - supportTopics.push_back(topic); -+ subscribeTopics.emplace_back(oeaware::Topic{OE_PMU_COUNTING_COLLECTOR, "cycles", ""}); -+ subscribeTopics.emplace_back(oeaware::Topic{OE_DOCKER_COLLECTOR, OE_DOCKER_COLLECTOR, ""}); - } - - oeaware::Result CpuBurstAdapt::OpenTopic(const oeaware::Topic &topic) -@@ -55,20 +57,17 @@ oeaware::Result CpuBurstAdapt::Enable(const std::string ¶m) - (void)param; - if (!CpuBurst::GetInstance().Init()) - return oeaware::Result(FAILED, "CpuBurst init failed!"); -- oeaware::Topic topic; -- topic.instanceName = "pmu_counting_collector"; -- topic.topicName = "cycles"; -- oeaware::Result ret_pmu = Subscribe(topic); -- topic.instanceName = OE_DOCKER_COLLECTOR; -- topic.topicName = OE_DOCKER_COLLECTOR; -- oeaware::Result ret_docker = Subscribe(topic); -- if (ret_pmu.code != OK || ret_docker.code != OK) -- return oeaware::Result(FAILED, "Subscribe failed!"); -+ for (auto &topic : subscribeTopics) { -+ Subscribe(topic); -+ } - return oeaware::Result(OK); - } - - void CpuBurstAdapt::Disable() - { -+ for (auto &topic : subscribeTopics) { -+ Unsubscribe(topic); -+ } - CpuBurst::GetInstance().Exit(); - } - -diff --git a/src/plugin/tune/docker/cpu_burst_adapt.h b/src/plugin/tune/docker/cpu_burst_adapt.h -index 4c583b0..17be704 100644 ---- a/src/plugin/tune/docker/cpu_burst_adapt.h -+++ b/src/plugin/tune/docker/cpu_burst_adapt.h -@@ -24,5 +24,7 @@ public: - oeaware::Result Enable(const std::string ¶m) override; - void Disable() override; - void Run() override; -+private: -+ std::vector subscribeTopics; - }; - #endif // CPU_BURST_ADAPT_H -\ No newline at end of file --- -2.33.0 - diff --git a/0003-add-pmu-check.patch b/0003-add-pmu-check.patch deleted file mode 100644 index e1c98ae..0000000 --- a/0003-add-pmu-check.patch +++ /dev/null @@ -1,192 +0,0 @@ -From 8fcb0cd364de2d4957e36d4206058bff7d723f1b Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Mon, 16 Dec 2024 23:34:32 +0800 -Subject: [PATCH 3/3] add pmu check - ---- - src/plugin/collect/pmu/CMakeLists.txt | 1 + - src/plugin/collect/pmu/pmu_common.cpp | 33 +++++++++++++++++++ - src/plugin/collect/pmu/pmu_common.h | 17 ++++++++++ - .../collect/pmu/pmu_counting_collector.cpp | 4 +++ - .../collect/pmu/pmu_sampling_collector.cpp | 4 +++ - src/plugin/collect/pmu/pmu_spe_collector.cpp | 3 ++ - src/plugin/collect/pmu/pmu_spe_collector.h | 1 + - .../collect/pmu/pmu_uncore_collector.cpp | 3 ++ - src/plugin/collect/pmu/pmu_uncore_collector.h | 1 + - 9 files changed, 67 insertions(+) - create mode 100644 src/plugin/collect/pmu/pmu_common.cpp - create mode 100644 src/plugin/collect/pmu/pmu_common.h - -diff --git a/src/plugin/collect/pmu/CMakeLists.txt b/src/plugin/collect/pmu/CMakeLists.txt -index ba3cb6a..000e26e 100644 ---- a/src/plugin/collect/pmu/CMakeLists.txt -+++ b/src/plugin/collect/pmu/CMakeLists.txt -@@ -22,6 +22,7 @@ set(pmu_src - pmu_uncore_collector.cpp - pmu_uncore.cpp - pmu_collector.cpp -+ pmu_common.cpp - ) - - add_library(pmu SHARED ${pmu_src}) -diff --git a/src/plugin/collect/pmu/pmu_common.cpp b/src/plugin/collect/pmu/pmu_common.cpp -new file mode 100644 -index 0000000..caf453a ---- /dev/null -+++ b/src/plugin/collect/pmu/pmu_common.cpp -@@ -0,0 +1,33 @@ -+/****************************************************************************** -+ * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved. -+ * oeAware is licensed under Mulan PSL v2. -+ * You can use this software according to the terms and conditions of the Mulan PSL v2. -+ * You may obtain a copy of Mulan PSL v2 at: -+ * http://license.coscl.org.cn/MulanPSL2 -+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -+ * See the Mulan PSL v2 for more details. -+ ******************************************************************************/ -+#include "pmu_common.h" -+#include -+#include -+#include "oeaware/utils.h" -+ -+static const std::string DEVICES_PATH = "/sys/bus/event_source/devices/"; -+ -+bool IsSupportPmu() -+{ -+ DIR *dir = opendir(DEVICES_PATH.data()); -+ if (dir == nullptr) { -+ return false; -+ } -+ struct dirent *dent = nullptr; -+ while (dent = readdir(dir)) { -+ std::string armPmuPath = DEVICES_PATH + dent->d_name + "/cpus"; -+ if (oeaware::FileExist(armPmuPath)) { -+ return true; -+ } -+ } -+ return false; -+} -diff --git a/src/plugin/collect/pmu/pmu_common.h b/src/plugin/collect/pmu/pmu_common.h -new file mode 100644 -index 0000000..3ba5a2d ---- /dev/null -+++ b/src/plugin/collect/pmu/pmu_common.h -@@ -0,0 +1,17 @@ -+/****************************************************************************** -+ * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved. -+ * oeAware is licensed under Mulan PSL v2. -+ * You can use this software according to the terms and conditions of the Mulan PSL v2. -+ * You may obtain a copy of Mulan PSL v2 at: -+ * http://license.coscl.org.cn/MulanPSL2 -+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -+ * See the Mulan PSL v2 for more details. -+ ******************************************************************************/ -+#ifndef PMU_COMMON_H -+#define PMU_COMMON_H -+ -+bool IsSupportPmu(); -+ -+#endif -diff --git a/src/plugin/collect/pmu/pmu_counting_collector.cpp b/src/plugin/collect/pmu/pmu_counting_collector.cpp -index 9227d67..281c61d 100644 ---- a/src/plugin/collect/pmu/pmu_counting_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_counting_collector.cpp -@@ -14,6 +14,7 @@ - #include - #include - #include "oeaware/data/pmu_counting_data.h" -+#include "pmu_common.h" - - PmuCountingCollector::PmuCountingCollector(): oeaware::Interface() - { -@@ -119,6 +120,9 @@ void PmuCountingCollector::CloseTopic(const oeaware::Topic &topic) - oeaware::Result PmuCountingCollector::Enable(const std::string ¶m) - { - (void)param; -+ if (!IsSupportPmu()) { -+ return oeaware::Result(FAILED, "the system does not support PMU."); -+ } - return oeaware::Result(OK); - } - -diff --git a/src/plugin/collect/pmu/pmu_sampling_collector.cpp b/src/plugin/collect/pmu/pmu_sampling_collector.cpp -index f1f99eb..b4cf037 100644 ---- a/src/plugin/collect/pmu/pmu_sampling_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_sampling_collector.cpp -@@ -14,6 +14,7 @@ - #include - #include - #include "oeaware/data/pmu_sampling_data.h" -+#include "pmu_common.h" - - PmuSamplingCollector::PmuSamplingCollector(): oeaware::Interface() - { -@@ -123,6 +124,9 @@ void PmuSamplingCollector::CloseTopic(const oeaware::Topic &topic) - oeaware::Result PmuSamplingCollector::Enable(const std::string ¶m) - { - (void)param; -+ if (!IsSupportPmu()) { -+ return oeaware::Result(FAILED, "the system does not support PMU."); -+ } - return oeaware::Result(OK); - } - -diff --git a/src/plugin/collect/pmu/pmu_spe_collector.cpp b/src/plugin/collect/pmu/pmu_spe_collector.cpp -index 19ad8de..dc7e0fb 100644 ---- a/src/plugin/collect/pmu/pmu_spe_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_spe_collector.cpp -@@ -133,6 +133,9 @@ void PmuSpeCollector::CloseTopic(const oeaware::Topic &topic) - oeaware::Result PmuSpeCollector::Enable(const std::string ¶m) - { - (void)param; -+ if (!oeaware::FileExist(spePath)) { -+ return oeaware::Result(FAILED, "the system does not support SPE."); -+ } - return oeaware::Result(OK); - } - -diff --git a/src/plugin/collect/pmu/pmu_spe_collector.h b/src/plugin/collect/pmu/pmu_spe_collector.h -index c913e43..d54a204 100644 ---- a/src/plugin/collect/pmu/pmu_spe_collector.h -+++ b/src/plugin/collect/pmu/pmu_spe_collector.h -@@ -35,6 +35,7 @@ private: - int attrPeriod = 2048; - std::string topicStr = "spe"; - std::chrono::time_point timestamp; -+ const std::string spePath = "/sys/bus/event_source/devices/arm_spe_0"; - const int timeoutMs = 50; - const int notTimeoutMs = 10; - const int periodThreshold = 2; -diff --git a/src/plugin/collect/pmu/pmu_uncore_collector.cpp b/src/plugin/collect/pmu/pmu_uncore_collector.cpp -index ba00ebc..74c2901 100644 ---- a/src/plugin/collect/pmu/pmu_uncore_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_uncore_collector.cpp -@@ -151,6 +151,9 @@ void PmuUncoreCollector::CloseTopic(const oeaware::Topic &topic) - oeaware::Result PmuUncoreCollector::Enable(const std::string ¶m) - { - (void)param; -+ if (!oeaware::FileExist(uncorePath)) { -+ return oeaware::Result(FAILED, "the system does not support uncore events."); -+ } - return oeaware::Result(OK); - } - -diff --git a/src/plugin/collect/pmu/pmu_uncore_collector.h b/src/plugin/collect/pmu/pmu_uncore_collector.h -index 175026f..a01d138 100644 ---- a/src/plugin/collect/pmu/pmu_uncore_collector.h -+++ b/src/plugin/collect/pmu/pmu_uncore_collector.h -@@ -32,6 +32,7 @@ private: - std::vector eventStr; - std::vector hhaDir; - std::chrono::time_point timestamp; -+ const std::string uncorePath = "/sys/bus/event_source/devices/hisi_sccl1_hha2"; - void InitUncoreAttr(struct PmuAttr &attr); - int OpenUncore(); - }; --- -2.33.0 - diff --git a/0004-fix-smc_tune-type.patch b/0004-fix-smc_tune-type.patch deleted file mode 100644 index d34fc9d..0000000 --- a/0004-fix-smc_tune-type.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d8dd0c577bc887e123ab1449b005cc9e534fda09 Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Mon, 16 Dec 2024 15:43:25 +0800 -Subject: [PATCH 2/3] fix smc_tune type - ---- - src/plugin/tune/system/network/smc_tune/smc_tune.cpp | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -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 e1c7f6f..2b910e7 100644 ---- a/src/plugin/tune/system/network/smc_tune/smc_tune.cpp -+++ b/src/plugin/tune/system/network/smc_tune/smc_tune.cpp -@@ -19,11 +19,12 @@ int log_level = 0; - SmcTune::SmcTune() - { - name = OE_SMC_TUNE; -- description = "collect information of key thread"; -+ description = "This solution uses Shared Memory Communications - Direct Memory Access(SMC-D) for TCP" -+ " connections to local peers which also support this function."; - version = "1.0.0"; -- period = -1; -+ period = 1000; - priority = 2; -- type = 2; -+ type = TUNE; - } - - oeaware::Result SmcTune::OpenTopic(const oeaware::Topic &topic) --- -2.33.0 - diff --git a/0005-modify-the-method-of-obtaining-cpu-frequency.patch b/0005-modify-the-method-of-obtaining-cpu-frequency.patch deleted file mode 100644 index f86c4d7..0000000 --- a/0005-modify-the-method-of-obtaining-cpu-frequency.patch +++ /dev/null @@ -1,262 +0,0 @@ -From 781dccda979b392cb6dc8f9b3e65bbf5f0b99373 Mon Sep 17 00:00:00 2001 -From: zhaolichang -Date: Mon, 9 Dec 2024 11:53:48 +0800 -Subject: [PATCH 1/7] modify the method of obtaining cpu frequency - -1. use dmidecode to obtain cpu frequency when cpufreq file does not exist -2. merge duplicate code in cpu frequency ---- - include/oeaware/utils.h | 2 + - src/common/utils.cpp | 51 +++++++++++++++++++ - src/plugin/scenario/analysis/analysis/env.cpp | 39 ++++++-------- - src/plugin/scenario/analysis/analysis/env.h | 1 + - src/plugin/tune/docker/cpu_burst.cpp | 37 ++++++-------- - src/plugin/tune/docker/cpu_burst.h | 1 + - 6 files changed, 87 insertions(+), 44 deletions(-) - -diff --git a/include/oeaware/utils.h b/include/oeaware/utils.h -index 98e9c5c..48fc7af 100644 ---- a/include/oeaware/utils.h -+++ b/include/oeaware/utils.h -@@ -32,6 +32,8 @@ std::vector SplitString(const std::string &str, const std::string & - bool CreateDir(const std::string &path); - bool SetDataListTopic(DataList *dataList, const std::string &instanceName, const std::string &topicName, - const std::string ¶ms); -+uint64_t GetCpuCycles(int cpu); -+uint64_t GetCpuFreqByDmi(); - } - - #endif -\ No newline at end of file -diff --git a/src/common/utils.cpp b/src/common/utils.cpp -index 8f63a70..79bdc49 100644 ---- a/src/common/utils.cpp -+++ b/src/common/utils.cpp -@@ -17,6 +17,8 @@ - #include - #include - #include -+#include -+#include - - namespace oeaware { - const static int ST_MODE_MASK = 0777; -@@ -201,4 +203,53 @@ bool SetDataListTopic(DataList *dataList, const std::string &instanceName, const - return true; - } - -+uint64_t GetCpuCycles(int cpu) -+{ -+ std::string freqPath = "/sys/devices/system/cpu/cpu" + std::to_string(cpu) + "/cpufreq/scaling_cur_freq"; -+ std::ifstream freqFile(freqPath); -+ -+ if (!freqFile.is_open()) { -+ return 0; -+ } -+ -+ uint64_t freq; -+ freqFile >> freq; -+ freqFile.close(); -+ -+ if (freqFile.fail()) { -+ return 0; -+ } -+ -+ return freq * 1000; // 1000: kHz to Hz -+} -+ -+uint64_t GetCpuFreqByDmi() -+{ -+ FILE *pipe = popen("dmidecode -t processor | grep 'Max Speed' | head -n 1 | awk '{print $3}'", "r"); -+ if (!pipe) { -+ std::cout << "failed to run dmidecode" << std::endl; -+ return 0; -+ } -+ -+ char buffer[128]; -+ if (fgets(buffer, sizeof(buffer), pipe) == nullptr) { -+ std::cout << "failed to get cpufreq by dmidecode" << std::endl; -+ pclose(pipe); -+ return 0; -+ } -+ pclose(pipe); -+ -+ std::string str(buffer); -+ str.erase(str.find_last_not_of(" \t\n\r") + 1); -+ -+ for (char c : str) { -+ if (!std::isdigit(c)) { -+ std::cerr << "invalid CPU frequency format: " << str << std::endl; -+ return 0; -+ } -+ } -+ -+ return std::stoull(buffer) * 1000000; // 1000000: MHz to Hz -+} -+ - } -diff --git a/src/plugin/scenario/analysis/analysis/env.cpp b/src/plugin/scenario/analysis/analysis/env.cpp -index a3a5457..63d352f 100644 ---- a/src/plugin/scenario/analysis/analysis/env.cpp -+++ b/src/plugin/scenario/analysis/analysis/env.cpp -@@ -13,7 +13,10 @@ - #include - #include - #include -+#include -+#include "oeaware/utils.h" - #include "env.h" -+ - unsigned long GetPageMask() - { - static unsigned long pageMask = 0; -@@ -29,32 +32,17 @@ unsigned long GetPageMask() - return pageMask; - } - --static uint64_t GetCpuCycles(int cpu) --{ -- std::string freqPath = "/sys/devices/system/cpu/cpu" + std::to_string(cpu) + "/cpufreq/scaling_cur_freq"; -- std::ifstream freqFile(freqPath); -- -- if (!freqFile.is_open()) { -- return 0; -- } -- -- uint64_t freq; -- freqFile >> freq; -- freqFile.close(); -- -- if (freqFile.fail()) { -- return 0; -- } -- -- return freq * 1000; // 1000: kHz to Hz --} -- --static void InitCpuCycles(std::vector &maxCycles, uint64_t &sysMaxCycles) -+static void InitCpuCycles(std::vector &maxCycles, uint64_t &sysMaxCycles, uint64_t &maxCpuFreqByDmi) - { - for (int cpu = 0; cpu < maxCycles.size(); cpu++) { -- maxCycles[cpu] = GetCpuCycles(cpu); -+ maxCycles[cpu] = oeaware::GetCpuCycles(cpu); - sysMaxCycles += maxCycles[cpu]; - } -+ -+ if (sysMaxCycles <= 0) { -+ std::cout << "use dmidecode to obtain cpu frequency" << std::endl; -+ sysMaxCycles = maxCpuFreqByDmi * maxCycles.size(); -+ } - } - - bool Env::Init() -@@ -64,6 +52,7 @@ bool Env::Init() - } - numaNum = numa_num_configured_nodes(); - cpuNum = sysconf(_SC_NPROCESSORS_CONF); -+ maxCpuFreqByDmi = oeaware::GetCpuFreqByDmi(); - cpu2Node.resize(cpuNum, -1); - struct bitmask *cpumask = numa_allocate_cpumask(); - for (int nid = 0; nid < numaNum; ++nid) { -@@ -80,7 +69,11 @@ bool Env::Init() - pageMask = GetPageMask(); - InitDistance(); - cpuMaxCycles.resize(cpuNum, 0); -- InitCpuCycles(cpuMaxCycles, sysMaxCycles); -+ InitCpuCycles(cpuMaxCycles, sysMaxCycles, maxCpuFreqByDmi); -+ if (sysMaxCycles <= 0) { -+ std::cout << "failed to get sysMaxCycles" << std::endl; -+ return false; -+ } - initialized = true; - return true; - } -diff --git a/src/plugin/scenario/analysis/analysis/env.h b/src/plugin/scenario/analysis/analysis/env.h -index f75f035..28b21f4 100644 ---- a/src/plugin/scenario/analysis/analysis/env.h -+++ b/src/plugin/scenario/analysis/analysis/env.h -@@ -36,6 +36,7 @@ public: - int cpuNum; - unsigned long pageMask = 0; - uint64_t sysMaxCycles = 0; -+ uint64_t maxCpuFreqByDmi; - std::vector cpu2Node; - std::vector> distance; - std::vector cpuMaxCycles; // per second -diff --git a/src/plugin/tune/docker/cpu_burst.cpp b/src/plugin/tune/docker/cpu_burst.cpp -index 58b41dd..1e60fb9 100644 ---- a/src/plugin/tune/docker/cpu_burst.cpp -+++ b/src/plugin/tune/docker/cpu_burst.cpp -@@ -14,6 +14,7 @@ - #include - #include - #include "oeaware/data/pmu_counting_data.h" -+#include "oeaware/utils.h" - - constexpr double NINETY_PERCENT = 0.9; - constexpr int MILLISECONDS_IN_SECOND = 1000; -@@ -35,34 +36,28 @@ static void SetCfsBurstUs(const std::string &id, int cfsBurstUs) - return; - } - --static uint64_t GetCpuCycles(int cpu) -+bool CpuBurst::Init() - { -- std::string freq_path = "/sys/devices/system/cpu/cpu" + std::to_string(cpu) + "/cpufreq/scaling_cur_freq"; -- std::ifstream freq_file(freq_path); -+ curSysCycles = 0; -+ maxCpuFreqByDmi = oeaware::GetCpuFreqByDmi(); - -- if (!freq_file.is_open()) { -- return 0; -+ cpuNum = sysconf(_SC_NPROCESSORS_CONF); -+ if (cpuNum <= 0) { -+ std::cout << "can not get cpu num" << std::endl; -+ return false; - } - -- uint64_t freq; -- freq_file >> freq; -- freq_file.close(); -- -- if (freq_file.fail()) { -- return 0; -+ for (unsigned int i = 0; i < cpuNum; i++) { -+ maxSysCycles += oeaware::GetCpuCycles(i); - } - -- return freq * 1000; // 1000: kHz to Hz --} -- --bool CpuBurst::Init() --{ -- curSysCycles = 0; -- cpuNum = sysconf(_SC_NPROCESSORS_CONF); -- for (unsigned int i = 0; i < cpuNum; i++) { -- maxSysCycles += GetCpuCycles(i); -+ if (maxSysCycles <= 0) { -+ std::cout << "use dmidecode to obtain cpu frequency" << std::endl; -+ maxSysCycles = maxCpuFreqByDmi * cpuNum; - } -- if (cpuNum <= 0 || maxSysCycles <= 0) { -+ -+ if (maxSysCycles <= 0) { -+ std::cout << "can not get cpu frequency" << std::endl; - return false; - } - return true; -diff --git a/src/plugin/tune/docker/cpu_burst.h b/src/plugin/tune/docker/cpu_burst.h -index b485747..8ed7fae 100644 ---- a/src/plugin/tune/docker/cpu_burst.h -+++ b/src/plugin/tune/docker/cpu_burst.h -@@ -49,6 +49,7 @@ private: - unsigned int cpuNum = 0; - uint64_t maxSysCycles = 0; // per second - uint64_t curSysCycles = 0; -+ uint64_t maxCpuFreqByDmi; - std::unordered_map containers; - void UpdatePmu(const DataList &dataList); - void UpdateDocker(const DataList &dataList); --- -2.33.0 - diff --git a/0006-update-compilation-options.patch b/0006-update-compilation-options.patch deleted file mode 100644 index efb0b30..0000000 --- a/0006-update-compilation-options.patch +++ /dev/null @@ -1,614 +0,0 @@ -From 48cc5e2163281db23640fa87321b22cadcd69aa0 Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Mon, 23 Dec 2024 18:46:18 +0800 -Subject: [PATCH 2/7] update compilation options - ---- - CMakeLists.txt | 20 +++++++++- - build.sh | 40 +++++++++++++++---- - install.sh | 4 +- - src/client/CMakeLists.txt | 8 ++-- - src/common/CMakeLists.txt | 11 ++--- - src/plugin/CMakeLists.txt | 7 ++-- - src/plugin/collect/docker/CMakeLists.txt | 7 ++-- - src/plugin/collect/pmu/CMakeLists.txt | 15 ++----- - src/plugin/collect/system/CMakeLists.txt | 9 +++-- - src/plugin/scenario/analysis/CMakeLists.txt | 9 ++--- - .../scenario/thread_aware/CMakeLists.txt | 8 +++- - src/plugin/tune/docker/CMakeLists.txt | 17 +++----- - src/plugin/tune/system/CMakeLists.txt | 11 ++--- - .../system/cpu/stealtask_tune/CMakeLists.txt | 7 ---- - .../system/network/smc_tune/CMakeLists.txt | 8 ---- - .../network/smc_tune/kprobe/CMakeLists.txt | 2 - - .../system/power/seep_tune/CMakeLists.txt | 8 ---- - src/plugin/tune/system/xcall/CMakeLists.txt | 8 ---- - src/plugin/tune/unixbench/CMakeLists.txt | 13 +++--- - src/plugin_mgr/CMakeLists.txt | 12 +++--- - src/sdk/CMakeLists.txt | 7 +++- - tests/CMakeLists.txt | 4 +- - 22 files changed, 114 insertions(+), 121 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c6a435e..162ff58 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2,15 +2,33 @@ cmake_minimum_required(VERSION 3.16) - - project(oeAware-manager) - -+set(CMAKE_CXX_STANDARD 14) -+set(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now -Wall -Wextra -fPIC") - set(SDK_OUTPUT_LIBRARY_DIRECTORY ${CMAKE_BINARY_DIR}/output/sdk) - set(SDK_INC_PATH ${CMAKE_CURRENT_LIST_DIR}/src/sdk) - -+if (WITH_ASAN) -+ message(STATUS "enable asan") -+ function(enable_asan target) -+ add_compile_options(-fsanitize=address) -+ target_link_libraries(${target} asan) -+ endfunction() -+endif() -+ -+if (WITH_OPTIMIZATION) -+ message(STATUS "add_compile_options(-O2)") -+ add_compile_options(-O2) -+endif() -+ -+message(STATUS "C Flags: ${CMAKE_C_FLAGS}") -+message(STATUS "CXX Flags: ${CMAKE_CXX_FLAGS}") -+ - add_subdirectory(src/common) - add_subdirectory(src/plugin) - add_subdirectory(src/plugin_mgr) - add_subdirectory(src/client) - add_subdirectory(src/sdk) --if (BUILD_TEST) -+if (WITH_TEST) - add_subdirectory(tests) - endif() - -diff --git a/build.sh b/build.sh -index c405645..bd99758 100644 ---- a/build.sh -+++ b/build.sh -@@ -7,18 +7,25 @@ os_arch=$(uname -m) - libkperf_version="v1.2.1" # only for build_kperf_by_src=ON - build_kperf_by_src="ON" - build_test="OFF" -- -+with_debug="OFF" -+with_asan="OFF" -+with_optimization="OFF" -+params="kperfrpm,help,test,with_asan,with_optimization,debug,release" - function usage() { - echo "" - echo "usage: build.sh [OPTIONS] [ARGS]" - echo "" - echo "The most commonly used build.sh options are:" -- echo " -k |--kperfrpm not build with libkperf by source code" -- echo " -t |--test build tests case" -- echo " -h |--help show usage" -+ echo " -k |--kperfrpm not build with libkperf by source code" -+ echo " -t |--test build tests case" -+ echo " --with_asan open AddressSanitizer compilation option" -+ echo " --with_optimization open optimization compilation option" -+ echo " --debug compile the debug version" -+ echo " --release compile the release version" -+ echo " -h |--help show usage" - } - --options=$(getopt -o kht --long kperfrpm,help,test -- "$@") -+options=$(getopt -o kht --long ${params} -- "$@") - eval set -- "$options" - while true; do - case "$1" in -@@ -27,7 +34,25 @@ while true; do - shift - ;; - -t|--test) -- build_test="ON" -+ with_test="ON" -+ shift -+ ;; -+ --debug) -+ with_test="ON" -+ with_debug="ON" -+ with_optimization="OFF" -+ shift -+ ;; -+ --release) -+ with_optimization="ON" -+ shift -+ ;; -+ --with_asan) -+ with_asan="ON" -+ shift -+ ;; -+ --with_optimization) -+ with_optimization="ON" - shift - ;; - -h|--help) -@@ -69,5 +94,6 @@ fi - - - cmake .. -DLIB_KPERF_LIBPATH=${libkperf_lib} -DLIB_KPERF_INCPATH=${script_dir}/include/oeaware/data \ -- -DBUILD_TEST=${build_test} -+ -DWITH_TEST=${build_test} -DWITH_DEBUG=${with_debug} -DWITH_ASAN=${with_asan} \ -+ -DWITH_OPTIMIZATION=${with_optimization} - make -j$(nproc) -\ No newline at end of file -diff --git a/install.sh b/install.sh -index afa01f2..55cca48 100644 ---- a/install.sh -+++ b/install.sh -@@ -1,8 +1,8 @@ - mkdir -p /usr/include/oeaware - cp -r build/output/include/* /usr/include/ - cp -r build/output/bin/* /bin/ --mkdir -p /etc/oeaware --cp config.yaml /etc/oeaware -+mkdir -p /etc/oeAware -+cp config.yaml /etc/oeAware - cp build/output/sdk/liboeaware-sdk.so /lib64 - - mkdir -p /lib64/oeAware-plugin -diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt -index f16bde1..72c2cce 100644 ---- a/src/client/CMakeLists.txt -+++ b/src/client/CMakeLists.txt -@@ -1,8 +1,5 @@ --cmake_minimum_required (VERSION 3.16) - project(oeAware-client) - --SET(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now -O2 -Wall -Wextra") -- - add_subdirectory(analysis) - - aux_source_directory(. SOURCE) -@@ -11,5 +8,10 @@ target_include_directories(oeawarectl PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/analysis - ${CMAKE_CURRENT_SOURCE_DIR}/../common - ) -+ -+if (WITH_ASAN) -+ enable_asan(oeawarectl) -+endif() -+ - target_link_libraries(oeawarectl analysis_cli common boundscheck) - set_target_properties(oeawarectl PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output/bin") -diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt -index d6bbd58..a1741bc 100644 ---- a/src/common/CMakeLists.txt -+++ b/src/common/CMakeLists.txt -@@ -1,18 +1,11 @@ --cmake_minimum_required (VERSION 3.16) - project(common) - - aux_source_directory(. SOURCE) --SET(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now -Wall -Wextra -fPIC -O2") - -- --include_directories(/usr/include/yaml-cpp) - include_directories(/usr/include/log4cplus) - include_directories(../plugin/collect/include) - include_directories(../plugin/scenario/include) - include_directories(${LIB_KPERF_INCPATH}) --include_directories(/usr/include/curl) -- --link_directories(/usr/lib64) - - add_library(${PROJECT_NAME} - ${SOURCE} -@@ -22,6 +15,10 @@ target_link_libraries(${PROJECT_NAME} log4cplus) - target_link_libraries(${PROJECT_NAME} yaml-cpp) - target_link_libraries(${PROJECT_NAME} curl boundscheck) - -+if (WITH_ASAN) -+ enable_asan(${PROJECT_NAME}) -+endif() -+ - if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") - target_link_directories(${PROJECT_NAME} PUBLIC - ${LIB_KPERF_LIBPATH} -diff --git a/src/plugin/CMakeLists.txt b/src/plugin/CMakeLists.txt -index 450c933..a4ee240 100644 ---- a/src/plugin/CMakeLists.txt -+++ b/src/plugin/CMakeLists.txt -@@ -1,4 +1,3 @@ -- - include_directories( - ${CMAKE_SOURCE_DIR}/include - ) -@@ -15,9 +14,9 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") - endif() - add_subdirectory(collect/system) - -- if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") -- add_subdirectory(scenario/analysis) -- endif() -+if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") -+ add_subdirectory(scenario/analysis) -+endif() - add_subdirectory(scenario/thread_aware) - - add_subdirectory(tune/system) -diff --git a/src/plugin/collect/docker/CMakeLists.txt b/src/plugin/collect/docker/CMakeLists.txt -index cdde00f..5e1760d 100644 ---- a/src/plugin/collect/docker/CMakeLists.txt -+++ b/src/plugin/collect/docker/CMakeLists.txt -@@ -1,9 +1,10 @@ --cmake_minimum_required(VERSION 3.11) - project(docker_collector) --add_compile_options(-O2 -fPIC -Wall -Wextra) - add_library(docker_collector SHARED - docker_adapt.cpp - docker_collector.cpp - ) -+if (WITH_ASAN) -+ enable_asan(docker_collector) -+endif() - set_target_properties(docker_collector PROPERTIES -- LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -\ No newline at end of file -+ LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -diff --git a/src/plugin/collect/pmu/CMakeLists.txt b/src/plugin/collect/pmu/CMakeLists.txt -index 000e26e..cb2870b 100644 ---- a/src/plugin/collect/pmu/CMakeLists.txt -+++ b/src/plugin/collect/pmu/CMakeLists.txt -@@ -1,16 +1,5 @@ --cmake_minimum_required(VERSION 3.15) - project(pmu_plugin) - --set(CMAKE_CXX_STANDARD 14) -- --option(WITH_DEBUG "debug mode" OFF) -- --if (WITH_DEBUG) -- message("-- Note:pmu debug mode") -- add_compile_options(-g) --endif() --add_compile_options(-O2 -fPIC -Wall -Wextra -g) -- - # libkperf - message("-- libkperf library path: ${LIB_KPERF_LIBPATH}") - message("-- libkperf include path: ${LIB_KPERF_INCPATH}") -@@ -35,6 +24,10 @@ target_link_directories(pmu PUBLIC - ${LIB_KPERF_LIBPATH} - ) - -+if (WITH_ASAN) -+ enable_asan(pmu) -+endif() -+ - target_link_libraries(pmu boundscheck kperf) - set_target_properties(pmu PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -diff --git a/src/plugin/collect/system/CMakeLists.txt b/src/plugin/collect/system/CMakeLists.txt -index 3ec2358..7f832e5 100644 ---- a/src/plugin/collect/system/CMakeLists.txt -+++ b/src/plugin/collect/system/CMakeLists.txt -@@ -1,7 +1,5 @@ --cmake_minimum_required(VERSION 3.11) - project(system_collector) - include_directories(command) --add_compile_options(-O2 -fPIC -Wall -Wextra) - add_library(system_collector SHARED - thread_collector.cpp - system_collector.cpp -@@ -12,6 +10,11 @@ add_library(system_collector SHARED - ) - target_include_directories(system_collector PUBLIC ${CMAKE_SOURCE_DIR}/include) - target_include_directories(system_collector PRIVATE ${CMAKE_SOURCE_DIR}/src/common) -+ -+if (WITH_ASAN) -+ enable_asan(system_collector) -+endif() -+ - target_link_libraries(system_collector common) - set_target_properties(system_collector PROPERTIES -- LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -\ No newline at end of file -+ LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -diff --git a/src/plugin/scenario/analysis/CMakeLists.txt b/src/plugin/scenario/analysis/CMakeLists.txt -index 4cfe525..46fff34 100644 ---- a/src/plugin/scenario/analysis/CMakeLists.txt -+++ b/src/plugin/scenario/analysis/CMakeLists.txt -@@ -1,5 +1,3 @@ --cmake_minimum_required(VERSION 3.15) -- - project(analysis) - message("-- libkperf library path: ${LIB_KPERF_LIBPATH}") - message("-- libkperf include path: ${LIB_KPERF_INCPATH}") -@@ -11,19 +9,20 @@ set(analysis_src - - set(oeaware_src adapt/analysis_aware.cpp) - --add_compile_options(-g -fPIC -Wall -Wextra -O2) -- - add_library(analysis_base OBJECT ${analysis_src}) - target_include_directories(analysis_base PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/analysis - ${LIB_KPERF_INCPATH} - ) - -- - target_link_libraries(analysis_base numa boundscheck) - - add_library(analysis_oeaware SHARED ${oeaware_src}) - -+if (WITH_ASAN) -+ enable_asan(analysis_oeaware) -+endif() -+ - target_link_libraries(analysis_oeaware analysis_base) - set_target_properties(analysis_oeaware PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -\ No newline at end of file -diff --git a/src/plugin/scenario/thread_aware/CMakeLists.txt b/src/plugin/scenario/thread_aware/CMakeLists.txt -index 01395e5..7e91f20 100644 ---- a/src/plugin/scenario/thread_aware/CMakeLists.txt -+++ b/src/plugin/scenario/thread_aware/CMakeLists.txt -@@ -1,10 +1,14 @@ --cmake_minimum_required(VERSION 3.11) - project(thread_scenario) --add_compile_options(-O2 -fPIC -Wall -Wextra) -+ - add_library(thread_scenario SHARED - thread_aware.cpp - ) - target_include_directories(thread_scenario PUBLIC ${CMAKE_SOURCE_DIR}/include) -+ -+if (WITH_ASAN) -+ enable_asan(thread_scenario) -+endif() -+ - set_target_properties(thread_scenario PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/thread_scenario.conf" -diff --git a/src/plugin/tune/docker/CMakeLists.txt b/src/plugin/tune/docker/CMakeLists.txt -index a41465a..27115dc 100644 ---- a/src/plugin/tune/docker/CMakeLists.txt -+++ b/src/plugin/tune/docker/CMakeLists.txt -@@ -1,16 +1,5 @@ --cmake_minimum_required(VERSION 3.11) -- - project(docker_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra) -- --message("-- libkperf include path: ${LIB_KPERF_INCPATH}") -- - add_library(docker_tune SHARED - cpu_burst.cpp - cpu_burst_adapt.cpp -@@ -21,5 +10,9 @@ include_directories(docker_tune PUBLIC - ${LIB_KPERF_INCPATH} - ) - -+if (WITH_ASAN) -+ enable_asan(docker_tune) -+endif() -+ - set_target_properties(docker_tune PROPERTIES -- LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -\ No newline at end of file -+ LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) -diff --git a/src/plugin/tune/system/CMakeLists.txt b/src/plugin/tune/system/CMakeLists.txt -index 8beeb4d..8f8d0a2 100644 ---- a/src/plugin/tune/system/CMakeLists.txt -+++ b/src/plugin/tune/system/CMakeLists.txt -@@ -1,13 +1,5 @@ --cmake_minimum_required(VERSION 3.11) - project(system_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra) -- - add_subdirectory(cpu/stealtask_tune) - add_subdirectory(network/smc_tune) - add_subdirectory(xcall) -@@ -16,6 +8,9 @@ add_subdirectory(power/seep_tune) - add_library(system_tune SHARED - system_tune.cpp) - -+if (WITH_ASAN) -+ enable_asan(system_tune) -+endif() - target_link_libraries(system_tune stealtask_tune smc_tune xcall_tune seep_tune) - - set_target_properties(system_tune PROPERTIES -diff --git a/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt b/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt -index c311a01..9413716 100644 ---- a/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt -+++ b/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt -@@ -1,13 +1,6 @@ - cmake_minimum_required(VERSION 3.11) - project(stealtask_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra) -- - add_library(stealtask_tune STATIC - stealtask_tune.cpp - ) -diff --git a/src/plugin/tune/system/network/smc_tune/CMakeLists.txt b/src/plugin/tune/system/network/smc_tune/CMakeLists.txt -index 29bd449..6c81aff 100644 ---- a/src/plugin/tune/system/network/smc_tune/CMakeLists.txt -+++ b/src/plugin/tune/system/network/smc_tune/CMakeLists.txt -@@ -1,13 +1,5 @@ --cmake_minimum_required(VERSION 3.11) - project(smc_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra -Wno-unused-value -Wno-missing-field-initializers) -- - include_directories(/usr/include/libnl3) - - add_subdirectory(kprobe) -diff --git a/src/plugin/tune/system/network/smc_tune/kprobe/CMakeLists.txt b/src/plugin/tune/system/network/smc_tune/kprobe/CMakeLists.txt -index 5eb787a..e737eb6 100644 ---- a/src/plugin/tune/system/network/smc_tune/kprobe/CMakeLists.txt -+++ b/src/plugin/tune/system/network/smc_tune/kprobe/CMakeLists.txt -@@ -1,5 +1,3 @@ --cmake_minimum_required(VERSION 3.10) -- - # set module name - project(smc_acc) - -diff --git a/src/plugin/tune/system/power/seep_tune/CMakeLists.txt b/src/plugin/tune/system/power/seep_tune/CMakeLists.txt -index 92fb91b..080ff6a 100644 ---- a/src/plugin/tune/system/power/seep_tune/CMakeLists.txt -+++ b/src/plugin/tune/system/power/seep_tune/CMakeLists.txt -@@ -1,13 +1,5 @@ --cmake_minimum_required(VERSION 3.11) - project(seep_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra) -- - add_library(seep_tune STATIC - seep_tune.cpp - ) -diff --git a/src/plugin/tune/system/xcall/CMakeLists.txt b/src/plugin/tune/system/xcall/CMakeLists.txt -index 815a96e..d00f7c2 100644 ---- a/src/plugin/tune/system/xcall/CMakeLists.txt -+++ b/src/plugin/tune/system/xcall/CMakeLists.txt -@@ -1,13 +1,5 @@ --cmake_minimum_required(VERSION 3.11) - project(xcall_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra -Wno-unused-value -Wno-missing-field-initializers) -- - add_library(xcall_tune STATIC - xcall_tune.cpp - ) -diff --git a/src/plugin/tune/unixbench/CMakeLists.txt b/src/plugin/tune/unixbench/CMakeLists.txt -index dd6e934..55c34dd 100644 ---- a/src/plugin/tune/unixbench/CMakeLists.txt -+++ b/src/plugin/tune/unixbench/CMakeLists.txt -@@ -1,18 +1,15 @@ --cmake_minimum_required(VERSION 3.11) - project(ub_tune) - --if (WITH_DEBUG) -- add_compile_options(-g) --else() -- add_compile_options(-O2) --endif() --add_compile_options(-fPIC -Wall -Wextra) -- - add_library(ub_tune SHARED - ub_tune.cpp - ) - - target_link_libraries(ub_tune numa) -+ -+if (WITH_ASAN) -+ enable_asan(ub_tune) -+endif() -+ - set_target_properties(ub_tune PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY}) - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/ub_tune.conf" -diff --git a/src/plugin_mgr/CMakeLists.txt b/src/plugin_mgr/CMakeLists.txt -index a3f9dd1..90e410b 100644 ---- a/src/plugin_mgr/CMakeLists.txt -+++ b/src/plugin_mgr/CMakeLists.txt -@@ -1,12 +1,5 @@ --cmake_minimum_required (VERSION 3.16) - project(oeAware-server) - --SET(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now -Wall -Wextra -O2") -- --if("${OEAWARE_DEBUG}" EQUAL 1) --add_definitions(-DOEAWARE_DEBUG) --endif() -- - aux_source_directory(. SOURCE) - aux_source_directory(event EVENT_SOURCE) - include_directories(/usr/include) -@@ -20,6 +13,11 @@ add_executable (oeaware - ${EVENT_SOURCE} - ) - target_link_libraries(oeaware common) -+ -+if (WITH_ASAN) -+ enable_asan(oeaware) -+endif() -+ - if (${CMAKE_CXX_COMPILER_VERSION} LESS "10.3.1") - target_link_libraries(oeaware -lpthread -ldl) - endif() -diff --git a/src/sdk/CMakeLists.txt b/src/sdk/CMakeLists.txt -index e362a1a..a6385aa 100644 ---- a/src/sdk/CMakeLists.txt -+++ b/src/sdk/CMakeLists.txt -@@ -1,12 +1,15 @@ --cmake_minimum_required (VERSION 3.16) - project(oeaware-sdk) - - aux_source_directory(. SOURCE) --SET(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now -Wall -Wextra -fPIC -O2") - - add_library(${PROJECT_NAME} SHARED - oe_client.cpp - ) -+ -+if (WITH_ASAN) -+ enable_asan(${PROJECT_NAME}) -+endif() -+ - target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/include) - target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/common) - target_link_libraries(${PROJECT_NAME} common) -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 2a6afcd..11aa06d 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -1,7 +1,5 @@ --cmake_minimum_required(VERSION 3.16) - project(test) - set(SRC_DIR ../src) --SET(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now") - - find_package(GTest CONFIG REQUIRED) - -@@ -30,7 +28,7 @@ add_executable(utils_test - ) - - add_executable(data_register_test -- data_register_test -+ data_register_test.cpp - ) - - target_link_libraries(serialize_test PRIVATE common GTest::gtest_main) --- -2.33.0 - diff --git a/0007-fix-build-script.patch b/0007-fix-build-script.patch deleted file mode 100644 index a6e1703..0000000 --- a/0007-fix-build-script.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7db535b57513318b0f9cb5d2bd844c0e636c42f1 Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Mon, 23 Dec 2024 19:44:40 +0800 -Subject: [PATCH 3/7] fix build script - ---- - build.sh | 2 +- - src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt | 1 - - 2 files changed, 1 insertion(+), 2 deletions(-) - -diff --git a/build.sh b/build.sh -index bd99758..c47cdf8 100644 ---- a/build.sh -+++ b/build.sh -@@ -6,7 +6,7 @@ cd $script_dir/ - os_arch=$(uname -m) - libkperf_version="v1.2.1" # only for build_kperf_by_src=ON - build_kperf_by_src="ON" --build_test="OFF" -+with_test="OFF" - with_debug="OFF" - with_asan="OFF" - with_optimization="OFF" -diff --git a/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt b/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt -index 9413716..10b6d9b 100644 ---- a/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt -+++ b/src/plugin/tune/system/cpu/stealtask_tune/CMakeLists.txt -@@ -1,4 +1,3 @@ --cmake_minimum_required(VERSION 3.11) - project(stealtask_tune) - - add_library(stealtask_tune STATIC --- -2.33.0 - diff --git a/0008-fix-memory-leak-plugin-type.patch b/0008-fix-memory-leak-plugin-type.patch deleted file mode 100644 index 0ba137a..0000000 --- a/0008-fix-memory-leak-plugin-type.patch +++ /dev/null @@ -1,279 +0,0 @@ -From 5a961d309e0286d23f196e7afeab486a74bd09da Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Wed, 25 Dec 2024 15:19:15 +0800 -Subject: [PATCH 4/7] fix memory leak, plugin type - ---- - src/common/data_register.cpp | 1 + - src/common/data_register.h | 2 +- - src/plugin/collect/docker/docker_adapt.cpp | 15 +++++++-------- - src/plugin/collect/docker/docker_adapt.h | 2 +- - src/plugin/collect/pmu/pmu_common.cpp | 2 ++ - src/plugin/collect/pmu/pmu_counting_collector.cpp | 3 ++- - src/plugin/collect/pmu/pmu_sampling_collector.cpp | 3 ++- - src/plugin/collect/pmu/pmu_uncore.cpp | 2 +- - src/plugin/collect/pmu/pmu_uncore_collector.cpp | 1 + - src/plugin/collect/system/thread_collector.cpp | 5 +++++ - src/plugin/tune/docker/cpu_burst.cpp | 12 ++++++------ - src/plugin/tune/docker/cpu_burst_adapt.cpp | 2 +- - src/plugin/tune/unixbench/ub_tune.cpp | 1 + - 13 files changed, 31 insertions(+), 20 deletions(-) - -diff --git a/src/common/data_register.cpp b/src/common/data_register.cpp -index df64ba5..f93556a 100644 ---- a/src/common/data_register.cpp -+++ b/src/common/data_register.cpp -@@ -152,6 +152,7 @@ void PmuBaseDataFree(void *data) - PmuDataFree(tmpData->pmuData); - tmpData->pmuData = nullptr; - tmpData->len = 0; -+ delete tmpData; - } - - int PmuCountingDataSerialize(const void *data, OutStream &out) -diff --git a/src/common/data_register.h b/src/common/data_register.h -index 2804ef5..477811e 100644 ---- a/src/common/data_register.h -+++ b/src/common/data_register.h -@@ -21,7 +21,7 @@ using SerializeFunc = int(*)(const void*, OutStream &out); - using DataFreeFunc = void(*)(void *); - - struct RegisterEntry { -- RegisterEntry() { } -+ RegisterEntry() : se(nullptr), de(nullptr), free(nullptr) { } - RegisterEntry(const SerializeFunc &se, const DeserializeFunc &de) : se(se), de(de), free(nullptr) { } - RegisterEntry(const SerializeFunc &se, const DeserializeFunc &de, const DataFreeFunc &free) : se(se), - de(de), free(free) { } -diff --git a/src/plugin/collect/docker/docker_adapt.cpp b/src/plugin/collect/docker/docker_adapt.cpp -index eab3270..1105db2 100644 ---- a/src/plugin/collect/docker/docker_adapt.cpp -+++ b/src/plugin/collect/docker/docker_adapt.cpp -@@ -45,6 +45,7 @@ DockerAdapt::DockerAdapt() - version = "1.0.0"; - period = PERIOD; - priority = PRIORITY; -+ type = 0; - - oeaware::Topic topic; - topic.instanceName = this->name; -@@ -97,7 +98,7 @@ void DockerAdapt::Run() - dataList.data = new void* [containers.size()]; - uint64_t i = 0; - for (auto &it : containers) { -- dataList.data[i++] = it.second; -+ dataList.data[i++] = &it.second; - } - dataList.len = i; - Publish(dataList); -@@ -108,8 +109,6 @@ void DockerAdapt::DockerUpdate(const std::unordered_set &directorie - // delete non-existent container - for (auto it = containers.begin(); it != containers.end();) { - if (directories.find(it->first) == directories.end()) { -- delete it->second; -- it->second = nullptr; - it = containers.erase(it); - } else { - ++it; -@@ -123,11 +122,11 @@ void DockerAdapt::DockerUpdate(const std::unordered_set &directorie - read_success &= GetContainersInfo(tmp.cfs_quota_us, dir, "cpu.cfs_quota_us"); - read_success &= GetContainersInfo(tmp.cfs_burst_us, dir, "cpu.cfs_burst_us"); - if (read_success) { -- Container* container = new Container(); -- container->cfs_period_us = tmp.cfs_period_us; -- container->cfs_quota_us = tmp.cfs_quota_us; -- container->cfs_burst_us = tmp.cfs_burst_us; -- container->id = dir; -+ Container container; -+ container.cfs_period_us = tmp.cfs_period_us; -+ container.cfs_quota_us = tmp.cfs_quota_us; -+ container.cfs_burst_us = tmp.cfs_burst_us; -+ container.id = dir; - containers[dir] = container; - } - } -diff --git a/src/plugin/collect/docker/docker_adapt.h b/src/plugin/collect/docker/docker_adapt.h -index 570a2a7..9db9c00 100644 ---- a/src/plugin/collect/docker/docker_adapt.h -+++ b/src/plugin/collect/docker/docker_adapt.h -@@ -33,6 +33,6 @@ private: - void DockerUpdate(const std::unordered_set &sub_dir); - void DockerCollect(); - bool openStatus = false; -- std::unordered_map containers; -+ std::unordered_map containers; - }; - #endif // OEAWARE_MANAGER_DOCKER_ADAPT_H -\ No newline at end of file -diff --git a/src/plugin/collect/pmu/pmu_common.cpp b/src/plugin/collect/pmu/pmu_common.cpp -index caf453a..28c71f0 100644 ---- a/src/plugin/collect/pmu/pmu_common.cpp -+++ b/src/plugin/collect/pmu/pmu_common.cpp -@@ -26,8 +26,10 @@ bool IsSupportPmu() - while (dent = readdir(dir)) { - std::string armPmuPath = DEVICES_PATH + dent->d_name + "/cpus"; - if (oeaware::FileExist(armPmuPath)) { -+ closedir(dir); - return true; - } - } -+ closedir(dir); - return false; - } -diff --git a/src/plugin/collect/pmu/pmu_counting_collector.cpp b/src/plugin/collect/pmu/pmu_counting_collector.cpp -index 281c61d..2b6c0b5 100644 ---- a/src/plugin/collect/pmu/pmu_counting_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_counting_collector.cpp -@@ -62,6 +62,7 @@ int PmuCountingCollector::OpenCounting(const oeaware::Topic &topic) - errno_t ret = strcpy_s(evtList[0], topic.topicName.length() + 1, topic.topicName.c_str()); - if (ret != EOK) { - std::cout << topic.topicName << " open failed, reason: strcpy_s failed" << std::endl; -+ delete[] evtList[0]; - return -1; - } - attr.evtList = evtList; -@@ -71,7 +72,7 @@ int PmuCountingCollector::OpenCounting(const oeaware::Topic &topic) - if (pd == -1) { - std::cout << topic.topicName << " open failed" << std::endl; - } -- -+ delete[] evtList[0]; - return pd; - } - -diff --git a/src/plugin/collect/pmu/pmu_sampling_collector.cpp b/src/plugin/collect/pmu/pmu_sampling_collector.cpp -index b4cf037..6d4712e 100644 ---- a/src/plugin/collect/pmu/pmu_sampling_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_sampling_collector.cpp -@@ -60,6 +60,7 @@ int PmuSamplingCollector::OpenSampling(const oeaware::Topic &topic) - errno_t ret = strcpy_s(evtList[0], topic.topicName.length() + 1, topic.topicName.c_str()); - if (ret != EOK) { - std::cout << topic.topicName << " open failed, reason: strcpy_s failed" << std::endl; -+ delete[] evtList[0]; - return -1; - } - attr.evtList = evtList; -@@ -75,7 +76,7 @@ int PmuSamplingCollector::OpenSampling(const oeaware::Topic &topic) - if (pd == -1) { - std::cout << topic.topicName << " open failed" << std::endl; - } -- -+ delete[] evtList[0]; - return pd; - } - -diff --git a/src/plugin/collect/pmu/pmu_uncore.cpp b/src/plugin/collect/pmu/pmu_uncore.cpp -index cf46121..66a6bf3 100644 ---- a/src/plugin/collect/pmu/pmu_uncore.cpp -+++ b/src/plugin/collect/pmu/pmu_uncore.cpp -@@ -128,7 +128,7 @@ int HhaUncoreConfigInit(void) - static void UncoreConfigFree(UncoreConfig *config) - { - if (config != nullptr) { -- delete config; -+ delete[] config; - config = nullptr; - } - } -diff --git a/src/plugin/collect/pmu/pmu_uncore_collector.cpp b/src/plugin/collect/pmu/pmu_uncore_collector.cpp -index 74c2901..3a2571f 100644 ---- a/src/plugin/collect/pmu/pmu_uncore_collector.cpp -+++ b/src/plugin/collect/pmu/pmu_uncore_collector.cpp -@@ -145,6 +145,7 @@ void PmuUncoreCollector::CloseTopic(const oeaware::Topic &topic) - } - PmuDisable(pmuId); - PmuClose(pmuId); -+ UncoreConfigFini(); - pmuId = -1; - } - -diff --git a/src/plugin/collect/system/thread_collector.cpp b/src/plugin/collect/system/thread_collector.cpp -index 10dfd27..f3439b6 100644 ---- a/src/plugin/collect/system/thread_collector.cpp -+++ b/src/plugin/collect/system/thread_collector.cpp -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include "data_register.h" - - ThreadCollector::ThreadCollector() - { -@@ -28,6 +29,7 @@ ThreadCollector::ThreadCollector() - version = "1.0.0"; - period = 500; - priority = 0; -+ type = 0; - oeaware::Topic topic; - topic.instanceName = this->name; - topic.topicName = this->name; -@@ -61,6 +63,9 @@ oeaware::Result ThreadCollector::Enable(const std::string ¶m) - void ThreadCollector::Disable() - { - openStatus = false; -+ for (auto &item : threads) { -+ oeaware::Register::GetInstance().GetDataFreeFunc(OE_THREAD_COLLECTOR)(item.second); -+ } - } - - void ThreadCollector::Run() -diff --git a/src/plugin/tune/docker/cpu_burst.cpp b/src/plugin/tune/docker/cpu_burst.cpp -index c351684..6c100b7 100644 ---- a/src/plugin/tune/docker/cpu_burst.cpp -+++ b/src/plugin/tune/docker/cpu_burst.cpp -@@ -91,10 +91,10 @@ void CpuBurst::UpdatePmu(const DataList &dataList) - - void CpuBurst::UpdateDocker(const DataList &dataList) - { -- std::unordered_map collector; -+ std::unordered_map collector; - for (uint64_t i = 0; i < dataList.len; i++) { - auto *tmp = (Container*)dataList.data[i]; -- collector[tmp->id] = tmp; -+ collector[tmp->id] = *tmp; - } - - for (const auto &container : collector) { -@@ -102,11 +102,11 @@ void CpuBurst::UpdateDocker(const DataList &dataList) - const auto &container_info = container.second; - if (containers.find(id) == containers.end()) { - containers[id].id = id; -- containers[id].cfs_burst_us_ori = container_info->cfs_burst_us; -+ containers[id].cfs_burst_us_ori = container_info.cfs_burst_us; - } -- containers[id].cfs_period_us = container_info->cfs_period_us; -- containers[id].cfs_quota_us = container_info->cfs_quota_us; -- containers[id].cfs_burst_us = container_info->cfs_burst_us; -+ containers[id].cfs_period_us = container_info.cfs_period_us; -+ containers[id].cfs_quota_us = container_info.cfs_quota_us; -+ containers[id].cfs_burst_us = container_info.cfs_burst_us; - } - - // remove containers -diff --git a/src/plugin/tune/docker/cpu_burst_adapt.cpp b/src/plugin/tune/docker/cpu_burst_adapt.cpp -index 822e0c5..0454b00 100644 ---- a/src/plugin/tune/docker/cpu_burst_adapt.cpp -+++ b/src/plugin/tune/docker/cpu_burst_adapt.cpp -@@ -27,7 +27,7 @@ CpuBurstAdapt::CpuBurstAdapt() - version = "1.0.0"; - period = PERIOD; - priority = PRIORITY; -- -+ type = oeaware::TUNE; - oeaware::Topic topic; - topic.instanceName = this->name; - topic.topicName = this->name; -diff --git a/src/plugin/tune/unixbench/ub_tune.cpp b/src/plugin/tune/unixbench/ub_tune.cpp -index a72e8e9..f71f226 100644 ---- a/src/plugin/tune/unixbench/ub_tune.cpp -+++ b/src/plugin/tune/unixbench/ub_tune.cpp -@@ -28,6 +28,7 @@ UnixBenchTune::UnixBenchTune() { - version = "1.0.0"; - period = 500; - priority = 2; -+ type = TUNE; - depTopic.instanceName = "thread_collector"; - depTopic.topicName = "thread_collector"; - } --- -2.33.0 - diff --git a/0009-every-sdk-process-use-diff-sock.patch b/0009-every-sdk-process-use-diff-sock.patch deleted file mode 100644 index 6e1aeeb..0000000 --- a/0009-every-sdk-process-use-diff-sock.patch +++ /dev/null @@ -1,45 +0,0 @@ -From b09067a9ecc9e9dea32244b99a5e65eb666f3567 Mon Sep 17 00:00:00 2001 -From: LHesperus <2639350497@qq.com> -Date: Thu, 26 Dec 2024 17:31:47 +0800 -Subject: [PATCH 5/7] every sdk process use diff sock - ---- - src/common/domain_socket.cpp | 1 + - src/sdk/oe_client.cpp | 3 ++- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/common/domain_socket.cpp b/src/common/domain_socket.cpp -index 57d8a55..8610cad 100644 ---- a/src/common/domain_socket.cpp -+++ b/src/common/domain_socket.cpp -@@ -78,5 +78,6 @@ void DomainSocket::Close() - { - close(sock); - sock = 0; -+ unlink(localPath.c_str()); - } - } -diff --git a/src/sdk/oe_client.cpp b/src/sdk/oe_client.cpp -index 9f24b27..55c9750 100644 ---- a/src/sdk/oe_client.cpp -+++ b/src/sdk/oe_client.cpp -@@ -88,6 +88,7 @@ void Impl::HandleRecv() - } - int Impl::Init() - { -+ pid_t pid = getpid(); - auto home = getenv("HOME"); - std::string homeDir; - if (home == nullptr) { -@@ -100,7 +101,7 @@ int Impl::Init() - CreateDir(homeDir); - isQuit = false; - finished = false; -- domainSocket = std::make_shared(homeDir + "/oeaware-sdk.sock"); -+ domainSocket = std::make_shared(homeDir + "/oeaware-sdk-" + std::to_string(pid) + ".sock"); - domainSocket->SetRemotePath(DEFAULT_SERVER_LISTEN_PATH); - resultQueue = std::make_shared>(); - int sock = domainSocket->Socket(); --- -2.33.0 - diff --git a/0010-fix-enable_list-load-error.patch b/0010-fix-enable_list-load-error.patch deleted file mode 100644 index 7ad0f07..0000000 --- a/0010-fix-enable_list-load-error.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b31b9d602bba1f43f3f6137a4e2707bd425bf2e5 Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Fri, 27 Dec 2024 23:17:08 +0800 -Subject: [PATCH 6/7] fix enable_list load error - ---- - src/plugin_mgr/config.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/plugin_mgr/config.cpp b/src/plugin_mgr/config.cpp -index 0ac1fb0..4553c93 100644 ---- a/src/plugin_mgr/config.cpp -+++ b/src/plugin_mgr/config.cpp -@@ -61,13 +61,13 @@ void Config::SetEnableList(const YAML::Node &node) - std::string pluginName = enableList[i]["name"].as(); - YAML::Node instances = enableList[i]["instances"]; - EnableItem enableItem(pluginName); -- if (!instances.IsSequence()) { -- WARN(logger, "the format of the enable list is incorrect."); -- continue; -- } - if (!instances.IsDefined() || instances.IsNull()) { - enableItem.SetEnabled(true); - } else { -+ if (!instances.IsSequence()) { -+ WARN(logger, "the format of the enable list{" << pluginName << "} is incorrect."); -+ continue; -+ } - for (size_t j = 0; j < instances.size(); ++j) { - std::string instanceName = instances[j].as(); - enableItem.AddInstance(instanceName); --- -2.33.0 - diff --git a/0011-fix-instance-nullptr.patch b/0011-fix-instance-nullptr.patch deleted file mode 100644 index 9e7765d..0000000 --- a/0011-fix-instance-nullptr.patch +++ /dev/null @@ -1,49 +0,0 @@ -From b1aac403051ca84e8e083359f981dec887805b6c Mon Sep 17 00:00:00 2001 -From: fly_1997 -Date: Sat, 28 Dec 2024 00:34:14 +0800 -Subject: [PATCH 7/7] fix instance nullptr - ---- - src/plugin_mgr/instance_run_handler.cpp | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/src/plugin_mgr/instance_run_handler.cpp b/src/plugin_mgr/instance_run_handler.cpp -index c38e9ea..a253119 100644 ---- a/src/plugin_mgr/instance_run_handler.cpp -+++ b/src/plugin_mgr/instance_run_handler.cpp -@@ -19,6 +19,10 @@ constexpr int INSTANCE_RUN_ALWAYS = 1; - - Result InstanceRunHandler::EnableInstance(const std::string &name) - { -+ if (!memoryStore->IsInstanceExist(name)) { -+ WARN(logger, "instance {" << name << "} does not exist."); -+ return Result(FAILED, "instance {" + name + "} does not exist."); -+ } - auto instance = memoryStore->GetInstance(name); - auto result = instance->interface->Enable(); - if (result.code < 0) { -@@ -40,6 +44,10 @@ Result InstanceRunHandler::EnableInstance(const std::string &name) - - void InstanceRunHandler::DisableInstance(const std::string &name) - { -+ if (!memoryStore->IsInstanceExist(name)) { -+ WARN(logger, "instance {" << name << "} does not exist."); -+ return; -+ } - auto instance = memoryStore->GetInstance(name); - instance->enabled = false; - instance->interface->Disable(); -@@ -49,6 +57,10 @@ void InstanceRunHandler::DisableInstance(const std::string &name) - Result InstanceRunHandler::Subscribe(const std::vector &payload) - { - Topic topic = Topic::GetTopicFromType(payload[0]); -+ if (!memoryStore->IsInstanceExist(topic.instanceName)) { -+ WARN(logger, "instance {" << topic.instanceName << "} does not exist."); -+ return Result(FAILED, "instance {" + topic.instanceName + "} does not exist."); -+ } - Result result; - constexpr int subscriberIndex = 1; - auto instance = memoryStore->GetInstance(topic.instanceName); --- -2.33.0 - diff --git a/oeAware-manager-v2.0.1.tar.gz b/oeAware-manager-v2.0.1.tar.gz deleted file mode 100644 index efff6bf..0000000 Binary files a/oeAware-manager-v2.0.1.tar.gz and /dev/null differ diff --git a/oeAware-manager-v2.0.2.tar.gz b/oeAware-manager-v2.0.2.tar.gz new file mode 100644 index 0000000..2d2dabe Binary files /dev/null and b/oeAware-manager-v2.0.2.tar.gz differ diff --git a/oeAware-manager.spec b/oeAware-manager.spec index 01d009d..9c9fb59 100644 --- a/oeAware-manager.spec +++ b/oeAware-manager.spec @@ -1,21 +1,11 @@ Name: oeAware-manager -Version: v2.0.1 -Release: 3 +Version: v2.0.2 +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-change-the-folder-permission-to-755-add-oeaware-grou.patch -Patch2: 0002-docker_cpu_burst-instance-add-unsubscribe-topics.patch -Patch3: 0003-add-pmu-check.patch -Patch4: 0004-fix-smc_tune-type.patch -Patch5: 0005-modify-the-method-of-obtaining-cpu-frequency.patch -Patch6: 0006-update-compilation-options.patch -Patch7: 0007-fix-build-script.patch -Patch8: 0008-fix-memory-leak-plugin-type.patch -Patch9: 0009-every-sdk-process-use-diff-sock.patch -Patch10: 0010-fix-enable_list-load-error.patch -Patch11: 0011-fix-instance-nullptr.patch +Patch1: 0001-convert-preload_tune-from-dynamic-library-to-static-.patch BuildRequires: cmake make gcc-c++ BuildRequires: boost-devel @@ -59,6 +49,8 @@ sh build.sh -k --release 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 @@ -97,6 +89,8 @@ fi %attr(0750, root, root) %{_bindir}/oeaware %attr(0750, root, root) %{_bindir}/oeawarectl %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(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 @@ -110,6 +104,11 @@ fi %attr(0644, root, root) %{_includedir}/oeaware/data/*.h %changelog +* Mon Feb 24 2025 fly_1997 -v2.0.2-1 +- add hugepage detection report +- add transparent hugepage, preload tune instances +- add plugin info + * Mon Dec 30 2024 fly_1997 -v2.0.1-3 - fix config load error - fix memory leak