From 32da7ed244745003b24630a9c8f90892f58c4e87 Mon Sep 17 00:00:00 2001 From: EulerOSWander <314264452@qq.com> Date: Wed, 28 Jun 2023 11:36:11 +0800 Subject: [PATCH] top: added guest tics when multiple cpus were merged --- ...-tics-when-multiple-cpus-were-merged.patch | 32 +++++++++++++++++++ procps-ng.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport-top-added-guest-tics-when-multiple-cpus-were-merged.patch diff --git a/backport-top-added-guest-tics-when-multiple-cpus-were-merged.patch b/backport-top-added-guest-tics-when-multiple-cpus-were-merged.patch new file mode 100644 index 0000000..49956c6 --- /dev/null +++ b/backport-top-added-guest-tics-when-multiple-cpus-were-merged.patch @@ -0,0 +1,32 @@ +From 833cdc64f06989fc1949d056e8ec11d5cd99e4c0 Mon Sep 17 00:00:00 2001 +From: hdzhoujie +Date: Wed, 19 Apr 2023 19:40:31 +0800 +Subject: [PATCH] top: added 'guest' tics when multiple cpus were merged + +The 'guest' tics are added in the +sum_tics function, but when multiple +cpus are combined for display, the +'guest' tics are not added cumulatively +in the sum_unify function. + +signed-off-by: zhoujie +--- + src/top/top.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/top/top.c b/src/top/top.c +index 02ef8f6d..abe6e66c 100644 +--- a/src/top/top.c ++++ b/src/top/top.c +@@ -6396,6 +6396,8 @@ static int sum_unify (struct stat_stack *this, int nobuf) { + stack[stat_IR].result.sl_int += rSv(stat_IR, sl_int); + stack[stat_SI].result.sl_int += rSv(stat_SI, sl_int); + stack[stat_ST].result.sl_int += rSv(stat_ST, sl_int); ++ stack[stat_GU].result.sl_int += rSv(stat_GU, sl_int); ++ stack[stat_GN].result.sl_int += rSv(stat_GN, sl_int); + stack[stat_SUM_USR].result.sl_int += rSv(stat_SUM_USR, sl_int); + stack[stat_SUM_SYS].result.sl_int += rSv(stat_SUM_SYS, sl_int); + stack[stat_SUM_TOT].result.sl_int += rSv(stat_SUM_TOT, sl_int); +-- +2.33.0 + diff --git a/procps-ng.spec b/procps-ng.spec index dd0fd00..a528643 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -1,6 +1,6 @@ Name: procps-ng Version: 4.0.2 -Release: 5 +Release: 6 Summary: Utilities that provide system information. License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ URL: https://sourceforge.net/projects/procps-ng/ @@ -17,6 +17,7 @@ Patch5: backport-0001-ps-address-missing-or-corrupted-fields-with-m-option.patc Patch6: backport-0002-ps-trade-previous-fix-for-final-solution-to-m-option.patch Patch7: backport-top-lessen-summary-cpu-distortions-with-first-displa.patch Patch8: backport-pmap-Increase-memory-allocation-failure-judgment.patch +Patch9: backport-top-added-guest-tics-when-multiple-cpus-were-merged.patch BuildRequires: ncurses-devel libtool autoconf automake gcc gettext-devel systemd-devel systemd-pam @@ -99,6 +100,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof %{_mandir}/man* %changelog +* Wed Jun 28 2023 zhoujie - 4.0.2-6 +- top: added guest tics when multiple cpus were merged + * Mon Jun 26 2023 zhoujie - 4.0.2-5 - pmap: increase memory allocation failure judgment -- Gitee