Projects
openEuler:Mainline
procps-ng
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
_service:tar_scm:procps-ng.spec
Changed
@@ -1,6 +1,6 @@ Name: procps-ng Version: 4.0.2 -Release: 6 +Release: 9 Summary: Utilities that provide system information. License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ URL: https://sourceforge.net/projects/procps-ng/ @@ -18,6 +18,9 @@ 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 +Patch10: backport-library-restore-the-proper-main-thread-tics-valuation.patch +Patch11: backport-vmstat-Update-memory-statistics.patch +Patch12: backport-vmstat-Print-guest-time.patch BuildRequires: ncurses-devel libtool autoconf automake gcc gettext-devel systemd-devel @@ -100,11 +103,20 @@ %{_mandir}/man* %changelog +* Thu Jul 13 2023 zhoujie <zhoujie133@huawei.com> - 4.0.2-9 +- vmstat: print guest time + +* Wed Jul 12 2023 zhoujie <zhoujie133@huawei.com> - 4.0.2-8 +- vmstat: Update memory statistics + +* Tue Jul 11 2023 Xi Fnegfei <xi.fengfei@h3c.com> - 4.0.2-7 +- library: restore the proper main thread tics valuation + * Wed Jun 28 2023 zhoujie <zhoujie133@huawei.com> - 4.0.2-6 -- top: added guest tics when multiple cpus were merged +- top: added guest tics when multiple cpus were merged * Mon Jun 26 2023 zhoujie <zhoujie133@huawei.com> - 4.0.2-5 -- pamp: increase memory allocation failure judgment +- pmap: increase memory allocation failure judgment * Tue Jun 13 2023 zhoujie <zhoujie133@huawei.com> - 4.0.2-4 - top: first time display delay
View file
_service:tar_scm:backport-library-restore-the-proper-main-thread-tics-valuation.patch
Added
@@ -0,0 +1,95 @@ +From bc688d630aeeeda5e003d35bbcfcdba08f21b399 Mon Sep 17 00:00:00 2001 +From: Jim Warner <james.warner@comcast.net> +Date: Wed, 31 May 2023 00:00:00 -0500 +Subject: PATCH library: restore the proper main thread tics valuation + +The issue cited below revealed an earlier commit, also +shown below, resulted in an incorrect tics value for a +thread group leader. That change was made so the group +leader would have a proper autogroup id, not a -1 that +was shown with sibling threads which lacked that file. + +So this patch will just restore pre version 4 behavior +while not upsetting LIBPROC_HIDE_KERNEL functionality. + + this change means that when THREAD mode is active, + the autogroup id & nice values won't be available. + they were only shown for the group leaders anyway. + +Reference(s): +https://gitlab.com/procps-ng/procps/-/issues/280 +. Aug, 2021 - thread group leader change +commit a37526260917bac624ae6b75fd9f4ea7287d81ad + +Signed-off-by: Jim Warner <james.warner@comcast.net> +--- + library/readproc.c | 23 ++++++++++++----------- + 1 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/library/readproc.c b/library/readproc.c +index 94030e94..2dfe4c9e 100644 +--- a/library/readproc.c ++++ b/library/readproc.c +@@ -1361,7 +1361,14 @@ static proc_t *simple_readtask(PROCTAB *restrict const PT, proc_t *restrict cons + if (flags & PROC_FILLAUTOGRP) // value the 2 autogroup fields + autogroup_fill(path, t); + +- if (rc == 0) return t; ++ // openproc() ensured that a ppid will be present when needed ... ++ if (rc == 0) { ++ if (PT->hide_kernel && (t->ppid == 2 || t->tid == 2)) { ++ free_acquired(t); ++ return NULL; ++ } ++ return t; ++ } + errno = ENOMEM; + next_task: + return NULL; +@@ -1463,7 +1470,6 @@ proc_t *readproc(PROCTAB *restrict const PT, proc_t *restrict p) { + free_acquired(p); + + for(;;){ +- if (errno == ENOMEM) goto out; + // fills in the path, plus p->tid and p->tgid + if (!PT->finder(PT,p)) goto out; + +@@ -1484,7 +1490,7 @@ out: + proc_t *readeither (PROCTAB *restrict const PT, proc_t *restrict x) { + static __thread proc_t skel_p; // skeleton proc_t, only uses tid + tgid + static __thread proc_t *new_p; // for process/task transitions +- static __thread int canary, leader; ++ static __thread int canary; + char pathPROCPATHLEN; + proc_t *ret; + +@@ -1498,23 +1504,18 @@ proc_t *readeither (PROCTAB *restrict const PT, proc_t *restrict x) { + next_proc: + new_p = NULL; + for (;;) { +- if (errno == ENOMEM) goto end_procs; + // fills in the PT->path, plus skel_p.tid and skel_p.tgid + if (!PT->finder(PT,&skel_p)) goto end_procs; // simple_nextpid +- leader = skel_p.tid; + if (!task_dir_missing) break; + if ((ret = PT->reader(PT,x))) return ret; // simple_readproc + } + + next_task: + // fills in our path, plus x->tid and x->tgid +- if (!(PT->taskfinder(PT,&skel_p,x,path))) // simple_nexttid ++ if ((!(PT->taskfinder(PT,&skel_p,x,path))) // simple_nexttid ++ || (!(ret = PT->taskreader(PT,x,path)))) { // simple_readtask + goto next_proc; +- /* to avoid loss of some thread group leader data, +- we must check its base dir, not its 'task' dir! */ +- if (x->tid == leader) ret = PT->reader(PT,x); // simple_readproc +- else ret = PT->taskreader(PT,x,path); // simple_readtask +- if (!ret) goto next_proc; ++ } + if (!new_p) { + new_p = ret; + canary = new_p->tid; +-- +GitLab +
View file
_service:tar_scm:backport-vmstat-Print-guest-time.patch
Added
@@ -0,0 +1,70 @@ +From f4eeff0b26a2c48552f8ed843bea95bf97437d2a Mon Sep 17 00:00:00 2001 +From: Craig Small <csmall@dropbear.xyz> +Date: Tue, 11 Jul 2023 19:16:15 +1000 +Subject: PATCH vmstat: Print guest time + +Guest time was removed from User time but not printed. This meant +that if guest time was non-zero then the CPU numbers did not add +up to 100% + +References: + !191 + !113 + commit 2461bb5bc17ee4bc01b142b5bba2c5d87578285c + +Signed-off-by: Craig Small <csmall@dropbear.xyz> +--- + src/vmstat.c | 6 +++--- + testsuite/vmstat.test/vmstat.exp | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/vmstat.c b/src/vmstat.c +index acb7b80..68d356c 100644 +--- a/src/vmstat.c ++++ b/src/vmstat.c +@@ -254,13 +254,13 @@ static void new_header(void) + * that follow (marked with max x chars) might not work, + * unless manual page is translated as well. */ + const char *header = +- _("procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----"); ++ _("procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------"); + const char *wide_header = + _("--procs-- -----------------------memory---------------------- ---swap-- -----io---- -system-- ----------cpu----------"); + const char *timestamp_header = _(" -----timestamp-----"); + + const char format = +- "%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s"; ++ "%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s %2s"; + const char wide_format = + "%4s %4s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s %3s"; + +@@ -349,7 +349,7 @@ static void new_format(void) + #define MEMv(E) MEMINFO_VAL(E, ul_int, mem_stack, mem_info) + #define DSYSv(E) STAT_VAL(E, s_int, stat_stack, stat_info) + const char format = +- "%2lu %2lu %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u"; ++ "%2lu %2lu %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u %2u"; + const char wide_format = + "%4lu %4lu %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u %3u"; + +diff --git a/testsuite/vmstat.test/vmstat.exp b/testsuite/vmstat.test/vmstat.exp +index 1cd13a1..48d0b0f 100644 +--- a/testsuite/vmstat.test/vmstat.exp ++++ b/testsuite/vmstat.test/vmstat.exp +@@ -12,11 +12,11 @@ if { file readable "/proc/vmstat" == 0 } { + } else { + set test "vmstat with no arguments" + spawn $vmstat +- expect_pass "$test" "^procs\ -\+memory\ -\+swap\ -\+io\ -\+system\ -\+cpu\ -\+\\s*r\\s+b\\s+swpd\\s+free\\s+buff\\s+cache\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa st\\s*\(\\s+\\d+\){17}\\s*$" ++ expect_pass "$test" "^procs\ -\+memory\ -\+swap\ -\+io\ -\+system\ -\+cpu\ -\+\\s*r\\s+b\\s+swpd\\s+free\\s+buff\\s+cache\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa st gu\\s*\(\\s+\\d+\){18}\\s*$" + + set test "vmstat with -a flag" + spawn $vmstat -a +- expect_pass "$test" "^procs\ -\+memory\ -\+swap\ -\+io\ -\+system\ -\+cpu\ -\+\\s*r\\s+b\\s+swpd\\s+free\\s+inact\\s+active\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa st\\s*\(\\s+\\d+\){17}\\s*$" ++ expect_pass "$test" "^procs\ -\+memory\ -\+swap\ -\+io\ -\+system\ -\+cpu\ -\+\\s*r\\s+b\\s+swpd\\s+free\\s+inact\\s+active\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa st gu\\s*\(\\s+\\d+\){18}\\s*$" + + set test "vmstat fork option" + spawn $vmstat -f +-- +2.33.0 +
View file
_service:tar_scm:backport-vmstat-Update-memory-statistics.patch
Added
@@ -0,0 +1,46 @@ +From 7e24816538b777fe0b3f709df3b9c1824681461c Mon Sep 17 00:00:00 2001 +From: Ingo Saitz <ingo@hannover.ccc.de> +Date: Fri, 6 Jan 2023 13:30:39 +1100 +Subject: PATCH vmstat: Update memory statistics + +vmstat <n> would update most fields, but the memory statistics +were only fetched the first time. + +References: + https://bugs.debian.org/1027963 + +Signed-off-by: Craig Small <csmall@dropbear.xyz> +--- + NEWS | 1 + + src/vmstat.c | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/NEWS b/NEWS +index 2d13978..fade38f 100644 +--- a/NEWS ++++ b/NEWS +@@ -2,6 +2,7 @@ procps-ng-NEXT + --------------- + * docs: Don't install English manpages twice + * skill: Match on -p again Debian #1025915 ++ * vmstat: Referesh memory statistics Debian #1027963 + procps-ng-4.0.2 + --------------- + * library revision - 0:1:0 +diff --git a/src/vmstat.c b/src/vmstat.c +index 8610983..acb7b80 100644 +--- a/src/vmstat.c ++++ b/src/vmstat.c +@@ -468,6 +468,9 @@ static void new_format(void) + pswpintog = VMSTAT_GET(vm_info, VMSTAT_PSWPIN, ul_int); + pswpouttog = VMSTAT_GET(vm_info, VMSTAT_PSWPOUT, ul_int); + ++ if (!(mem_stack = procps_meminfo_select(mem_info, Mem_items, MAX_mem))) ++ xerrx(EXIT_FAILURE, _("Unable to select memory information")); ++ + if (t_option) { + (void) time( &the_time ); + tm_ptr = localtime( &the_time ); +-- +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