1 Star 0 Fork 11

jinlun/dim_9

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Try-to-add-the-absolute-path-of-process-in-static-ba.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
hugel 提交于 2024-08-19 14:46 +08:00 . fix some bugs and enabled DIM_HASH_SUPPORT_SM3
From 3c7a97428e8605ddcd12f7928f590d6f89d664f8 Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Sun, 5 May 2024 11:43:10 +0800
Subject: [PATCH 06/28] Try to add the absolute path of process in static
baseline
Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
---
.../static_baseline/dim_core_static_baseline.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/core/static_baseline/dim_core_static_baseline.c b/src/core/static_baseline/dim_core_static_baseline.c
index e33c67c..ff05690 100644
--- a/src/core/static_baseline/dim_core_static_baseline.c
+++ b/src/core/static_baseline/dim_core_static_baseline.c
@@ -46,7 +46,23 @@ static int baseline_check_add(const char *name, int type,
struct dim_digest *digest,
struct dim_measure *m)
{
- return dim_measure_static_baseline_add(m, name, type, digest);
+ int ret = 0;
+ const char *real_path = NULL;
+
+ if (type == DIM_BASELINE_KERNEL)
+ return dim_measure_static_baseline_add(m, name, type, digest);
+
+ /* for process, try to add the absolute path */
+ ret = dim_get_absolute_path(name, &real_path);
+ if (ret < 0) {
+ dim_warn("failed to get absolute path of %s in static baeline: %d\n",
+ name, ret);
+ return dim_measure_static_baseline_add(m, name, type, digest);
+ }
+
+ ret = dim_measure_static_baseline_add(m, real_path, type, digest);
+ dim_kfree(real_path);
+ return ret;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim_9.git
git@gitee.com:jinlun123123/dim_9.git
jinlun123123
dim_9
dim_9
master

搜索帮助