.
OBS-URL: https://build.opensuse.org/package/show/Base:System/procps?expand=0&rev=151
This commit is contained in:
parent
018e7cb3b8
commit
28db533ae6
158
procps-ng-3.3.11-pmap4suse.patch
Normal file
158
procps-ng-3.3.11-pmap4suse.patch
Normal file
@ -0,0 +1,158 @@
|
||||
---
|
||||
pmap.c | 46 +++++++++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 35 insertions(+), 11 deletions(-)
|
||||
|
||||
--- pmap.c
|
||||
+++ pmap.c 2016-01-27 09:16:14.924460617 +0000
|
||||
@@ -48,7 +48,9 @@ const char *nls_Address,
|
||||
*nls_Kbytes,
|
||||
*nls_Mode,
|
||||
*nls_RSS,
|
||||
- *nls_Dirty;
|
||||
+ *nls_PSS,
|
||||
+ *nls_Dirty,
|
||||
+ *nls_Swap;
|
||||
|
||||
static void nls_initialize(void)
|
||||
{
|
||||
@@ -72,7 +74,9 @@ static void nls_initialize(void)
|
||||
nls_Kbytes = _("Kbytes");
|
||||
nls_Mode = _("Mode");
|
||||
nls_RSS = _("RSS");
|
||||
+ nls_PSS = _("PSS");
|
||||
nls_Dirty = _("Dirty");
|
||||
+ nls_Swap = _("Swap");
|
||||
}
|
||||
|
||||
static int justify_print(const char *str, int width, int right)
|
||||
@@ -140,10 +144,10 @@ static int d_option;
|
||||
static int n_option;
|
||||
static int N_option;
|
||||
static int q_option;
|
||||
-static int x_option;
|
||||
+static int x_option = 1;
|
||||
static int X_option;
|
||||
|
||||
-static int map_desc_showpath;
|
||||
+static int map_desc_showpath = 1;
|
||||
|
||||
static unsigned shm_minor = ~0u;
|
||||
|
||||
@@ -521,12 +525,17 @@ static int one_proc(proc_t * p)
|
||||
unsigned KLONG diff = 0;
|
||||
const char *cp2 = NULL;
|
||||
unsigned long long rss = 0ull;
|
||||
+ unsigned long long pss = 0ull;
|
||||
+ unsigned long long swap = 0ull;
|
||||
unsigned long long private_dirty = 0ull;
|
||||
unsigned long long shared_dirty = 0ull;
|
||||
unsigned long long total_rss = 0ull;
|
||||
+ unsigned long long total_pss = 0ull;
|
||||
+ unsigned long long total_swap = 0ull;
|
||||
unsigned long long total_private_dirty = 0ull;
|
||||
unsigned long long total_shared_dirty = 0ull;
|
||||
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.
|
||||
@@ -555,13 +564,15 @@ static int one_proc(proc_t * p)
|
||||
if (x_option) {
|
||||
maxw1 = 16;
|
||||
if (sizeof(KLONG) == 4) maxw1 = 8;
|
||||
- maxw2 = maxw3 = maxw4 = 7;
|
||||
+ maxw2 = maxw3 = maxw4 = maxw6 = maxw7 = 7;
|
||||
maxw5 = 5;
|
||||
if (!q_option) {
|
||||
maxw1 = justify_print(nls_Address, maxw1, 0);
|
||||
maxw2 = justify_print(nls_Kbytes, maxw2, 1);
|
||||
maxw3 = justify_print(nls_RSS, maxw3, 1);
|
||||
+ maxw6 = justify_print(nls_PSS, maxw6, 1);
|
||||
maxw4 = justify_print(nls_Dirty, maxw4, 1);
|
||||
+ maxw7 = justify_print(nls_Swap, maxw7, 1);
|
||||
maxw5 = justify_print(nls_Mode, maxw5, 0);
|
||||
justify_print(nls_Mapping, 0, 0);
|
||||
}
|
||||
@@ -605,6 +616,11 @@ static int one_proc(proc_t * p)
|
||||
total_rss += smap_value;
|
||||
continue;
|
||||
}
|
||||
+ if (strncmp("Pss", smap_key, 3) == 0) {
|
||||
+ pss = smap_value;
|
||||
+ total_pss += smap_value;
|
||||
+ continue;
|
||||
+ }
|
||||
if (strncmp("Shared_Dirty", smap_key, 12) == 0) {
|
||||
shared_dirty = smap_value;
|
||||
total_shared_dirty += smap_value;
|
||||
@@ -616,12 +632,15 @@ static int one_proc(proc_t * p)
|
||||
continue;
|
||||
}
|
||||
if (strncmp("Swap", smap_key, 4) == 0) {
|
||||
- /*doesn't matter as long as last */
|
||||
- printf("%0*" KLF "x %*lu %*llu %*llu %*s %s\n",
|
||||
+ swap = smap_value;
|
||||
+ total_swap += smap_value;
|
||||
+ 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);
|
||||
/* reset some counters */
|
||||
@@ -656,7 +675,6 @@ static int one_proc(proc_t * p)
|
||||
if (perms[3] == 's')
|
||||
total_shared += diff;
|
||||
if (perms[3] == 'p') {
|
||||
- perms[3] = '-';
|
||||
if (perms[1] == 'w')
|
||||
total_private_writeable += diff;
|
||||
else
|
||||
@@ -708,17 +726,21 @@ static int one_proc(proc_t * p)
|
||||
justify_print("----------------", maxw1, 0);
|
||||
justify_print("-------", maxw2, 1);
|
||||
justify_print("-------", maxw3, 1);
|
||||
+ justify_print("-------", maxw6, 1);
|
||||
justify_print("-------", maxw4, 1);
|
||||
+ justify_print("-------", maxw7, 1);
|
||||
printf("\n");
|
||||
|
||||
printf("%-*s ", maxw1, _("total kB"));
|
||||
- printf("%*ld %*llu %*llu\n",
|
||||
+ printf("%*ld %*llu %*llu %*llu %*llu\n",
|
||||
maxw2, (total_shared +
|
||||
total_private_writeable +
|
||||
total_private_readonly) >> 10,
|
||||
maxw3, total_rss,
|
||||
+ maxw6, total_pss,
|
||||
maxw4, (total_shared_dirty +
|
||||
- total_private_dirty));
|
||||
+ total_private_dirty),
|
||||
+ maxw7, total_swap);
|
||||
}
|
||||
if (d_option) {
|
||||
printf
|
||||
@@ -1025,16 +1047,18 @@ int main(int argc, char **argv)
|
||||
while ((c = getopt_long(argc, argv, "xXrdqA:hVcC:nN:p", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
case 'x':
|
||||
- x_option = 1;
|
||||
+ x_option = !x_option;
|
||||
break;
|
||||
case 'X':
|
||||
X_option++;
|
||||
+ x_option = 0;
|
||||
break;
|
||||
case 'r':
|
||||
xwarnx(_("option -r is ignored as SunOS compatibility"));
|
||||
break;
|
||||
case 'd':
|
||||
- d_option = 1;
|
||||
+ d_option = !d_option;
|
||||
+ x_option = 0;
|
||||
break;
|
||||
case 'q':
|
||||
q_option = 1;
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 27 10:01:13 UTC 2016 - werner@suse.de
|
||||
|
||||
- Remove SUSE version of pmap as this stumble over new entries
|
||||
in process smaps files (boo#962275)
|
||||
- Add patch procps-ng-3.3.11-pmap4suse.patch
|
||||
to let upstream pmap behave simialr to old suse pmap
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 10 11:56:23 UTC 2015 - werner@suse.de
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package procps
|
||||
#
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -78,6 +78,8 @@ Patch28: procps-ng-3.3.8-vmstat-terabyte.dif
|
||||
Patch31: procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
|
||||
# PATCH-FIX-SUSE -- Avoid errno set by setlocale()
|
||||
Patch32: procps-ng-3.3.10-errno.patch
|
||||
# PATCH-FEATURE-SUSE -- Let upstream pmap behave simialr to old suse pmap
|
||||
Patch33: procps-ng-3.3.11-pmap4suse.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
@ -140,7 +142,8 @@ the process information pseudo-file system,
|
||||
%patch21
|
||||
%patch28
|
||||
%patch31 -p1
|
||||
%patch32 -b .xy
|
||||
%patch32
|
||||
%patch33
|
||||
|
||||
%build
|
||||
tar --strip-components=1 -xf %{S:1}
|
||||
|
Loading…
Reference in New Issue
Block a user