Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ef0e3d961d
!79 [sync] PR-74: update libkperf version to v1.0.5, to solve the perf cycles error
From: @openeuler-sync-bot 
Reviewed-by: @ksana123 
Signed-off-by: @ksana123
2024-09-11 02:37:14 +00:00
LHesperus
41e4daf74c update libkperf version to v1.0.5, to solve the perf cycles error
(cherry picked from commit f9b3b0f8de9fdd57e114caf08789b7c1c57958ad)
2024-09-10 16:13:56 +08:00
openeuler-ci-bot
84769d6280
!75 [sync] PR-73: adapt for 4.19 kernel
From: @openeuler-sync-bot 
Reviewed-by: @ksana123 
Signed-off-by: @ksana123
2024-09-10 07:51:14 +00:00
LHesperus
b9547ccab2 adapt for 4.19 kernel
(cherry picked from commit bc513f2b237cbfcc6021f6772af7fa93b4918a95)
2024-09-10 15:30:28 +08:00
openeuler-ci-bot
62ee67b511
!70 [sync] PR-69: fix pmu cmake build option error
From: @openeuler-sync-bot 
Reviewed-by: @ksana123 
Signed-off-by: @ksana123
2024-07-16 12:26:55 +00:00
fly_1997
88efdecdb1 fix pmu cmake build option error
(cherry picked from commit e197d8afbcb1f9f77578515c6fa8d2d3cde601c8)
2024-07-16 20:02:35 +08:00
openeuler-ci-bot
87e271766a
!67 [sync] PR-61: spec: explicit add libboundscheck as Requires
From: @openeuler-sync-bot 
Reviewed-by: @ksana123 
Signed-off-by: @ksana123
2024-07-16 12:01:50 +00:00
Zhao Mengmeng
973513f45b spec: explicit add libboundscheck as Requires
On Kylin HostOS V10, which is a system based on openEuler 22.03 SP2,
after installing oeAware-collector and oeAware-manager, there are
following error in log:

07/10/24 10:53:25 [281473133831296] WARN  oeAware - [PluginManager]
libpmu.so plugin preload failed, because plugin dlopen failed.

The reason is missing libboundscheck. Besides libboundscheck, there
is another package itrustee_client providing libboundscheck.so,
which may confuse yum/dnf, As a result, libboundscheck will not be
installed automatically.

Fix this by explicit add libbounscheck.

(cherry picked from commit c970ef35087f38fb671a41f03cd1edfc3381b131)
2024-07-16 15:55:15 +08:00
openeuler-ci-bot
0671364f6e
!63 [sync] PR-62: fix out of bounds array
From: @openeuler-sync-bot 
Reviewed-by: @ksana123 
Signed-off-by: @ksana123
2024-07-16 06:44:28 +00:00
fly_1997
cee0c62878 fix out of bounds array
(cherry picked from commit 42b86f9808f55e6532dd2a6686f20eaa14f8f3c1)
2024-07-16 09:40:31 +08:00
3 changed files with 100 additions and 3 deletions

View File

@ -0,0 +1,55 @@
From 341bd6e8292b96ff5cf02bbaeedf447df18778aa Mon Sep 17 00:00:00 2001
From: fly_1997 <flylove7@outlook.com>
Date: Mon, 15 Jul 2024 14:03:39 +0800
Subject: [PATCH] fix out of bounds array
---
thread_collector/thread_collector.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/thread_collector/thread_collector.cpp b/thread_collector/thread_collector.cpp
index f1d9cc4..cb99bba 100644
--- a/thread_collector/thread_collector.cpp
+++ b/thread_collector/thread_collector.cpp
@@ -11,8 +11,10 @@
******************************************************************************/
#include "interface.h"
#include "thread_info.h"
+#include <iostream>
#include <string>
#include <vector>
+#include <fstream>
#include <unordered_map>
#include <csignal>
#include <dirent.h>
@@ -20,7 +22,6 @@
char thread_name[] = "thread_collector";
const int CYCLE_SIZE = 500;
-const int MAX_NAME_LENGTH = 20;
static DataRingBuf ring_buf;
static DataBuf data_buf;
static ThreadInfo threads[THREAD_NUM];
@@ -60,14 +61,13 @@ static void clear_invalid_tid(int &num) {
static ThreadInfo get_thread_info(int pid, int tid) {
std::string s_path = "/proc/" + std::to_string(pid) + "/task/" + std::to_string(tid) + "/comm";
- FILE *s_file = fopen(s_path.c_str(), "r");
- if (s_file == nullptr) {
+ std::ifstream input_file(s_path);
+ if (!input_file) {
return ThreadInfo{};
}
- char name[MAX_NAME_LENGTH];
- fscanf(s_file, "%s", name);
- fclose(s_file);
- return ThreadInfo{pid, tid, std::string(name)};
+ std::string name;
+ input_file >> name;
+ return ThreadInfo{pid, tid, name};
}
static bool process_not_change(struct stat *task_stat, const std::string &task_path, int pid) {
--
2.33.0

View File

@ -0,0 +1,24 @@
From 6c15574bb42decac738b54813b79a0f0fd138998 Mon Sep 17 00:00:00 2001
From: LHesperus <2639350497@qq.com>
Date: Tue, 6 Aug 2024 11:05:25 +0800
Subject: [PATCH] adapt for 4.19 kernel
---
thread_collector/thread_collector.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/thread_collector/thread_collector.cpp b/thread_collector/thread_collector.cpp
index cb99bba..7c6f36f 100644
--- a/thread_collector/thread_collector.cpp
+++ b/thread_collector/thread_collector.cpp
@@ -19,6 +19,7 @@
#include <csignal>
#include <dirent.h>
#include <sys/stat.h>
+#include <unistd.h>
char thread_name[] = "thread_collector";
const int CYCLE_SIZE = 500;
--
2.45.2.windows.1

View File

@ -1,6 +1,6 @@
Name: oeAware-collector Name: oeAware-collector
Version: v1.0.2 Version: v1.0.2
Release: 6 Release: 11
Summary: %{name} provides low-overhead metrics collection capabilities, including microarchitecture, system, and kernel information. Summary: %{name} provides low-overhead metrics collection capabilities, including microarchitecture, system, and kernel information.
License: MulanPSL2 License: MulanPSL2
URL: https://gitee.com/openeuler/%{name} URL: https://gitee.com/openeuler/%{name}
@ -8,15 +8,18 @@ Source0: %{name}-%{version}.tar.gz
Patch1: 0001-add-netif_rx-counting-pmu-instance.patch Patch1: 0001-add-netif_rx-counting-pmu-instance.patch
Patch2: 0002-reduce-thread-collector-load.patch Patch2: 0002-reduce-thread-collector-load.patch
Patch3: 0003-fix-uninitialized-PmuAttr-attr.patch Patch3: 0003-fix-uninitialized-PmuAttr-attr.patch
Patch4: 0004-fix-out-of-bounds-array.patch
Patch5: 0005-adapt-for-4.19-kernel.patch
%global libkperf_name libkperf %global libkperf_name libkperf
%global libkperf_tagver v1.0.4 %global libkperf_tagver v1.0.5
%global libkperf_source https://gitee.com/openeuler/libkperf.git %global libkperf_source https://gitee.com/openeuler/libkperf.git
BuildRequires: cmake gcc-c++ BuildRequires: cmake gcc-c++
BuildRequires: numactl-devel BuildRequires: numactl-devel
BuildRequires: git BuildRequires: git
BuildRequires: libboundscheck BuildRequires: libboundscheck
Requires: libboundscheck
Provides: %{name} Provides: %{name}
ExclusiveArch: aarch64 x86_64 ExclusiveArch: aarch64 x86_64
@ -53,7 +56,7 @@ mkdir build
cd build cd build
cmake .. -DLIB_KPERF_LIBPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/bin/ \ cmake .. -DLIB_KPERF_LIBPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/bin/ \
-DLIB_KPERF_INCPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/include/ \ -DLIB_KPERF_INCPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/include/ \
-DCMAKE_SKIP_RPATH=TRUE -WITH_DEBUG=TRUE -DCMAKE_SKIP_RPATH=TRUE -DWITH_DEBUG=TRUE
make make
%endif %endif
@ -83,6 +86,21 @@ install -b -m740 ./thread_collector/build/libthread_collector.so ${RPM_BUIL
%attr(0440, root, root) %{_libdir}/oeAware-plugin/libthread_collector.so %attr(0440, root, root) %{_libdir}/oeAware-plugin/libthread_collector.so
%changelog %changelog
* Tue Sep 10 2024 liuchanggeng <liuchanggeng@huawei.com> - v1.0.2-11
- update libkperf version to v1.0.5, to solve the perf cycles error
* Tue Aug 6 2024 liuchanggeng <liuchanggeng@huawei.com> - v1.0.2-10
- adapt for 4.19 kernel
* Tue Jul 16 2024 fly_1997 <flylove7@outlook.com> - v1.0.2-9
- fix pmu cmake build option error
* Tue Jul 16 2024 Zhao Mengmeng <zhaomengmeng@kylinos.cn> - v1.0.2-8
- explicit add libboundscheck as Requires
* Mon Jul 15 2024 fly_1997 <flylove7@outlook.com> - v1.0.2-7
- fix out of bounds array
* Fri Jul 5 2024 zhoukaiqi <zhoukaiqi@huawei.com> - v1.0.2-6 * Fri Jul 5 2024 zhoukaiqi <zhoukaiqi@huawei.com> - v1.0.2-6
- fix uninitialized PmuAttr attr - fix uninitialized PmuAttr attr