Projects
Eulaceura:Mainline:GA
dim
_service:obs_scm:backport-Try-to-add-the-absolu...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-Try-to-add-the-absolute-path-of-process-in-static-ba.patch of Package dim
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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2