44 lines
1.5 KiB
Diff
44 lines
1.5 KiB
Diff
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
|
|
|