Update to procps-4.0.0
OBS-URL: https://build.opensuse.org/package/show/Base:System/procps?expand=0&rev=227
This commit is contained in:
parent
948ffbd69d
commit
17a02a970b
@ -1,45 +0,0 @@
|
||||
From 3dd1661a3d91671ca6c977c2e514f47d807be79d Mon Sep 17 00:00:00 2001
|
||||
From: Craig Small <csmall@dropbear.xyz>
|
||||
Date: Mon, 29 Mar 2021 22:11:27 +1100
|
||||
Subject: [PATCH] docs: psr ps field is last run processor
|
||||
|
||||
The ps.1 manpage incorrectly stated that psr field showed the
|
||||
processor the process was assigned to. However if the assignment
|
||||
has changed but the process has not run, then the field doesn't
|
||||
change.
|
||||
|
||||
Some digging by @srikard showed it wasn't the processor assigned
|
||||
but the last one it was run on. The man page now correctly
|
||||
describes psr in that way.
|
||||
|
||||
References:
|
||||
procps-ng/procps#187
|
||||
---
|
||||
ps/ps.1 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git ps/ps.1 ps/ps.1
|
||||
index 8678123..b433655 100644
|
||||
--- ps/ps.1
|
||||
+++ ps/ps.1
|
||||
|@@ -4,7 +4,7 @@
|
||||
| .\" Quick hack conversion by Albert Cahalan, 1998.
|
||||
| .\" Licensed under version 2 of the Gnu General Public License.
|
||||
| .\"
|
||||
|-.TH PS "1" "2021-03-05" "procps-ng" "User Commands"
|
||||
|+.TH PS "1" "2021-03-29" "procps-ng" "User Commands"
|
||||
| .\"
|
||||
| .\" To render this page:
|
||||
| .\" groff -t -b -man -X -P-resolution -P100 -Tps ps.1 &
|
||||
@@ -1518,7 +1518,7 @@ priority of the process. Higher number means lower priority.
|
||||
T}
|
||||
|
||||
psr PSR T{
|
||||
-processor that process is currently assigned to.
|
||||
+processor that process last executed on.
|
||||
T}
|
||||
|
||||
rgid RGID T{
|
||||
--
|
||||
2.26.2
|
||||
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
proc/libprocps.sym | 1 +
|
||||
proc/sysinfo.c | 13 +++++++++++--
|
||||
proc/sysinfo.h | 2 ++
|
||||
3 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
--- proc/libprocps.sym
|
||||
+++ proc/libprocps.sym 2018-04-04 11:30:51.841725161 +0000
|
||||
@@ -60,6 +60,7 @@ global:
|
||||
signal_name_to_number;
|
||||
signal_number_to_name;
|
||||
smp_num_cpus;
|
||||
+ __smp_num_cpus;
|
||||
sprint_uptime;
|
||||
strtosig;
|
||||
tty_to_dev;
|
||||
--- proc/sysinfo.c
|
||||
+++ proc/sysinfo.c 2018-04-04 11:33:26.306886237 +0000
|
||||
@@ -47,7 +47,8 @@
|
||||
#endif
|
||||
#include <elf.h>
|
||||
|
||||
-long smp_num_cpus; /* number of CPUs */
|
||||
+#undef smp_num_cpus
|
||||
+long smp_num_cpus=-1; /* number of CPUs */
|
||||
long page_bytes; /* this architecture's page size */
|
||||
|
||||
#define BAD_OPEN_MESSAGE \
|
||||
@@ -1166,7 +1167,11 @@ out:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
-void cpuinfo (void) {
|
||||
+long __smp_num_cpus (void) {
|
||||
+
|
||||
+ if (smp_num_cpus != -1)
|
||||
+ return(smp_num_cpus);
|
||||
+
|
||||
// ought to count CPUs in /proc/stat instead of relying
|
||||
// on glibc, which foolishly tries to parse /proc/cpuinfo
|
||||
// note: that may have been the case but now /proc/stat
|
||||
@@ -1181,4 +1186,8 @@ void cpuinfo (void) {
|
||||
smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (smp_num_cpus<1) /* SPARC glibc is buggy */
|
||||
smp_num_cpus=1;
|
||||
+
|
||||
+ return smp_num_cpus;
|
||||
}
|
||||
+
|
||||
+void cpuinfo (void) { (void)__smp_num_cpus(); }
|
||||
--- proc/sysinfo.h
|
||||
+++ proc/sysinfo.h 2018-04-04 11:30:51.841725161 +0000
|
||||
@@ -8,6 +8,8 @@ EXTERN_C_BEGIN
|
||||
|
||||
extern unsigned long long Hertz; /* clock tick frequency */
|
||||
extern long smp_num_cpus; /* number of CPUs */
|
||||
+extern long __smp_num_cpus(void);
|
||||
+#define smp_num_cpus __smp_num_cpus()
|
||||
extern int have_privs; /* boolean, true if setuid or similar */
|
||||
extern long page_bytes; /* this architecture's bytes per page */
|
||||
|
@ -10,16 +10,16 @@ and this causes a problem later on (bsc#908516)
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- free.c
|
||||
+++ free.c 2018-04-04 12:47:06.360757839 +0000
|
||||
@@ -197,6 +197,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
+++ free.c 2022-03-29 11:17:45.442230673 +0000
|
||||
@@ -209,6 +209,7 @@ int main(int argc, char **argv)
|
||||
int c, flags = 0, unit_set = 0;
|
||||
struct commandline_arguments args;
|
||||
struct meminfo_info *mem_info = NULL;
|
||||
+ int errsv;
|
||||
|
||||
/*
|
||||
* For long options that have no equivalent short option, use a
|
||||
@@ -247,10 +248,12 @@ int main(int argc, char **argv)
|
||||
@@ -260,10 +261,12 @@ int main(int argc, char **argv)
|
||||
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||
program_invocation_name = program_invocation_short_name;
|
||||
#endif
|
||||
@ -30,9 +30,9 @@ and this causes a problem later on (bsc#908516)
|
||||
atexit(close_stdout);
|
||||
+ errno = errsv;
|
||||
|
||||
while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
|
||||
while ((c = getopt_long(argc, argv, "bkmghltvCc:ws:V", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
@@ -317,11 +320,13 @@ int main(int argc, char **argv)
|
||||
@@ -333,11 +336,13 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 's':
|
||||
flags |= FREE_REPEAT;
|
||||
|
@ -1,38 +0,0 @@
|
||||
---
|
||||
vmstat.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
--- vmstat.c
|
||||
+++ vmstat.c 2018-04-04 11:16:07.577968520 +0000
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
@@ -708,13 +709,12 @@ static void slabheader(void)
|
||||
|
||||
static void slabformat(void)
|
||||
{
|
||||
- FILE *fSlab;
|
||||
+ struct stat fSlab;
|
||||
struct slab_cache *slabs;
|
||||
unsigned long nSlab, i, j, k;
|
||||
const char format[] = "%-24s %6u %6u %6u %6u\n";
|
||||
|
||||
- fSlab = fopen("/proc/slabinfo", "rb");
|
||||
- if (!fSlab) {
|
||||
+ if (stat("/proc/slabinfo", &fSlab) < 0) {
|
||||
xwarnx(_("your kernel does not support slabinfo or your permissions are insufficient"));
|
||||
return;
|
||||
}
|
||||
@@ -746,7 +746,6 @@ static void slabformat(void)
|
||||
}
|
||||
free(slabs);
|
||||
}
|
||||
- fclose(fSlab);
|
||||
}
|
||||
|
||||
static void disksum_format(void)
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
free.c | 19 ++++++++++++++++---
|
||||
proc/sysinfo.c | 5 ++++-
|
||||
2 files changed, 20 insertions(+), 4 deletions(-)
|
||||
|
||||
--- free.c
|
||||
+++ free.c 2021-02-10 09:58:35.409695062 +0000
|
||||
@@ -134,7 +134,7 @@ static const char *scale_size(unsigned l
|
||||
if (args.exponent > 1) {
|
||||
/* In desired scale. */
|
||||
snprintf(buf, sizeof(buf), "%ld",
|
||||
- (long int)((size * 1024.0) / power(base, args.exponent-1))
|
||||
+ (long int)(((long long int)size * 1024) / power(base, args.exponent-1))
|
||||
);
|
||||
return buf;
|
||||
}
|
||||
@@ -381,15 +381,28 @@ int main(int argc, char **argv)
|
||||
* to print the high info, even if it is zero.
|
||||
*/
|
||||
if (flags & FREE_LOHI) {
|
||||
+ unsigned long kb_low_used;
|
||||
+ unsigned long kb_high_used;
|
||||
+
|
||||
+ if (kb_low_total > kb_low_free)
|
||||
+ kb_low_used = kb_low_total - kb_low_free;
|
||||
+ else
|
||||
+ kb_low_used = 0;
|
||||
+
|
||||
+ if (kb_high_total > kb_high_free)
|
||||
+ kb_high_used = kb_high_total - kb_high_free;
|
||||
+ else
|
||||
+ kb_high_used = 0;
|
||||
+
|
||||
printf("%-9s", _("Low:"));
|
||||
printf("%11s", scale_size(kb_low_total, flags, args));
|
||||
- printf(" %11s", scale_size(kb_low_total - kb_low_free, flags, args));
|
||||
+ printf(" %11s", scale_size(kb_low_used, flags, args));
|
||||
printf(" %11s", scale_size(kb_low_free, flags, args));
|
||||
printf("\n");
|
||||
|
||||
printf("%-9s", _("High:"));
|
||||
printf("%11s", scale_size(kb_high_total, flags, args));
|
||||
- printf(" %11s", scale_size(kb_high_total - kb_high_free, flags, args));
|
||||
+ printf(" %11s", scale_size(kb_high_used, flags, args));
|
||||
printf(" %11s", scale_size(kb_high_free, flags, args));
|
||||
printf("\n");
|
||||
}
|
||||
--- proc/sysinfo.c
|
||||
+++ proc/sysinfo.c 2021-02-10 10:00:35.227385913 +0000
|
||||
@@ -783,7 +783,10 @@ nextline:
|
||||
kb_main_cached = kb_page_cache + kb_slab_reclaimable;
|
||||
if ((ev=getenv("PS_FULL_CACHE")))
|
||||
kb_main_cached += kb_swap_cached + kb_nfs_unstable;
|
||||
- kb_swap_used = kb_swap_total - kb_swap_free;
|
||||
+ if (kb_swap_total > kb_swap_free)
|
||||
+ kb_swap_used = kb_swap_total - kb_swap_free;
|
||||
+ else
|
||||
+ kb_swap_used = 0;
|
||||
|
||||
/* if kb_main_available is greater than kb_main_total or our calculation of
|
||||
mem_used overflows, that's symptomatic of running within a lxc container
|
@ -3,17 +3,17 @@
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- top/top.c
|
||||
+++ top/top.c 2018-04-04 12:09:16.087193018 +0000
|
||||
@@ -2404,7 +2404,11 @@ static void zap_fieldstab (void) {
|
||||
+++ top/top.c 2022-03-29 10:29:24.422368662 +0000
|
||||
@@ -2457,7 +2457,11 @@ static void zap_fieldstab (void) {
|
||||
Cpu_pmax = 99.9;
|
||||
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
|
||||
Cpu_pmax = 100.0 * smp_num_cpus;
|
||||
- if (smp_num_cpus > 10) {
|
||||
+ if (smp_num_cpus > 1000) {
|
||||
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
|
||||
+ } else if (smp_num_cpus > 100) {
|
||||
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
|
||||
+ } else if (smp_num_cpus > 10) {
|
||||
if (Rc.mode_irixps && Cpu_cnt > 1 && !Thread_mode) {
|
||||
Cpu_pmax = 100.0 * Cpu_cnt;
|
||||
- if (Cpu_cnt > 10) {
|
||||
+ if (Cpu_cnt > 1000) {
|
||||
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
|
||||
+ } else if (Cpu_cnt > 100) {
|
||||
+ if (Cpu_cnt > 999999.0) Cpu_pmax = 999999.0;
|
||||
+ } else if (Cpu_cnt > 10) {
|
||||
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
|
||||
} else {
|
||||
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
free.1 | 6 ++++++
|
||||
free.c | 7 ++++++-
|
||||
proc/sysinfo.c | 4 ++++
|
||||
vmstat.c | 6 +++++-
|
||||
4 files changed, 21 insertions(+), 2 deletions(-)
|
||||
proc/meminfo.c | 7 ++++++-
|
||||
vmstat.c | 7 ++++++-
|
||||
4 files changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
--- free.1
|
||||
+++ free.1 2019-12-11 06:20:16.659772479 +0000
|
||||
+++ free.1 2022-03-28 11:53:32.173182702 +0000
|
||||
@@ -100,6 +100,12 @@ Switch to the wide mode. The wide mode p
|
||||
than 80 characters. In this mode \fBbuffers\fR and \fBcache\fR
|
||||
are reported in two separate columns.
|
||||
@ -21,33 +21,33 @@
|
||||
Display the result
|
||||
.I count
|
||||
--- free.c
|
||||
+++ free.c 2019-12-11 06:20:16.659772479 +0000
|
||||
@@ -90,6 +90,7 @@ static void __attribute__ ((__noreturn__
|
||||
fputs(_(" -t, --total show total for RAM + swap\n"), out);
|
||||
+++ free.c 2022-03-28 12:05:01.544663755 +0000
|
||||
@@ -93,6 +93,7 @@ static void __attribute__ ((__noreturn__
|
||||
fputs(_(" -v, --committed show committed memory and commit limit\n"), out);
|
||||
fputs(_(" -s N, --seconds N repeat printing every N seconds\n"), out);
|
||||
fputs(_(" -c N, --count N repeat printing N times, then exit\n"), out);
|
||||
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
|
||||
fputs(_(" -w, --wide wide output\n"), out);
|
||||
fputs(USAGE_SEPARATOR, out);
|
||||
fputs(_(" --help display this help and exit\n"), out);
|
||||
@@ -231,6 +232,7 @@ int main(int argc, char **argv)
|
||||
{ "total", no_argument, NULL, 't' },
|
||||
@@ -244,6 +245,7 @@ int main(int argc, char **argv)
|
||||
{ "committed", no_argument, NULL, 'v' },
|
||||
{ "seconds", required_argument, NULL, 's' },
|
||||
{ "count", required_argument, NULL, 'c' },
|
||||
+ { "full-cache",required_argument, NULL, HELP_OPTION },
|
||||
+ { "full-cache",no_argument, NULL, 'C' },
|
||||
{ "wide", no_argument, NULL, 'w' },
|
||||
{ "help", no_argument, NULL, HELP_OPTION },
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
@@ -250,7 +252,7 @@ int main(int argc, char **argv)
|
||||
@@ -263,7 +265,7 @@ int main(int argc, char **argv)
|
||||
textdomain(PACKAGE);
|
||||
atexit(close_stdout);
|
||||
|
||||
- while ((c = getopt_long(argc, argv, "bkmghltc:ws:V", longopts, NULL)) != -1)
|
||||
+ while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
|
||||
- while ((c = getopt_long(argc, argv, "bkmghltvc:ws:V", longopts, NULL)) != -1)
|
||||
+ while ((c = getopt_long(argc, argv, "bkmghltvCc:ws:V", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
case 'b':
|
||||
check_unit_set(&unit_set);
|
||||
@@ -333,6 +335,9 @@ int main(int argc, char **argv)
|
||||
@@ -349,6 +351,9 @@ int main(int argc, char **argv)
|
||||
case 'w':
|
||||
flags |= FREE_WIDE;
|
||||
break;
|
||||
@ -57,59 +57,70 @@
|
||||
case HELP_OPTION:
|
||||
usage(stdout);
|
||||
case 'V':
|
||||
--- proc/sysinfo.c
|
||||
+++ proc/sysinfo.c 2019-12-11 06:20:16.659772479 +0000
|
||||
--- proc/meminfo.c
|
||||
+++ proc/meminfo.c 2022-03-28 12:39:29.291205555 +0000
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
|
||||
* Copyright 1998-2003 Albert Cahalan
|
||||
* June 2003, Fabian Frederick, disk and slab info
|
||||
*
|
||||
* Copyright (C) 2015 Craig Small <csmall@dropbear.xyz>
|
||||
* Copyright (C) 2016-2022 Jim Warner <james.warner@comcast.net>
|
||||
+ * Copyright (c) 2008 Bart Van Assche.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -700,6 +701,7 @@ void meminfo(void){
|
||||
int linux_version_code = procps_linux_version();
|
||||
mem_table_struct findme = { namebuf, NULL};
|
||||
mem_table_struct *found;
|
||||
+ const char *ev;
|
||||
char *head;
|
||||
char *tail;
|
||||
static const mem_table_struct mem_table[] = {
|
||||
@@ -779,6 +781,8 @@ nextline:
|
||||
kb_inactive = kb_inact_dirty + kb_inact_clean + kb_inact_laundry;
|
||||
}
|
||||
kb_main_cached = kb_page_cache + kb_slab_reclaimable;
|
||||
+ if ((ev=getenv("PS_FULL_CACHE")))
|
||||
+ kb_main_cached += kb_swap_cached + kb_nfs_unstable;
|
||||
kb_swap_used = kb_swap_total - kb_swap_free;
|
||||
@@ -640,6 +641,7 @@ static int meminfo_read_failed (
|
||||
int size;
|
||||
unsigned long *valptr;
|
||||
signed long mem_used;
|
||||
+ const char *ev;
|
||||
|
||||
/* if kb_main_available is greater than kb_main_total or our calculation of
|
||||
// remember history from last time around
|
||||
memcpy(&info->hist.old, &info->hist.new, sizeof(struct meminfo_data));
|
||||
@@ -692,7 +694,10 @@ static int meminfo_read_failed (
|
||||
|
||||
if (0 == mHr(MemAvailable))
|
||||
mHr(MemAvailable) = mHr(MemFree);
|
||||
- mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable);
|
||||
+ if ((ev=getenv("PS_FULL_CACHE")))
|
||||
+ mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable) + mHr(NFS_Unstable);
|
||||
+ else
|
||||
+ mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable);
|
||||
|
||||
/* if 'available' is greater than 'total' or our calculation of mem_used
|
||||
overflows, that's symptomatic of running within a lxc container where
|
||||
--- vmstat.c
|
||||
+++ vmstat.c 2019-12-11 06:22:44.716984764 +0000
|
||||
@@ -103,6 +103,7 @@ static void __attribute__ ((__noreturn__
|
||||
fputs(_(" -p, --partition <dev> partition specific statistics\n"), out);
|
||||
fputs(_(" -S, --unit <char> define display unit\n"), out);
|
||||
fputs(_(" -w, --wide wide output\n"), out);
|
||||
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
|
||||
fputs(_(" -t, --timestamp show timestamp\n"), out);
|
||||
fputs(USAGE_SEPARATOR, out);
|
||||
fputs(USAGE_HELP, out);
|
||||
@@ -899,7 +900,7 @@ int main(int argc, char *argv[])
|
||||
atexit(close_stdout);
|
||||
+++ vmstat.c 2022-03-28 12:41:52.744612074 +0000
|
||||
@@ -234,6 +234,7 @@ static void __attribute__ ((__noreturn__
|
||||
fputs(_(" -p, --partition <dev> partition specific statistics\n"), out);
|
||||
fputs(_(" -S, --unit <char> define display unit\n"), out);
|
||||
fputs(_(" -w, --wide wide output\n"), out);
|
||||
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
|
||||
fputs(_(" -t, --timestamp show timestamp\n"), out);
|
||||
fputs(_(" -y, --no-first skips first line of output\n"), out);
|
||||
fputs(USAGE_SEPARATOR, out);
|
||||
@@ -948,6 +949,7 @@ int main(int argc, char *argv[])
|
||||
{"partition", required_argument, NULL, 'p'},
|
||||
{"unit", required_argument, NULL, 'S'},
|
||||
{"wide", no_argument, NULL, 'w'},
|
||||
+ {"full-cache", no_argument, NULL, 'C'},
|
||||
{"timestamp", no_argument, NULL, 't'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"version", no_argument, NULL, 'V'},
|
||||
@@ -964,7 +966,7 @@ int main(int argc, char *argv[])
|
||||
atexit(close_stdout);
|
||||
|
||||
while ((c =
|
||||
- getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
|
||||
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthV", longopts,
|
||||
NULL)) != -1)
|
||||
switch (c) {
|
||||
case 'V':
|
||||
@@ -968,6 +969,9 @@ int main(int argc, char *argv[])
|
||||
case 't':
|
||||
t_option = 1;
|
||||
break;
|
||||
+ case 'C':
|
||||
+ setenv("PS_FULL_CACHE", "yes", 1);
|
||||
+ break;
|
||||
default:
|
||||
/* no other aguments defined yet. */
|
||||
usage(stderr);
|
||||
while ((c =
|
||||
- getopt_long(argc, argv, "afmnsdDp:S:wthVy", longopts, NULL)) != -1)
|
||||
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthVy", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
case 'V':
|
||||
printf(PROCPS_NG_VERSION);
|
||||
@@ -1031,6 +1033,9 @@ int main(int argc, char *argv[])
|
||||
case 't':
|
||||
t_option = 1;
|
||||
break;
|
||||
+ case 'C':
|
||||
+ setenv("PS_FULL_CACHE", "yes", 1);
|
||||
+ break;
|
||||
case 'y':
|
||||
/* Don't display stats since system restart */
|
||||
y_option = 1;
|
||||
|
@ -1,29 +1,33 @@
|
||||
---
|
||||
vmstat.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- vmstat.c
|
||||
+++ vmstat.c 2015-01-27 14:57:19.467491788 +0000
|
||||
@@ -295,7 +295,7 @@ static void new_format(void)
|
||||
unsigned int intr[2], ctxt[2];
|
||||
unsigned int sleep_half;
|
||||
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
|
||||
- int debt = 0; /* handle idle ticks running backwards */
|
||||
+ long long debt = 0; /* handle idle ticks running backwards */
|
||||
struct tm *tm_ptr;
|
||||
time_t the_time;
|
||||
char timebuf[32];
|
||||
@@ -386,12 +386,12 @@ static void new_format(void)
|
||||
+++ vmstat.c 2022-03-29 09:21:41.156855432 +0000
|
||||
@@ -362,7 +362,7 @@ static void new_format(void)
|
||||
unsigned long pgpgin[2], pgpgout[2], pswpin[2] = {0,0}, pswpout[2];
|
||||
unsigned int sleep_half;
|
||||
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
|
||||
- int debt = 0; /* handle idle ticks running backwards */
|
||||
+ long long debt = 0; /* handle idle ticks running backwards */
|
||||
struct tm *tm_ptr;
|
||||
time_t the_time;
|
||||
char timebuf[32];
|
||||
@@ -481,12 +481,12 @@ static void new_format(void)
|
||||
|
||||
/* idle can run backwards for a moment -- kernel "feature" */
|
||||
if (debt) {
|
||||
- didl = (int)didl + debt;
|
||||
- debt = 0;
|
||||
+ didl = (long long)didl + debt;
|
||||
+ debt = 0LL;
|
||||
}
|
||||
- if ((int)didl < 0) {
|
||||
- debt = (int)didl;
|
||||
- didl = 0;
|
||||
+ if ((long long)didl < 0) {
|
||||
+ debt = (long long)didl;
|
||||
+ didl = 0ULL;
|
||||
}
|
||||
/* idle can run backwards for a moment -- kernel "feature" */
|
||||
if (debt) {
|
||||
- cpu_idl = (int)cpu_idl + debt;
|
||||
- debt = 0;
|
||||
+ cpu_idl = cpu_idl + debt;
|
||||
+ debt = 0LL;
|
||||
}
|
||||
- if ((int)cpu_idl < 0) {
|
||||
- debt = (int)cpu_idl;
|
||||
- cpu_idl = 0;
|
||||
+ if (cpu_idl < 0) {
|
||||
+ debt = cpu_idl;
|
||||
+ cpu_idl = 0LL;
|
||||
}
|
||||
|
||||
Div = duse + dsys + didl + diow + dstl;
|
||||
Div = cpu_use + cpu_sys + cpu_idl + cpu_iow + cpu_sto;
|
||||
|
@ -4,8 +4,8 @@
|
||||
2 files changed, 44 insertions(+), 20 deletions(-)
|
||||
|
||||
--- pmap.c
|
||||
+++ pmap.c 2018-06-05 09:37:34.404294888 +0000
|
||||
@@ -49,7 +49,9 @@ const char *nls_Address,
|
||||
+++ pmap.c 2022-03-29 11:46:26.323303275 +0000
|
||||
@@ -55,7 +55,9 @@ const char *nls_Address,
|
||||
*nls_Kbytes,
|
||||
*nls_Mode,
|
||||
*nls_RSS,
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
static void nls_initialize(void)
|
||||
{
|
||||
@@ -73,7 +75,9 @@ static void nls_initialize(void)
|
||||
@@ -79,7 +81,9 @@ static void nls_initialize(void)
|
||||
nls_Kbytes = _("Kbytes");
|
||||
nls_Mode = _("Mode");
|
||||
nls_RSS = _("RSS");
|
||||
@ -26,20 +26,20 @@
|
||||
}
|
||||
|
||||
static int justify_print(const char *str, int width, int right)
|
||||
@@ -141,10 +145,10 @@ static int d_option;
|
||||
static int n_option;
|
||||
static int N_option;
|
||||
static int q_option;
|
||||
-static int x_option;
|
||||
@@ -146,10 +150,10 @@ static int d_option = 0;
|
||||
static int n_option = 0;
|
||||
static int N_option = 0;
|
||||
static int q_option = 0;
|
||||
-static int x_option = 0;
|
||||
+static int x_option = 1;
|
||||
static int X_option;
|
||||
static int X_option = 0;
|
||||
|
||||
-static int map_desc_showpath;
|
||||
+static int map_desc_showpath = 1;
|
||||
|
||||
static unsigned shm_minor = ~0u;
|
||||
|
||||
@@ -522,12 +526,17 @@ static int one_proc(const proc_t * p)
|
||||
@@ -533,12 +537,17 @@ static int one_proc (struct pids_stack *
|
||||
char perms[32] = "";
|
||||
const char *cp2 = NULL;
|
||||
unsigned long long rss = 0ull;
|
||||
@ -55,12 +55,12 @@
|
||||
int maxw1=0, maxw2=0, maxw3=0, maxw4=0, maxw5=0;
|
||||
+ int maxw6=0, maxw7=0;
|
||||
|
||||
/* Overkill, but who knows what is proper? The "w" prog uses
|
||||
* the tty width to determine this.
|
||||
@@ -557,13 +566,15 @@ static int one_proc(const proc_t * p)
|
||||
printf("%u: %s\n", PIDS_VAL(tgid, s_int, p, Pids_info), PIDS_VAL(cmdline, str, p, Pids_info));
|
||||
|
||||
@@ -561,13 +570,15 @@ static int one_proc (struct pids_stack *
|
||||
if (x_option) {
|
||||
maxw1 = 16;
|
||||
if (sizeof(KLONG) == 4) maxw1 = 8;
|
||||
if (sizeof(long) == 4) maxw1 = 8;
|
||||
- maxw2 = maxw3 = maxw4 = 7;
|
||||
+ maxw2 = maxw3 = maxw4 = maxw6 = maxw7 = 7;
|
||||
maxw5 = 5;
|
||||
@ -74,7 +74,7 @@
|
||||
maxw5 = justify_print(nls_Mode, maxw5, 0);
|
||||
justify_print(nls_Mapping, 0, 0);
|
||||
}
|
||||
@@ -603,6 +614,11 @@ static int one_proc(const proc_t * p)
|
||||
@@ -607,6 +618,11 @@ static int one_proc (struct pids_stack *
|
||||
total_rss += smap_value;
|
||||
continue;
|
||||
}
|
||||
@ -86,29 +86,30 @@
|
||||
if (strcmp("Shared_Dirty", smap_key) == 0) {
|
||||
shared_dirty = smap_value;
|
||||
total_shared_dirty += smap_value;
|
||||
@@ -615,15 +631,19 @@ static int one_proc(const proc_t * p)
|
||||
@@ -619,16 +635,20 @@ static int one_proc (struct pids_stack *
|
||||
}
|
||||
if (strcmp("Swap", smap_key) == 0) {
|
||||
/* doesn't matter as long as last */
|
||||
- if (cp2) printf("%0*" KLF "x %*lu %*llu %*llu %*s %s\n",
|
||||
+ swap = smap_value;
|
||||
+ total_swap += smap_value;
|
||||
+ if (cp2) printf("%0*" KLF "x %*lu %*llu %*llu %*llu %*llu %*s %s\n",
|
||||
maxw1, start,
|
||||
maxw2, (unsigned long)(diff >> 10),
|
||||
maxw3, rss,
|
||||
+ maxw6, pss,
|
||||
maxw4, (private_dirty + shared_dirty),
|
||||
+ maxw7, swap,
|
||||
maxw5, perms,
|
||||
cp2);
|
||||
if (cp2)
|
||||
- printf("%0*lx %*lu %*llu %*llu %*s %s\n",
|
||||
+ printf("%0*lx %*lu %*llu %*llu %*llu %*llu %*s %s\n",
|
||||
maxw1, start_To_Avoid_Warning,
|
||||
maxw2, (unsigned long)(diff >> 10),
|
||||
maxw3, rss,
|
||||
+ maxw6, pss,
|
||||
maxw4, (private_dirty + shared_dirty),
|
||||
+ maxw7, swap,
|
||||
maxw5, perms,
|
||||
cp2);
|
||||
/* reset some counters */
|
||||
- rss = shared_dirty = private_dirty = 0ull;
|
||||
+ rss = pss = shared_dirty = private_dirty = swap = 0ull;
|
||||
start = diff = end = 0;
|
||||
perms[0] = '\0';
|
||||
cp2 = NULL;
|
||||
@@ -656,7 +676,6 @@ static int one_proc(const proc_t * p)
|
||||
diff = end = 0;
|
||||
perms[0] = '\0';
|
||||
cp2 = NULL;
|
||||
@@ -662,7 +682,6 @@ static int one_proc (struct pids_stack *
|
||||
if (perms[3] == 's')
|
||||
total_shared += diff;
|
||||
if (perms[3] == 'p') {
|
||||
@ -116,7 +117,7 @@
|
||||
if (perms[1] == 'w')
|
||||
total_private_writeable += diff;
|
||||
else
|
||||
@@ -708,17 +727,21 @@ static int one_proc(const proc_t * p)
|
||||
@@ -714,17 +733,21 @@ static int one_proc (struct pids_stack *
|
||||
justify_print("----------------", maxw1, 0);
|
||||
justify_print("-------", maxw2, 1);
|
||||
justify_print("-------", maxw3, 1);
|
||||
@ -140,7 +141,7 @@
|
||||
}
|
||||
if (d_option) {
|
||||
printf
|
||||
@@ -1028,16 +1051,18 @@ int main(int argc, char **argv)
|
||||
@@ -1037,16 +1060,18 @@ int main(int argc, char **argv)
|
||||
while ((c = getopt_long(argc, argv, "xXrdqA:hVcC:nN:p", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
case 'x':
|
||||
@ -162,7 +163,7 @@
|
||||
case 'q':
|
||||
q_option = 1;
|
||||
--- testsuite/pmap.test/pmap.exp
|
||||
+++ testsuite/pmap.test/pmap.exp 2018-06-05 09:23:53.955370363 +0000
|
||||
+++ testsuite/pmap.test/pmap.exp 2022-03-29 11:19:45.948044571 +0000
|
||||
@@ -8,16 +8,16 @@ set pmap_procname "${mypid}:\\s+\\S+\[^\
|
||||
set pmap_initname "1:\\s+\\S+\[^\\r\]+\\s+"
|
||||
set pmap_std_header $pmap_procname
|
||||
|
BIN
procps-ng-3.3.17.tar.xz
(Stored with Git LFS)
BIN
procps-ng-3.3.17.tar.xz
(Stored with Git LFS)
Binary file not shown.
@ -1,99 +0,0 @@
|
||||
---
|
||||
ps/common.h | 1 +
|
||||
ps/global.c | 5 ++++-
|
||||
ps/output.c | 19 ++++++++++---------
|
||||
3 files changed, 15 insertions(+), 10 deletions(-)
|
||||
|
||||
--- ps/common.h
|
||||
+++ ps/common.h 2018-04-04 11:14:33.915688098 +0000
|
||||
@@ -303,6 +303,7 @@ extern int running_only;
|
||||
extern int screen_cols;
|
||||
extern int screen_rows;
|
||||
extern time_t seconds_since_boot;
|
||||
+extern unsigned long long jiffies_since_boot;
|
||||
extern selection_node *selection_list;
|
||||
extern unsigned simple_select;
|
||||
extern sort_node *sort_list;
|
||||
--- ps/global.c
|
||||
+++ ps/global.c 2018-04-04 11:14:33.915688098 +0000
|
||||
@@ -78,6 +78,7 @@ int prefer_bsd_defaults = -1
|
||||
int screen_cols = -1;
|
||||
int screen_rows = -1;
|
||||
time_t seconds_since_boot = -1;
|
||||
+unsigned long long jiffies_since_boot = -1;
|
||||
selection_node *selection_list = (selection_node *)0xdeadbeef;
|
||||
unsigned simple_select = 0xffffffff;
|
||||
sort_node *sort_list = (sort_node *)0xdeadbeef; /* ready-to-use sort list */
|
||||
@@ -361,6 +362,7 @@ static const char *set_personality(void)
|
||||
/************ Call this to reinitialize everything ***************/
|
||||
void reset_global(void){
|
||||
static proc_t p;
|
||||
+ double uptime_secs;
|
||||
reset_selection_list();
|
||||
look_up_our_self(&p);
|
||||
set_screen_size();
|
||||
@@ -383,7 +385,8 @@ void reset_global(void){
|
||||
negate_selection = 0;
|
||||
page_size = getpagesize();
|
||||
running_only = 0;
|
||||
- seconds_since_boot = uptime(0,0);
|
||||
+ seconds_since_boot = uptime(&uptime_secs,0);
|
||||
+ jiffies_since_boot = ((long double)uptime_secs * Hertz);
|
||||
selection_list = NULL;
|
||||
simple_select = 0;
|
||||
sort_list = NULL;
|
||||
--- ps/output.c
|
||||
+++ ps/output.c 2018-04-04 11:14:33.915688098 +0000
|
||||
@@ -134,6 +134,7 @@ static int sr_ ## NAME (const proc_t* P,
|
||||
#define cook_time(P) (P->utime + P->stime) / Hertz
|
||||
|
||||
#define cook_etime(P) (((unsigned long long)seconds_since_boot >= (P->start_time / Hertz)) ? ((unsigned long long)seconds_since_boot - (P->start_time / Hertz)) : 0)
|
||||
+#define cook_jtime(P) (((unsigned long long)jiffies_since_boot >= (P->start_time)) ? ((unsigned long long)jiffies_since_boot - (P->start_time)) : 0)
|
||||
|
||||
#define CMP_COOKED_TIME(NAME) \
|
||||
static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \
|
||||
@@ -507,11 +508,11 @@ static int pr_etimes(char *restrict cons
|
||||
static int pr_c(char *restrict const outbuf, const proc_t *restrict const pp){
|
||||
unsigned long long total_time; /* jiffies used by this process */
|
||||
unsigned pcpu = 0; /* scaled %cpu, 99 means 99% */
|
||||
- unsigned long long seconds; /* seconds of process life */
|
||||
+ unsigned long long jiffies; /* jiffies of process life */
|
||||
total_time = pp->utime + pp->stime;
|
||||
if(include_dead_children) total_time += (pp->cutime + pp->cstime);
|
||||
- seconds = cook_etime(pp);
|
||||
- if(seconds) pcpu = (total_time * 100ULL / Hertz) / seconds;
|
||||
+ jiffies = cook_jtime(pp);
|
||||
+ if(jiffies) pcpu = (total_time * 100ULL) / jiffies;
|
||||
if (pcpu > 99U) pcpu = 99U;
|
||||
return snprintf(outbuf, COLWID, "%2u", pcpu);
|
||||
}
|
||||
@@ -519,11 +520,11 @@ static int pr_c(char *restrict const out
|
||||
static int pr_pcpu(char *restrict const outbuf, const proc_t *restrict const pp){
|
||||
unsigned long long total_time; /* jiffies used by this process */
|
||||
unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */
|
||||
- unsigned long long seconds; /* seconds of process life */
|
||||
+ unsigned long long jiffies; /* jiffies of process life */
|
||||
total_time = pp->utime + pp->stime;
|
||||
if(include_dead_children) total_time += (pp->cutime + pp->cstime);
|
||||
- seconds = cook_etime(pp);
|
||||
- if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds;
|
||||
+ jiffies = cook_jtime(pp);
|
||||
+ if(jiffies) pcpu = (total_time * 1000ULL) / jiffies;
|
||||
if (pcpu > 999U)
|
||||
return snprintf(outbuf, COLWID, "%u", pcpu/10U);
|
||||
return snprintf(outbuf, COLWID, "%u.%u", pcpu/10U, pcpu%10U);
|
||||
@@ -532,11 +533,11 @@ static int pr_pcpu(char *restrict const
|
||||
static int pr_cp(char *restrict const outbuf, const proc_t *restrict const pp){
|
||||
unsigned long long total_time; /* jiffies used by this process */
|
||||
unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */
|
||||
- unsigned long long seconds; /* seconds of process life */
|
||||
+ unsigned long long jiffies; /* jiffies of process life */
|
||||
total_time = pp->utime + pp->stime;
|
||||
if(include_dead_children) total_time += (pp->cutime + pp->cstime);
|
||||
- seconds = cook_etime(pp);
|
||||
- if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds;
|
||||
+ jiffies = cook_jtime(pp);
|
||||
+ if(jiffies) pcpu = (total_time * 1000ULL) / jiffies;
|
||||
if (pcpu > 999U) pcpu = 999U;
|
||||
return snprintf(outbuf, COLWID, "%3u", pcpu);
|
||||
}
|
@ -12,7 +12,7 @@ Index: procps-3.2.8/top.c
|
||||
|
||||
--- top/top.c
|
||||
+++ top/top.c 2018-04-04 11:33:59.278280201 +0000
|
||||
@@ -3691,7 +3691,13 @@ static void before (char *me) {
|
||||
@@ -3557,7 +3557,13 @@ static void before (char *me) {
|
||||
sa.sa_flags = 0;
|
||||
for (i = SIGRTMAX; i; i--) {
|
||||
switch (i) {
|
||||
|
@ -13,7 +13,7 @@ Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
|
||||
--- a/sysctl.c
|
||||
+++ b/sysctl.c
|
||||
@@ -59,6 +59,7 @@ static const char DEFAULT_PRELOAD[] = "/
|
||||
@@ -58,6 +58,7 @@ static const char DEFAULT_PRELOAD[] = "/
|
||||
static const char *DEPRECATED[] = {
|
||||
"base_reachable_time",
|
||||
"retrans_time",
|
||||
|
@ -3,9 +3,9 @@
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- top/top.c
|
||||
+++ top/top.c 2018-04-04 11:49:56.472660056 +0000
|
||||
@@ -1626,9 +1626,9 @@ static inline const char *make_str_utf8
|
||||
static const char *scale_mem (int target, unsigned long num, int width, int justr) {
|
||||
+++ top/top.c 2022-03-29 10:24:43.327490984 +0000
|
||||
@@ -1564,9 +1564,9 @@ static inline const char *make_str_utf8
|
||||
static const char *scale_mem (int target, float num, int width, int justr) {
|
||||
// SK_Kb SK_Mb SK_Gb SK_Tb SK_Pb SK_Eb
|
||||
#ifdef BOOST_MEMORY
|
||||
- static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL };
|
||||
@ -15,13 +15,13 @@
|
||||
+ static const char *fmttab[] = { "%.0f", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", NULL };
|
||||
#endif
|
||||
static char buf[SMLBUFSIZ];
|
||||
float scaled_num;
|
||||
@@ -1640,7 +1640,7 @@ static const char *scale_mem (int target
|
||||
char *psfx;
|
||||
@@ -1576,7 +1576,7 @@ static const char *scale_mem (int target
|
||||
if (Rc.zero_suppress && 0 >= num)
|
||||
goto end_justifies;
|
||||
|
||||
scaled_num = num;
|
||||
- for (i = SK_Kb, psfx = Scaled_sfxtab; i < SK_Eb; psfx++, i++) {
|
||||
+ for (i = SK_Kb, psfx = Scaled_sfxtab; i <= SK_Eb; psfx++, i++) {
|
||||
if (i >= target
|
||||
&& (width >= snprintf(buf, sizeof(buf), fmttab[i], scaled_num, *psfx)))
|
||||
&& (width >= snprintf(buf, sizeof(buf), fmttab[i], num, *psfx)))
|
||||
goto end_justifies;
|
||||
|
@ -3,9 +3,9 @@
|
||||
1 file changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
--- proc/readproc.c
|
||||
+++ proc/readproc.c 2018-06-05 08:54:06.408030693 +0000
|
||||
@@ -675,7 +675,7 @@ static int file2str(const char *director
|
||||
else ub->buf = xcalloc((ub->siz = buffGRW));
|
||||
+++ proc/readproc.c 2022-03-28 11:51:04.751862744 +0000
|
||||
@@ -728,7 +728,7 @@ static int file2str(const char *director
|
||||
}
|
||||
len = snprintf(path, sizeof path, "%s/%s", directory, what);
|
||||
if (len <= 0 || (size_t)len >= sizeof path) return -1;
|
||||
- if (-1 == (fd = open(path, O_RDONLY, 0))) return -1;
|
||||
@ -13,9 +13,9 @@
|
||||
while (0 < (num = read(fd, ub->buf + tot_read, ub->siz - tot_read))) {
|
||||
tot_read += num;
|
||||
if (tot_read < ub->siz) break;
|
||||
@@ -695,25 +695,25 @@ static int file2str(const char *director
|
||||
static char** file2strvec(const char* directory, const char* what) {
|
||||
char buf[2048]; /* read buf bytes at a time */
|
||||
@@ -752,25 +752,25 @@ static int file2str(const char *director
|
||||
static char **file2strvec(const char *directory, const char *what) {
|
||||
char buf[2048]; /* read buf bytes at a time */
|
||||
char *p, *rbuf = 0, *endbuf, **q, **ret, *strp;
|
||||
- int fd, tot = 0, n, c, end_of_file = 0;
|
||||
- int align;
|
||||
@ -30,37 +30,37 @@
|
||||
|
||||
/* read whole file into a memory buffer, allocating as we go */
|
||||
while ((n = read(fd, buf, sizeof buf - 1)) >= 0) {
|
||||
- if (n < (int)(sizeof buf - 1))
|
||||
+ if (n < sizeof buf - 1)
|
||||
end_of_file = 1;
|
||||
- if (n <= 0 && tot <= 0) { /* nothing read now, nothing read before */
|
||||
+ if (n <= 0 && tot <= 0) /* nothing read now, nothing read before */
|
||||
break; /* process died between our open and read */
|
||||
- }
|
||||
- if (n < (int)(sizeof buf - 1))
|
||||
+ if (n < (sizeof(buf) - 1))
|
||||
end_of_file = 1;
|
||||
- if (n <= 0 && tot <= 0) { /* nothing read now, nothing read before */
|
||||
+ if (n <= 0 && tot <= 0) /* nothing read now, nothing read before */
|
||||
break; /* process died between our open and read */
|
||||
- }
|
||||
+
|
||||
/* ARG_LEN is our guesstimated median length of a command-line argument
|
||||
or environment variable (the minimum is 1, the maximum is 131072) */
|
||||
#define ARG_LEN 64
|
||||
- if (tot >= INT_MAX / (ARG_LEN + (int)sizeof(char*)) * ARG_LEN - n) {
|
||||
+ if (tot >= INT_MAX / (ARG_LEN + sizeof(char*)) * ARG_LEN - n) {
|
||||
end_of_file = 1; /* integer overflow: null-terminate and break */
|
||||
n = 0; /* but tot > 0 */
|
||||
}
|
||||
@@ -741,7 +741,7 @@ static char** file2strvec(const char* di
|
||||
c = sizeof(char*); /* one extra for NULL term */
|
||||
/* ARG_LEN is our guesstimated median length of a command-line argument
|
||||
or environment variable (the minimum is 1, the maximum is 131072) */
|
||||
#define ARG_LEN 64
|
||||
- if (tot >= INT_MAX / (ARG_LEN + (int)sizeof(char*)) * ARG_LEN - n) {
|
||||
+ if (tot >= INT_MAX / (ARG_LEN + sizeof(char*)) * ARG_LEN - n) {
|
||||
end_of_file = 1; /* integer overflow: null-terminate and break */
|
||||
n = 0; /* but tot > 0 */
|
||||
}
|
||||
@@ -804,7 +804,7 @@ static char **file2strvec(const char *di
|
||||
c = sizeof(char*); /* one extra for NULL term */
|
||||
for (p = rbuf; p < endbuf; p++) {
|
||||
if (!*p || *p == '\n') {
|
||||
- if (c >= INT_MAX - (tot + (int)sizeof(char*) + align)) break;
|
||||
+ if (c >= INT_MAX - (tot + sizeof(char*) + align)) break;
|
||||
c += sizeof(char*);
|
||||
}
|
||||
if (*p == '\n')
|
||||
@@ -753,7 +753,7 @@ static char** file2strvec(const char* di
|
||||
q = ret = (char**) (endbuf+align); /* ==> free(*ret) to dealloc */
|
||||
if (!*p || *p == '\n') {
|
||||
- if (c >= INT_MAX - (tot + (int)sizeof(char*) + align)) break;
|
||||
+ if (c >= INT_MAX - (tot + sizeof(char*) + align)) break;
|
||||
c += sizeof(char*);
|
||||
}
|
||||
if (*p == '\n')
|
||||
@@ -817,7 +817,7 @@ static char **file2strvec(const char *di
|
||||
q = ret = (char**) (endbuf+align); /* ==> free(*ret) to dealloc */
|
||||
for (strp = p = rbuf; p < endbuf; p++) {
|
||||
if (!*p) { /* NUL char implies that */
|
||||
- if (c < 2 * (int)sizeof(char*)) break;
|
||||
+ if (c < 2 * sizeof(char*)) break;
|
||||
c -= sizeof(char*);
|
||||
*q++ = strp; /* point ptrs to the strings */
|
||||
strp = p+1; /* next string -> next char */
|
||||
if (!*p) { /* NUL char implies that */
|
||||
- if (c < 2 * (int)sizeof(char*)) break;
|
||||
+ if (c < 2 * sizeof(char*)) break;
|
||||
c -= sizeof(char*);
|
||||
*q++ = strp; /* point ptrs to the strings */
|
||||
strp = p+1; /* next string -> next char */
|
||||
|
@ -4,9 +4,9 @@
|
||||
2 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- Makefile.am
|
||||
+++ Makefile.am 2018-04-04 12:28:14.937957527 +0000
|
||||
@@ -171,7 +171,7 @@ else
|
||||
slabtop_LDADD = $(LDADD) @NCURSES_LIBS@
|
||||
+++ Makefile.am 2022-03-29 10:32:27.691037616 +0000
|
||||
@@ -190,7 +190,7 @@ if CYGWIN
|
||||
top_top_SOURCES += lib/strverscmp.c
|
||||
endif
|
||||
|
||||
-top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB)
|
||||
@ -15,8 +15,8 @@
|
||||
|
||||
if BUILD_SKILL
|
||||
--- configure.ac
|
||||
+++ configure.ac 2018-04-04 12:29:23.364676155 +0000
|
||||
@@ -194,8 +194,16 @@ else
|
||||
+++ configure.ac 2022-03-29 10:33:50.621534246 +0000
|
||||
@@ -233,8 +233,16 @@ else
|
||||
else
|
||||
WATCH_NCURSES_LIBS="$NCURSES_LIBS"
|
||||
fi
|
||||
@ -31,5 +31,5 @@
|
||||
AC_SUBST([NCURSES_LIBS])
|
||||
+AC_SUBST([TOP_NCURSES_LIBS])
|
||||
AC_SUBST([WATCH_NCURSES_LIBS])
|
||||
AC_SUBST([WATCH_NCURSES_CFLAGS])
|
||||
|
||||
AC_ARG_WITH([systemd],
|
||||
|
@ -3,15 +3,15 @@
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- vmstat.c
|
||||
+++ vmstat.c 2016-07-11 13:18:04.993371059 +0000
|
||||
@@ -273,8 +273,8 @@ static void new_header(void)
|
||||
+++ vmstat.c 2022-03-29 10:36:49.654287539 +0000
|
||||
@@ -337,8 +337,8 @@ static void new_header(void)
|
||||
|
||||
static unsigned long unitConvert(unsigned long size)
|
||||
{
|
||||
- float cvSize;
|
||||
- cvSize = (float)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
|
||||
+ long double cvSize;
|
||||
+ cvSize = (long double)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
|
||||
return ((unsigned long)cvSize);
|
||||
- float cvSize;
|
||||
- cvSize = (float)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
|
||||
+ long double cvSize;
|
||||
+ cvSize = (long double)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
|
||||
return ((unsigned long)cvSize);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
2 files changed, 18 insertions(+), 3 deletions(-)
|
||||
|
||||
--- w.1
|
||||
+++ w.1 2021-02-10 09:47:10.894888530 +0000
|
||||
+++ w.1 2022-03-23 15:02:32.728894724 +0000
|
||||
@@ -40,6 +40,9 @@ and a
|
||||
\fB\-s\fR, \fB\-\-short\fR
|
||||
Use the short format. Don't print the login time, JCPU or PCPU times.
|
||||
@ -16,32 +16,32 @@
|
||||
Toggle printing the
|
||||
.B from
|
||||
--- w.c
|
||||
+++ w.c 2021-02-10 09:51:09.750284453 +0000
|
||||
@@ -394,7 +394,7 @@ static const proc_t *getproc(const utmp_
|
||||
}
|
||||
+++ w.c 2022-03-28 11:20:25.453174765 +0000
|
||||
@@ -450,7 +450,7 @@ static int find_best_proc(
|
||||
|
||||
static void showinfo(utmp_t * u, int formtype, int maxcmd, int from,
|
||||
- const int userlen, const int fromlen, const int ip_addresses)
|
||||
+ int userlen, int fromlen, const int ip_addresses)
|
||||
static void showinfo(
|
||||
utmp_t * u, int formtype, int maxcmd, int from,
|
||||
- const int userlen, const int fromlen, const int ip_addresses)
|
||||
+ int userlen, int fromlen, const int ip_addresses)
|
||||
{
|
||||
unsigned long long jcpu;
|
||||
int ut_pid_found;
|
||||
@@ -424,7 +424,13 @@ static void showinfo(utmp_t * u, int for
|
||||
strncpy(uname, u->ut_user, UT_NAMESIZE);
|
||||
unsigned long long jcpu, pcpu;
|
||||
unsigned i;
|
||||
@@ -481,7 +481,13 @@ static void showinfo(
|
||||
strncpy(uname, u->ut_user, UT_NAMESIZE);
|
||||
|
||||
if (formtype) {
|
||||
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, u->ut_line);
|
||||
+ int utlnlen = 8;
|
||||
+ if (formtype > 1) {
|
||||
+ userlen = strnlen(uname, UT_NAMESIZE);
|
||||
+ fromlen = strnlen(u->ut_host, UT_HOSTSIZE);
|
||||
+ utlnlen = strnlen(u->ut_line, UT_LINESIZE);
|
||||
+ }
|
||||
+ printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, u->ut_line);
|
||||
if (from)
|
||||
print_from(u, ip_addresses, fromlen);
|
||||
if (formtype) {
|
||||
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, u->ut_line);
|
||||
+ int utlnlen = 8;
|
||||
+ if (formtype > 1) {
|
||||
+ userlen = strnlen(uname, UT_NAMESIZE);
|
||||
+ fromlen = strnlen(u->ut_host, UT_HOSTSIZE);
|
||||
+ utlnlen = strnlen(u->ut_line, UT_LINESIZE);
|
||||
+ }
|
||||
+ printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, u->ut_line);
|
||||
if (from)
|
||||
print_from(u, ip_addresses, fromlen);
|
||||
#ifdef HAVE_UTMPX_H
|
||||
@@ -478,6 +484,7 @@ static void __attribute__ ((__noreturn__
|
||||
@@ -526,6 +532,7 @@ static void __attribute__ ((__noreturn__
|
||||
fputs(_(" -h, --no-header do not print header\n"),out);
|
||||
fputs(_(" -u, --no-current ignore current process username\n"),out);
|
||||
fputs(_(" -s, --short short format\n"),out);
|
||||
@ -49,7 +49,7 @@
|
||||
fputs(_(" -f, --from show remote hostname field\n"),out);
|
||||
fputs(_(" -o, --old-style old style output\n"),out);
|
||||
fputs(_(" -i, --ip-addr display IP address instead of hostname (if possible)\n"), out);
|
||||
@@ -514,6 +521,7 @@ int main(int argc, char **argv)
|
||||
@@ -562,6 +569,7 @@ int main(int argc, char **argv)
|
||||
{"no-header", no_argument, NULL, 'h'},
|
||||
{"no-current", no_argument, NULL, 'u'},
|
||||
{"short", no_argument, NULL, 's'},
|
||||
@ -57,7 +57,7 @@
|
||||
{"from", no_argument, NULL, 'f'},
|
||||
{"old-style", no_argument, NULL, 'o'},
|
||||
{"ip-addr", no_argument, NULL, 'i'},
|
||||
@@ -535,7 +543,7 @@ int main(int argc, char **argv)
|
||||
@@ -583,7 +591,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
while ((ch =
|
||||
@ -66,7 +66,7 @@
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
header = 0;
|
||||
@@ -546,6 +554,10 @@ int main(int argc, char **argv)
|
||||
@@ -591,6 +599,10 @@ int main(int argc, char **argv)
|
||||
case 's':
|
||||
longform = 0;
|
||||
break;
|
||||
|
165
procps-ng-4.0.0-accuracy.dif
Normal file
165
procps-ng-4.0.0-accuracy.dif
Normal file
@ -0,0 +1,165 @@
|
||||
---
|
||||
proc/pids.c | 18 +++++++++++++++---
|
||||
proc/pids.h | 1 +
|
||||
ps/common.h | 3 +++
|
||||
ps/global.c | 3 ++-
|
||||
ps/output.c | 18 +++++++++---------
|
||||
5 files changed, 30 insertions(+), 13 deletions(-)
|
||||
|
||||
--- proc/pids.c
|
||||
+++ proc/pids.c 2022-03-29 09:03:09.393258037 +0000
|
||||
@@ -92,6 +92,7 @@ struct pids_info {
|
||||
PROCTAB *fetch_PT; // oldlib interface for 'select' & 'reap'
|
||||
unsigned long hertz; // for the 'TIME' & 'UTILIZATION' calculations
|
||||
double boot_seconds; // for TIME_ELAPSED & 'UTILIZATION' calculations
|
||||
+ unsigned long long boot_tics; // for TIME_ELAPSED & 'UTILIZATION' calculations
|
||||
PROCTAB *get_PT; // oldlib interface for active 'get'
|
||||
struct stacks_extent *get_ext; // for active 'get' (also within 'extents')
|
||||
enum pids_fetch_type get_type; // last known type of 'get' request
|
||||
@@ -282,6 +283,7 @@ setDECL(TICS_USER_C) { (void)I; R->re
|
||||
setDECL(TIME_ALL) { R->result.real = ((double)P->utime + P->stime) / I->hertz; }
|
||||
setDECL(TIME_ALL_C) { R->result.real = ((double)P->utime + P->stime + P->cutime + P->cstime) / I->hertz; }
|
||||
setDECL(TIME_ELAPSED) { double t = (double)P->start_time / I->hertz; R->result.real = I->boot_seconds > t ? I->boot_seconds - t : 0; }
|
||||
+setDECL(TICS_ELAPSED) { R->result.ull_int = I->boot_tics >= P->start_time ? I->boot_tics - P->start_time : 0; }
|
||||
setDECL(TIME_START) { R->result.real = (double)P->start_time / I->hertz; }
|
||||
REG_set(TTY, s_int, tty)
|
||||
setDECL(TTY_NAME) { char buf[64]; freNAME(str)(R); dev_to_tty(buf, sizeof(buf), P->tty, P->tid, ABBREV_DEV); if (!(R->result.str = strdup(buf))) I->seterr = 1; }
|
||||
@@ -571,6 +573,7 @@ static struct {
|
||||
{ RS(TIME_ALL), f_stat, NULL, QS(real), 0, TS(real) },
|
||||
{ RS(TIME_ALL_C), f_stat, NULL, QS(real), 0, TS(real) },
|
||||
{ RS(TIME_ELAPSED), f_stat, NULL, QS(real), 0, TS(real) },
|
||||
+ { RS(TICS_ELAPSED), f_stat, NULL, QS(ull_int), 0, TS(ull_int) },
|
||||
{ RS(TIME_START), f_stat, NULL, QS(real), 0, TS(real) },
|
||||
{ RS(TTY), f_stat, NULL, QS(s_int), 0, TS(s_int) },
|
||||
{ RS(TTY_NAME), f_stat, FF(str), QS(strvers), 0, TS(str) },
|
||||
@@ -1441,8 +1444,11 @@ fresh_start:
|
||||
/* when in a namespace with proc mounted subset=pid,
|
||||
we will be restricted to process information only */
|
||||
info->boot_seconds = 0;
|
||||
- if (0 >= procps_uptime(&up_secs, NULL))
|
||||
+ info->boot_tics = 0;
|
||||
+ if (0 >= procps_uptime(&up_secs, NULL)) {
|
||||
info->boot_seconds = up_secs;
|
||||
+ info->boot_tics = up_secs * info->hertz;
|
||||
+ }
|
||||
|
||||
if (NULL == info->read_something(info->get_PT, &info->get_proc))
|
||||
return NULL;
|
||||
@@ -1484,8 +1490,11 @@ PROCPS_EXPORT struct pids_fetch *procps_
|
||||
/* when in a namespace with proc mounted subset=pid,
|
||||
we will be restricted to process information only */
|
||||
info->boot_seconds = 0;
|
||||
- if (0 >= procps_uptime(&up_secs, NULL))
|
||||
+ info->boot_tics = 0;
|
||||
+ if (0 >= procps_uptime(&up_secs, NULL)) {
|
||||
info->boot_seconds = up_secs;
|
||||
+ info->boot_tics = up_secs * info->hertz;
|
||||
+ }
|
||||
|
||||
rc = pids_stacks_fetch(info);
|
||||
|
||||
@@ -1589,8 +1598,11 @@ PROCPS_EXPORT struct pids_fetch *procps_
|
||||
/* when in a namespace with proc mounted subset=pid,
|
||||
we will be restricted to process information only */
|
||||
info->boot_seconds = 0;
|
||||
- if (0 >= procps_uptime(&up_secs, NULL))
|
||||
+ info->boot_tics = 0;
|
||||
+ if (0 >= procps_uptime(&up_secs, NULL)) {
|
||||
info->boot_seconds = up_secs;
|
||||
+ info->boot_tics = up_secs * info->hertz;
|
||||
+ }
|
||||
|
||||
rc = pids_stacks_fetch(info);
|
||||
|
||||
--- proc/pids.h
|
||||
+++ proc/pids.h 2022-03-29 08:49:51.387887553 +0000
|
||||
@@ -165,6 +165,7 @@ enum pids_item {
|
||||
PIDS_TIME_ALL, // real derived from stat: (utime + stime) / hertz
|
||||
PIDS_TIME_ALL_C, // real derived from stat: (utime + stime + cutime + cstime) / hertz
|
||||
PIDS_TIME_ELAPSED, // real derived from /proc/uptime - (starttime / hertz)
|
||||
+ PIDS_TICS_ELAPSED, // ull_int derived from /proc/uptime - starttime
|
||||
PIDS_TIME_START, // real derived from stat: start_time / hertz
|
||||
PIDS_TTY, // s_int stat: tty_nr
|
||||
PIDS_TTY_NAME, // str derived from TTY
|
||||
--- ps/common.h
|
||||
+++ ps/common.h 2022-03-29 09:09:43.058036196 +0000
|
||||
@@ -42,6 +42,8 @@
|
||||
#define namREL(e) rel_ ## e
|
||||
#define makEXT(e) extern int namREL(e);
|
||||
#define makREL(e) int namREL(e) = -1;
|
||||
+#define makEXTULL(e) extern unsigned long long namREL(e);
|
||||
+#define makRELULL(e) unsigned long long namREL(e) = -1;
|
||||
#define chkREL(e) if (namREL(e) < 0) { \
|
||||
Pids_items[Pids_index] = PIDS_ ## e; \
|
||||
namREL(e) = (Pids_index < PIDSITEMS) ? Pids_index++ : rel_noop; }
|
||||
@@ -160,6 +162,7 @@ makEXT(TICS_ALL)
|
||||
makEXT(TICS_ALL_C)
|
||||
makEXT(TIME_ALL)
|
||||
makEXT(TIME_ELAPSED)
|
||||
+makEXT(TICS_ELAPSED)
|
||||
makEXT(TICS_BEGAN)
|
||||
makEXT(TTY)
|
||||
makEXT(TTY_NAME)
|
||||
--- ps/global.c
|
||||
+++ ps/global.c 2022-03-29 09:09:20.382452269 +0000
|
||||
@@ -141,6 +141,7 @@ makREL(TICS_ALL)
|
||||
makREL(TICS_ALL_C)
|
||||
makREL(TIME_ALL)
|
||||
makREL(TIME_ELAPSED)
|
||||
+makREL(TICS_ELAPSED)
|
||||
makREL(TICS_BEGAN)
|
||||
makREL(TTY)
|
||||
makREL(TTY_NAME)
|
||||
--- ps/output.c
|
||||
+++ ps/output.c 2022-03-29 09:07:05.620924770 +0000
|
||||
@@ -517,13 +517,13 @@ setREL1(TIME_ELAPSED)
|
||||
static int pr_c(char *restrict const outbuf, const proc_t *restrict const pp){
|
||||
unsigned long long total_time; /* jiffies used by this process */
|
||||
unsigned pcpu; /* scaled %cpu, 99 means 99% */
|
||||
- unsigned long long seconds; /* seconds of process life */
|
||||
+ unsigned long long jiffies; /* jiffies of process life */
|
||||
setREL4(TICS_ALL,TICS_ALL_C,TIME_ELAPSED,UTILIZATION)
|
||||
pcpu = 0;
|
||||
if(include_dead_children) total_time = rSv(TICS_ALL_C, ull_int, pp);
|
||||
else total_time = rSv(TICS_ALL, ull_int, pp);
|
||||
- seconds = rSv(TIME_ELAPSED, real, pp);
|
||||
- if(seconds) pcpu = (total_time * 100ULL / Hertz) / seconds;
|
||||
+ jiffies = rSv(TICS_ELAPSED, ull_int, pp);
|
||||
+ if(jiffies) pcpu = (total_time * 100ULL) / jiffies;
|
||||
if (pcpu > 99U) pcpu = 99U;
|
||||
return snprintf(outbuf, COLWID, "%2u", pcpu);
|
||||
}
|
||||
@@ -532,13 +532,13 @@ setREL4(TICS_ALL,TICS_ALL_C,TIME_ELAPSED
|
||||
static int pr_pcpu(char *restrict const outbuf, const proc_t *restrict const pp){
|
||||
unsigned long long total_time; /* jiffies used by this process */
|
||||
unsigned pcpu; /* scaled %cpu, 999 means 99.9% */
|
||||
- unsigned long long seconds; /* seconds of process life */
|
||||
+ unsigned long long jiffies; /* jiffies of process life */
|
||||
setREL4(TICS_ALL,TICS_ALL_C,TIME_ELAPSED,UTILIZATION)
|
||||
pcpu = 0;
|
||||
if(include_dead_children) total_time = rSv(TICS_ALL_C, ull_int, pp);
|
||||
else total_time = rSv(TICS_ALL, ull_int, pp);
|
||||
- seconds = rSv(TIME_ELAPSED, real, pp);
|
||||
- if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds;
|
||||
+ jiffies = rSv(TICS_ELAPSED, ull_int, pp);
|
||||
+ if(jiffies) pcpu = (total_time * 1000ULL) / jiffies;
|
||||
if (pcpu > 999U)
|
||||
return snprintf(outbuf, COLWID, "%u", pcpu/10U);
|
||||
return snprintf(outbuf, COLWID, "%u.%u", pcpu/10U, pcpu%10U);
|
||||
@@ -548,13 +548,13 @@ setREL4(TICS_ALL,TICS_ALL_C,TIME_ELAPSED
|
||||
static int pr_cp(char *restrict const outbuf, const proc_t *restrict const pp){
|
||||
unsigned long long total_time; /* jiffies used by this process */
|
||||
unsigned pcpu; /* scaled %cpu, 999 means 99.9% */
|
||||
- unsigned long long seconds; /* seconds of process life */
|
||||
+ unsigned long long jiffies; /* jiffies of process life */
|
||||
setREL4(TICS_ALL,TICS_ALL_C,TIME_ELAPSED,UTILIZATION)
|
||||
pcpu = 0;
|
||||
if(include_dead_children) total_time = rSv(TICS_ALL_C, ull_int, pp);
|
||||
else total_time = rSv(TICS_ALL, ull_int, pp);
|
||||
- seconds = rSv(TIME_ELAPSED, real, pp);
|
||||
- if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds;
|
||||
+ jiffies = rSv(TICS_ELAPSED, ull_int, pp);
|
||||
+ if(jiffies) pcpu = (total_time * 1000ULL) / jiffies;
|
||||
if (pcpu > 999U) pcpu = 999U;
|
||||
return snprintf(outbuf, COLWID, "%3u", pcpu);
|
||||
}
|
26
procps-ng-4.0.0-integer-overflow.patch
Normal file
26
procps-ng-4.0.0-integer-overflow.patch
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
proc/meminfo.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- proc/meminfo.c
|
||||
+++ proc/meminfo.c 2022-03-29 09:50:45.076823155 +0000
|
||||
@@ -710,7 +710,9 @@ static int meminfo_read_failed (
|
||||
mHr(derived_mem_used) = (unsigned long)mem_used;
|
||||
|
||||
if (mHr(HighFree) < mHr(HighTotal))
|
||||
- mHr(derived_mem_hi_used) = mHr(HighTotal) - mHr(HighFree);
|
||||
+ mHr(derived_mem_hi_used) = mHr(HighTotal) - mHr(HighFree);
|
||||
+ else
|
||||
+ mHr(derived_mem_hi_used) = 0;
|
||||
|
||||
if (0 == mHr(LowTotal)) {
|
||||
mHr(LowTotal) = mHr(MemTotal);
|
||||
@@ -718,6 +720,8 @@ static int meminfo_read_failed (
|
||||
}
|
||||
if (mHr(LowFree) < mHr(LowTotal))
|
||||
mHr(derived_mem_lo_used) = mHr(LowTotal) - mHr(LowFree);
|
||||
+ else
|
||||
+ mHr(derived_mem_lo_used) = 0;
|
||||
|
||||
if (mHr(SwapFree) < mHr(SwapTotal))
|
||||
mHr(derived_swap_used) = mHr(SwapTotal) - mHr(SwapFree);
|
3
procps-ng-4.0.0.tar.xz
Normal file
3
procps-ng-4.0.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f4d92794edb7a1c95bb3b8c1f823de62be5d0043459c2155fd07fa859c16513
|
||||
size 1002084
|
@ -3,8 +3,8 @@
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
--- ps/global.c
|
||||
+++ ps/global.c 2016-07-11 13:04:59.600533764 +0000
|
||||
@@ -147,8 +147,11 @@ static void set_screen_size(void){
|
||||
+++ ps/global.c 2022-03-29 09:31:24.242140877 +0000
|
||||
@@ -257,8 +257,11 @@ static void set_screen_size(void){
|
||||
screen_cols = ws.ws_col; // hmmm, NetBSD subtracts 1
|
||||
screen_rows = ws.ws_row;
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
columns = getenv("COLUMNS");
|
||||
if(columns && *columns){
|
||||
@@ -290,6 +293,7 @@ static const char *set_personality(void)
|
||||
@@ -400,6 +403,7 @@ static const char *set_personality(void)
|
||||
return NULL;
|
||||
|
||||
case_aix:
|
||||
@ -26,7 +26,7 @@
|
||||
bsd_j_format = "FB_j";
|
||||
bsd_l_format = "FB_l";
|
||||
/* bsd_s_format not used */
|
||||
@@ -317,6 +321,7 @@ static const char *set_personality(void)
|
||||
@@ -427,6 +431,7 @@ static const char *set_personality(void)
|
||||
|
||||
case_sunos4:
|
||||
personality = PER_NO_DEFAULT_g;
|
||||
@ -34,7 +34,7 @@
|
||||
prefer_bsd_defaults = 1;
|
||||
bsd_j_format = "FB_j";
|
||||
bsd_l_format = "FB_l";
|
||||
@@ -342,12 +347,14 @@ static const char *set_personality(void)
|
||||
@@ -452,12 +457,14 @@ static const char *set_personality(void)
|
||||
case_hp:
|
||||
case_hpux:
|
||||
personality = PER_HPUX_x;
|
||||
@ -49,10 +49,10 @@
|
||||
return NULL;
|
||||
|
||||
case_posix:
|
||||
@@ -365,8 +372,8 @@ void reset_global(void){
|
||||
double uptime_secs;
|
||||
reset_selection_list();
|
||||
look_up_our_self(&p);
|
||||
@@ -498,8 +505,8 @@ void reset_global(void){
|
||||
}
|
||||
// --- <pids> interface --------------------------------------------------
|
||||
|
||||
- set_screen_size();
|
||||
set_personality();
|
||||
+ set_screen_size();
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- proc/devname.c
|
||||
+++ proc/devname.c 2012-06-01 13:35:43.452010553 +0000
|
||||
@@ -53,6 +53,10 @@
|
||||
@@ -51,6 +51,10 @@
|
||||
#define minor <-- do not use -->
|
||||
#endif
|
||||
|
||||
|
@ -4,35 +4,35 @@
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
--- sysctl.8
|
||||
+++ sysctl.8 2021-02-10 10:05:27.781748090 +0000
|
||||
@@ -81,6 +81,8 @@ directories in the following list in giv
|
||||
Once a file of a given filename is loaded, any file of the same name
|
||||
in subsequent directories is ignored.
|
||||
.br
|
||||
+++ sysctl.8 2022-03-29 10:21:47.926686046 +0000
|
||||
@@ -117,6 +117,8 @@ will read files from directories in the
|
||||
order from top to bottom. Once a file of a given filename is loaded, any
|
||||
file of the same name in subsequent directories is ignored.
|
||||
|
||||
+/boot/sysctl.conf-<kernelversion>
|
||||
+.br
|
||||
/etc/sysctl.d/*.conf
|
||||
.br
|
||||
/run/sysctl.d/*.conf
|
||||
--- sysctl.c
|
||||
+++ sysctl.c 2021-02-10 10:04:25.290952318 +0000
|
||||
@@ -39,6 +39,7 @@
|
||||
+++ sysctl.c 2022-03-29 10:20:51.795708321 +0000
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/utsname.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "c.h"
|
||||
@@ -621,6 +622,7 @@ static int sortpairs(const void *A, cons
|
||||
static int PreloadSystem(void)
|
||||
@@ -794,6 +795,7 @@ static int sortpairs(const void *A, cons
|
||||
static int PreloadSystem(SettingList *setlist)
|
||||
{
|
||||
unsigned di, i;
|
||||
+ struct utsname uts;
|
||||
const char *dirs[] = {
|
||||
"/etc/sysctl.d",
|
||||
"/run/sysctl.d",
|
||||
@@ -685,6 +687,16 @@ static int PreloadSystem(void)
|
||||
@@ -858,6 +860,16 @@ static int PreloadSystem(SettingList *se
|
||||
}
|
||||
qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
+ if (access(buf, R_OK) == 0) {
|
||||
+ if (!Quiet)
|
||||
+ printf("* Applying %s ...\n", buf);
|
||||
+ Preload(buf);
|
||||
+ Preload(setlist, buf);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -1,3 +1,68 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 29 12:49:48 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- Update to procps-ng-4.0.0
|
||||
+ Warning: new shared library interface with libproc-2
|
||||
* Rename pwait to pidwait
|
||||
* free: Add committed line option merge #25
|
||||
* free: Fix -h --si combined options issue #133, #223
|
||||
* free: Fix first column justification issue #229, #204, #206, Debian #1001689
|
||||
* free: Better spacing for Chinese language issue #213
|
||||
* library: renamed to libproc-2 and reset to 0:0:0
|
||||
* library: add support for accessing smaps_rollup issue #112, #201
|
||||
* library: add support for accessing autogroups
|
||||
* library: add support for LIBPROC_HIDE_KERNEL env var merge #147
|
||||
* library: add support for cpu utilization to pids i/f
|
||||
* pkill: Check for lt- variants of program name issue #192
|
||||
* pgrep: Add newline after regex error message merge #91
|
||||
* pgrep: Fix selection where uid/gid > 2^31 merge !146
|
||||
* pgrep: Select on cgroup v2 paths issue #168
|
||||
* ps: Add OOM and OOMADJ fields issue #198
|
||||
* ps: Add IO Accounting fields issue #184
|
||||
* ps: Add PSS and USS fields issue #112
|
||||
* ps: Add two new autogroup fields
|
||||
* ps: Ignore SIGURG merge !142
|
||||
* slabtop: Don't combine d and o options issue #160
|
||||
* sysctl: Add support for systemd glob patterns issue #191
|
||||
* sysctl: Check resolved path to be under /proc/sys issue #179
|
||||
* sysctl: return non-zero if EINVAL return for write merge #76
|
||||
* sysctl.conf.5: Note max line length issue #77
|
||||
* top: added LOGID similar to 3.3.13 ps LUID
|
||||
* top: added EXE identical to 3.3.17 ps EXE
|
||||
* top: exploit some library smaps_rollup provisions issue #112
|
||||
* top: added four new IO accounting fields issue #184
|
||||
* top: 'F' key is now a new forest view 'focus' toggle
|
||||
* top: summary area memory lines can print two abreast
|
||||
* top: added two new autogroup fields
|
||||
* top: added long versions of command line options
|
||||
* top: added cpu utilization & 2 time related fields
|
||||
* top: the time related fields can now be user scaled
|
||||
* uptime: print short/pretty format correctly issue #217
|
||||
* vmstat: add -y option to remove first line merge !72
|
||||
- Remove patch now upstream fixed
|
||||
* procps-3.3.17-bsc1181976.patch
|
||||
* procps-ng-3.3.10-bnc634071_procstat2.diff
|
||||
* procps-ng-3.3.10-fdleak.dif
|
||||
- Port patches
|
||||
* procps-ng-3.3.10-errno.patch
|
||||
* procps-ng-3.3.10-large_pcpu.patch
|
||||
* procps-ng-3.3.10-slab.patch
|
||||
* procps-ng-3.3.10-xen.dif
|
||||
* procps-ng-3.3.11-pmap4suse.patch
|
||||
* procps-ng-3.3.8-bnc634840.patch
|
||||
* procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
|
||||
* procps-ng-3.3.8-petabytes.patch
|
||||
* procps-ng-3.3.8-readeof.patch
|
||||
* procps-ng-3.3.8-tinfo.dif
|
||||
* procps-ng-3.3.8-vmstat-terabyte.dif
|
||||
* procps-ng-3.3.9-w-notruncate.diff
|
||||
* procps-v3.3.3-columns.dif
|
||||
* procps-v3.3.3-ia64.diff
|
||||
* procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff
|
||||
- Port and rename patch
|
||||
* procps-ng-3.3.8-accuracy.dif becomes procps-ng-4.0.0-accuracy.dif
|
||||
* procps-ng-3.3.10-integer-overflow.patch becomes procps-ng-4.0.0-integer-overflow.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 4 09:21:59 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
|
57
procps.spec
57
procps.spec
@ -16,8 +16,8 @@
|
||||
#
|
||||
|
||||
|
||||
%define somajor 8
|
||||
%define libname libprocps%{somajor}
|
||||
%define somajor 0
|
||||
%define libname libproc-2-%{somajor}
|
||||
%if !0%{?usrmerged}
|
||||
%bcond_with bin2usr
|
||||
%else
|
||||
@ -26,7 +26,7 @@
|
||||
%bcond_without pidof
|
||||
%bcond_without nls
|
||||
Name: procps
|
||||
Version: 3.3.17
|
||||
Version: 4.0.0
|
||||
Release: 0
|
||||
Summary: The ps utilities for /proc
|
||||
License: GPL-2.0-or-later AND LGPL-2.1-or-later
|
||||
@ -40,12 +40,10 @@ Patch1: procps-v3.3.3-ia64.diff
|
||||
Patch3: procps-ng-3.3.9-w-notruncate.diff
|
||||
Patch7: procps-ng-3.3.8-readeof.patch
|
||||
Patch8: procps-ng-3.3.10-slab.patch
|
||||
Patch10: procps-ng-3.3.8-accuracy.dif
|
||||
Patch10: procps-ng-4.0.0-accuracy.dif
|
||||
Patch11: procps-ng-3.3.10-xen.dif
|
||||
Patch12: procps-ng-3.3.10-fdleak.dif
|
||||
Patch13: procps-v3.3.3-columns.dif
|
||||
Patch14: procps-ng-3.3.10-integer-overflow.patch
|
||||
Patch15: procps-ng-3.3.10-bnc634071_procstat2.diff
|
||||
Patch14: procps-ng-4.0.0-integer-overflow.patch
|
||||
Patch16: procps-ng-3.3.8-bnc634840.patch
|
||||
Patch17: procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff
|
||||
Patch18: procps-ng-3.3.8-petabytes.patch
|
||||
@ -60,10 +58,6 @@ Patch31: procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
|
||||
Patch32: procps-ng-3.3.10-errno.patch
|
||||
# PATCH-FEATURE-SUSE -- Let upstream pmap behave similar to old suse pmap
|
||||
Patch33: procps-ng-3.3.11-pmap4suse.patch
|
||||
# PATCH-FIX-UPSTREAM -- bsc#1181976
|
||||
Patch34: procps-3.3.17-bsc1181976.patch
|
||||
# PATCH-FIX-UPSTREAM -- bsc#1195468
|
||||
Patch35: bsc1195468-23da4f40.patch
|
||||
BuildRequires: automake
|
||||
BuildRequires: dejagnu
|
||||
BuildRequires: diffutils
|
||||
@ -121,18 +115,16 @@ The procps library can be used to read informations out from /proc
|
||||
the process information pseudo-file system.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0
|
||||
%setup -q -n %{name}-ng-%{version}
|
||||
# %patch0
|
||||
%patch1
|
||||
%patch3 -b .trcate
|
||||
%patch7 -b .rof
|
||||
%patch8 -b .cache
|
||||
%patch10 -b .acc
|
||||
%patch11
|
||||
%patch12
|
||||
%patch13 -b .column
|
||||
%patch14 -b .ovrflw
|
||||
%patch15
|
||||
%patch16
|
||||
%patch17 -b .sysctl
|
||||
%patch18
|
||||
@ -143,8 +135,6 @@ the process information pseudo-file system.
|
||||
%patch31 -p1
|
||||
%patch32
|
||||
%patch33 -b .pmap4us
|
||||
%patch34
|
||||
%patch35 -p1
|
||||
|
||||
%build
|
||||
test -s .tarball-version || echo %{version} > .tarball-version
|
||||
@ -352,7 +342,7 @@ test $error = no || exit 1
|
||||
%{_bindir}/pidof
|
||||
%endif
|
||||
%{_bindir}/pmap
|
||||
%{_bindir}/pwait
|
||||
%{_bindir}/pidwait
|
||||
%{_bindir}/pwdx
|
||||
%{_bindir}/skill
|
||||
%{_bindir}/slabtop
|
||||
@ -369,9 +359,8 @@ test $error = no || exit 1
|
||||
%endif
|
||||
%{_mandir}/man1/pkill.1%{?ext_man}
|
||||
%{_mandir}/man1/pmap.1%{?ext_man}
|
||||
%{_mandir}/man1/procps.1%{?ext_man}
|
||||
%{_mandir}/man1/ps.1%{?ext_man}
|
||||
%{_mandir}/man1/pwait.1%{?ext_man}
|
||||
%{_mandir}/man1/pidwait.1%{?ext_man}
|
||||
%{_mandir}/man1/pwdx.1%{?ext_man}
|
||||
%{_mandir}/man1/skill.1%{?ext_man}
|
||||
%{_mandir}/man1/slabtop.1%{?ext_man}
|
||||
@ -386,29 +375,17 @@ test $error = no || exit 1
|
||||
|
||||
%files devel
|
||||
%defattr (-,root,root,755)
|
||||
%dir %{_includedir}/proc
|
||||
%{_includedir}/proc/alloc.h
|
||||
%{_includedir}/proc/devname.h
|
||||
%{_includedir}/proc/escape.h
|
||||
%{_includedir}/proc/numa.h
|
||||
%{_includedir}/proc/procps.h
|
||||
%{_includedir}/proc/pwcache.h
|
||||
%{_includedir}/proc/readproc.h
|
||||
%{_includedir}/proc/sig.h
|
||||
%{_includedir}/proc/slab.h
|
||||
%{_includedir}/proc/sysinfo.h
|
||||
%{_includedir}/proc/version.h
|
||||
%{_includedir}/proc/wchan.h
|
||||
%{_includedir}/proc/whattime.h
|
||||
%{_libdir}/libprocps.so
|
||||
%{_libdir}/pkgconfig/libprocps.pc
|
||||
%{_mandir}/man3/openproc.3%{?ext_man}
|
||||
%{_mandir}/man3/readproc.3%{?ext_man}
|
||||
%{_mandir}/man3/readproctab.3%{?ext_man}
|
||||
%dir %{_includedir}/procps
|
||||
%{_includedir}/procps/*.h
|
||||
%{_libdir}/libproc-2.so
|
||||
%{_libdir}/pkgconfig/libproc-2.pc
|
||||
%{_mandir}/man3/procps.3%{?ext_man}
|
||||
%{_mandir}/man3/procps_misc.3%{?ext_man}
|
||||
%{_mandir}/man3/procps_pids.3%{?ext_man}
|
||||
|
||||
%files -n %{libname}
|
||||
%defattr (-,root,root,755)
|
||||
%{_libdir}/libprocps.so.%{somajor}*
|
||||
%{_libdir}/libproc-2.so.%{somajor}*
|
||||
|
||||
%files lang -f procps-ng.lang
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user