From 04e2714ab004754876a203f1ef93c8081fb6a8d9 Mon Sep 17 00:00:00 2001 From: lutong Date: Tue, 8 Jul 2025 10:56:54 +0800 Subject: [PATCH 1/2] Revert "domain: change method of getting domain id" This reverts commit 2bd0d9255126dd1f3b48d6b93af879d7315e68ad. --- ...n-change-method-of-getting-domain-id.patch | 42 ------------------- vmtop.spec | 6 +-- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 domain-change-method-of-getting-domain-id.patch diff --git a/domain-change-method-of-getting-domain-id.patch b/domain-change-method-of-getting-domain-id.patch deleted file mode 100644 index 49b7068..0000000 --- a/domain-change-method-of-getting-domain-id.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 81fcff0cff9ef7ba181163467b4d594c35267c5c Mon Sep 17 00:00:00 2001 -From: liangtian -Date: Sat, 27 Jul 2024 16:44:11 +0800 -Subject: [PATCH] domain: change method of getting domain id - -libvirt 9.10 change cpuset of cgroup path of vm -change -to - -Signed-off-by: liangtian ---- - src/domain.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/domain.c b/src/domain.c -index 977cabe..8039182 100644 ---- a/src/domain.c -+++ b/src/domain.c -@@ -107,17 +107,17 @@ static int get_id_from_cgroup(pid_t pid) - if (fp == NULL) { - return id; - } -- /* parse id from "cpuset:machine.slice/machine-qemu\x2d$id" */ -+ /* parse id from "cpuset:/machine/qemu-$id" */ - while (fgets(buf, BUF_SIZE - 1, fp)) { - if (strstr(buf, "cpuset:") == NULL) { - memset(buf, 0, BUF_SIZE); - continue; - } -- tmp = strstr(buf, "machine-qemu\\x2d"); -+ tmp = strstr(buf, "qemu-"); - if (tmp == NULL) { - continue; - } -- tmp += strlen("machine-qemu\\x2d"); -+ tmp += strlen("qemu-"); - id = atoi(tmp); - break; - } --- -2.45.2.windows.1 - diff --git a/vmtop.spec b/vmtop.spec index 2b1514f..ce2b7f7 100644 --- a/vmtop.spec +++ b/vmtop.spec @@ -1,6 +1,6 @@ Name: vmtop Version: 1.1 -Release: 8 +Release: 7 Summary: A tool for collecting and analyzing data of virtual machine License: MulanPSL-2.0 Group: Application/System @@ -39,7 +39,6 @@ Patch0028: proc-del-unused-items-getting-from-proc-stat-refresh.patch Patch0029: proc-del-loop-sscanf-for-proc-pid-stat-file.patch Patch0030: utils-del-realpath-from-read_file.patch Patch0031: add-README.zh.md.-update-README.md.patch -Patch0032: domain-change-method-of-getting-domain-id.patch Requires: libvirt, ncurses @@ -80,9 +79,6 @@ install -m 550 vmtop ${RPM_BUILD_ROOT}/usr/bin/%{name} %{_bindir}/vmtop %changelog -* Sat Jul 27 2024 liangtian - 1.1-8 -- domain: change method of getting domain id - * Sun Oct 09 2022 fushanqing - 1.1-7 - Unified license name specification -- Gitee From eb36f1762150c8048e6e957c05217adcec737d88 Mon Sep 17 00:00:00 2001 From: lutong Date: Tue, 8 Jul 2025 11:13:40 +0800 Subject: [PATCH 2/2] bugfix:fixed display error caused by missing signal_exits field --- ...error-caused-by-missing-signal_exits.patch | 51 +++++++++++++++++++ vmtop.spec | 6 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 bugfix-fixed-display-error-caused-by-missing-signal_exits.patch diff --git a/bugfix-fixed-display-error-caused-by-missing-signal_exits.patch b/bugfix-fixed-display-error-caused-by-missing-signal_exits.patch new file mode 100644 index 0000000..90e018b --- /dev/null +++ b/bugfix-fixed-display-error-caused-by-missing-signal_exits.patch @@ -0,0 +1,51 @@ +From ce42a7e641ff5b4cafeb00524da86ecd115a5d55 Mon Sep 17 00:00:00 2001 +From: lutong +Date: Thu, 19 Jun 2025 15:09:32 +0800 +Subject: [PATCH 1/1] bugfix:fixed display error caused by missing signal_exits + field + +--- + src/type.h | 1 + + src/vcpu_stat.c | 1 + + src/vcpu_stat.h | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/src/type.h b/src/type.h +index 77dd696..727b54b 100644 +--- a/src/type.h ++++ b/src/type.h +@@ -108,6 +108,7 @@ struct domain { + DFX_VALUE(wfi_exit_stat), + DFX_VALUE(mmio_exit_user), + DFX_VALUE(mmio_exit_kernel), ++ DFX_VALUE(signal_exits), + DFX_VALUE(exits), + DFX_VALUE(fp_asimd_exit_stat), + DFX_VALUE(irq_exit_stat), +diff --git a/src/vcpu_stat.c b/src/vcpu_stat.c +index 1578ec4..c23480e 100644 +--- a/src/vcpu_stat.c ++++ b/src/vcpu_stat.c +@@ -28,6 +28,7 @@ struct file_item vcpu_stat_stab[] = { + {"%llu", GDF(wfi_exit_stat) }, + {"%llu", GDF(mmio_exit_user) }, + {"%llu", GDF(mmio_exit_kernel) }, ++ {"%llu", GDF(signal_exits) }, + {"%llu", GDF(exits) }, + {"%llu", GDF(fp_asimd_exit_stat) }, + {"%llu", GDF(irq_exit_stat) }, +diff --git a/src/vcpu_stat.h b/src/vcpu_stat.h +index 9b3f4c2..0697608 100644 +--- a/src/vcpu_stat.h ++++ b/src/vcpu_stat.h +@@ -21,6 +21,7 @@ GET_DELTA_FUN(wfe_exit_stat) + GET_DELTA_FUN(wfi_exit_stat) + GET_DELTA_FUN(mmio_exit_user) + GET_DELTA_FUN(mmio_exit_kernel) ++GET_DELTA_FUN(signal_exits) + GET_DELTA_FUN(exits) + GET_DELTA_FUN(fp_asimd_exit_stat) + GET_DELTA_FUN(irq_exit_stat) +-- +2.43.0 + diff --git a/vmtop.spec b/vmtop.spec index ce2b7f7..7c8b31e 100644 --- a/vmtop.spec +++ b/vmtop.spec @@ -1,6 +1,6 @@ Name: vmtop Version: 1.1 -Release: 7 +Release: 8 Summary: A tool for collecting and analyzing data of virtual machine License: MulanPSL-2.0 Group: Application/System @@ -39,6 +39,7 @@ Patch0028: proc-del-unused-items-getting-from-proc-stat-refresh.patch Patch0029: proc-del-loop-sscanf-for-proc-pid-stat-file.patch Patch0030: utils-del-realpath-from-read_file.patch Patch0031: add-README.zh.md.-update-README.md.patch +Patch0032: bugfix-fixed-display-error-caused-by-missing-signal_exits.patch Requires: libvirt, ncurses @@ -79,6 +80,9 @@ install -m 550 vmtop ${RPM_BUILD_ROOT}/usr/bin/%{name} %{_bindir}/vmtop %changelog +* Thu Jun 19 2025 lutong - 1.1-8 +- bugfix:fixed display error caused by missing signal_exits + * Sun Oct 09 2022 fushanqing - 1.1-7 - Unified license name specification -- Gitee