已开启
UMMU-DK: log test #48
anliming-path创建于 9月29日
UMMU-DK: log test #48
已开启
共 2 个文件变更+89-1
| @@ -0,0 +1,84 @@ | |||
| 1 | +From b5143f370fdcd08feb8e1818963932bfc221c1a1 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: anliming-path <anliming1@h-partners.com> | ||
| 3 | +Date: Tue, 29 Sep 2026 18:53:46 +0800 | ||
| 4 | +Subject: [PATCH] UMMU-DK: log test | ||
| 5 | + | ||
| 6 | +driver inclusion | ||
| 7 | +category: bugfix | ||
| 8 | +bugzilla: https://atomgit.com/openeuler/libummu/issues/13 | ||
| 9 | +CVE: NA | ||
| 10 | + | ||
| 11 | +----------------------------------------------------------- | ||
| 12 | + | ||
| 13 | +log test | ||
| 14 | + | ||
| 15 | +Signed-off-by: Liming An <anliming1@h-partners.com> | ||
| 16 | +--- | ||
| 17 | + ummu_mapt.c | 29 +++++++++++++++++++++++++++++ | ||
| 18 | + 1 file changed, 29 insertions(+) | ||
| 19 | + | ||
| 20 | +diff --git a/ummu_mapt.c b/ummu_mapt.c | ||
| 21 | +index 5a34f2e..0b8c6e7 100644 | ||
| 22 | +--- a/ummu_mapt.c | ||
| 23 | ++++ b/ummu_mapt.c | ||
| 24 | +@@ -992,6 +992,9 @@ static int ummu_update_info(enum ummu_grant_op_type opt, struct ummu_mapt_info * | ||
| 25 | + | ||
| 26 | + int ummu_grant(uint32_t tid, void *data, size_t data_size, enum ummu_mapt_perm perm, struct ummu_seg_attr *seg_attr) | ||
| 27 | + { | ||
| 28 | ++ struct timespec start, end; | ||
| 29 | ++ clock_gettime(CLOCK_MONOTONIC, &start); | ||
| 30 | ++ | ||
| 31 | + struct ummu_ctx_info *ummu_ctx = get_ummu_ctx(); | ||
| 32 | + struct ummu_mapt_info *mapt_info; | ||
| 33 | + struct ummu_data_info data_info = {0}; | ||
| 34 | +@@ -1045,6 +1048,16 @@ int ummu_grant(uint32_t tid, void *data, size_t data_size, enum ummu_mapt_perm p | ||
| 35 | + (void)pthread_mutex_unlock(&ummu_ctx->ctx_mutex); | ||
| 36 | + (void)pthread_mutex_unlock(&mapt_info->mapt_mutex); | ||
| 37 | + data_info.tokenval = 0; | ||
| 38 | ++ | ||
| 39 | ++ clock_gettime(CLOCK_MONOTONIC, &end); | ||
| 40 | ++ long long start_ns = (long long)start.tv_sec * 1000000000LL + start.tv_nsec; | ||
| 41 | ++ long long end_ns = (long long)end.tv_sec * 1000000000LL + end.tv_nsec; | ||
| 42 | ++ | ||
| 43 | ++ | ||
| 44 | ++ long long elapsed_all = end_ns - start_ns; | ||
| 45 | ++ | ||
| 46 | ++ | ||
| 47 | ++ UMMU_MAPT_INFO_LOG("ummu_grant Total time = %lld, \n", elapsed_all / 1000); | ||
| 48 | + return ret; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | +@@ -1238,6 +1251,9 @@ int ummu_free_tid(uint32_t tid) | ||
| 52 | + | ||
| 53 | + int ummu_allocate_tid(struct ummu_tid_attr *tid_attr, uint32_t *tid) | ||
| 54 | + { | ||
| 55 | ++ struct timespec start, midle, end; | ||
| 56 | ++ clock_gettime(CLOCK_MONOTONIC, &start); | ||
| 57 | ++ | ||
| 58 | + struct ummu_tid_info info = {}; | ||
| 59 | + struct ummu_ctx_info *ummu_ctx = get_ummu_ctx(); | ||
| 60 | + struct ummu_mapt_info *mapt_info; | ||
| 61 | +@@ -1281,7 +1297,20 @@ int ummu_allocate_tid(struct ummu_tid_attr *tid_attr, uint32_t *tid) | ||
| 62 | + } | ||
| 63 | + (void)pthread_mutex_unlock(&ummu_ctx->ctx_mutex); | ||
| 64 | + *tid = info.tid; | ||
| 65 | ++ clock_gettime(CLOCK_MONOTONIC, &midle); | ||
| 66 | + UMMU_MAPT_INFO_LOG("allocate tid = %u, mapt_mode = %u\n", info.tid, info.mode); | ||
| 67 | ++ clock_gettime(CLOCK_MONOTONIC, &end); | ||
| 68 | ++ long long start_ns = (long long)start.tv_sec * 1000000000LL + start.tv_nsec; | ||
| 69 | ++ long long start_log = (long long)midle.tv_sec * 1000000000LL + midle.tv_nsec; | ||
| 70 | ++ long long end_ns = (long long)end.tv_sec * 1000000000LL + end.tv_nsec; | ||
| 71 | ++ | ||
| 72 | ++ | ||
| 73 | ++ long long elapsed_all = end_ns - start_ns; | ||
| 74 | ++ long long elapsed_log = end_ns - start_log; | ||
| 75 | ++ | ||
| 76 | ++ | ||
| 77 | ++ UMMU_MAPT_INFO_LOG("allocate tid time = %u, Total time = %lld, log time = %lld\n", | ||
| 78 | ++ info.tid, elapsed_all / 1000, elapsed_log / 1000); | ||
| 79 | + | ||
| 80 | + return 0; | ||
| 81 | + | ||
| 82 | +-- | ||
| 83 | +2.34.1 | ||
| 84 | + | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | Summary: Implementation of UMMU library | 1 | Summary: Implementation of UMMU library |
| 2 | Name: libummu | 2 | Name: libummu |
| 3 | Version: 1.0.4 | 3 | Version: 1.0.4 |
| 4 | -Release: 2 | 4 | +Release: 3 |
| 5 | License: MIT | 5 | License: MIT |
| 6 | %global abi_version 1 | 6 | %global abi_version 1 |
| 7 | Group: Development/Libraries/C | 7 | Group: Development/Libraries/C |
| @@ -21,6 +21,7 @@ Patch11: 0011-UMMU-DK-Add-log-backend-API.patch | |||
| 21 | PATCH12: 0012-add-CODEOWNERS-to-require-maintainers-to-review-API.patch | 21 | PATCH12: 0012-add-CODEOWNERS-to-require-maintainers-to-review-API.patch |
| 22 | PATCH13: 0013-UMMU-DK-Optimize-MAPT-for-multi-block_base_size.patch | 22 | PATCH13: 0013-UMMU-DK-Optimize-MAPT-for-multi-block_base_size.patch |
| 23 | PATCH14: 0014-UMMU-DK-Resolve-the-mapt-table-expansion-leakage-iss.patch | 23 | PATCH14: 0014-UMMU-DK-Resolve-the-mapt-table-expansion-leakage-iss.patch |
| 24 | +PATCH15: 0015-UMMU-DK-log-test.patch | ||
| 24 | 25 | ||
| 25 | BuildRequires: cmake | 26 | BuildRequires: cmake |
| 26 | BuildRequires: gcc-c++ | 27 | BuildRequires: gcc-c++ |
| @@ -88,6 +89,9 @@ cd %{_libdir} | |||
| 88 | %{_mandir}/man3/libummu.3.gz | 89 | %{_mandir}/man3/libummu.3.gz |
| 89 | 90 | ||
| 90 | %changelog | 91 | %changelog |
| 92 | +* Tue Sep 29 2026 Liming An <anliming1@h-partners.com> - 1.0.4-3 | ||
| 93 | +- log test | ||
| 94 | + | ||
| 91 | * Sun Sep 20 2026 huwentao <huwentao19@h-partners.com> - 1.0.4-2 | 95 | * Sun Sep 20 2026 huwentao <huwentao19@h-partners.com> - 1.0.4-2 |
| 92 | - UMMU-DK: Resolve the mapt table expansion leakage issue | 96 | - UMMU-DK: Resolve the mapt table expansion leakage issue |
| 93 | - UMMU-DK: Optimize MAPT for multi block_base_size | 97 | - UMMU-DK: Optimize MAPT for multi block_base_size |