From 26b377717e2a8f5afb666b1b4249d2ebf9bfc2604a156af6ebe3d8dea5545c2e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 22 Jul 2011 15:45:54 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/procps?expand=0&rev=48 --- procps-3.2.8-pmap-smaps-rml-2.patch | 37 +++++++++++++++++++---------- procps.changes | 5 ++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/procps-3.2.8-pmap-smaps-rml-2.patch b/procps-3.2.8-pmap-smaps-rml-2.patch index 84295a4..5df7c00 100644 --- a/procps-3.2.8-pmap-smaps-rml-2.patch +++ b/procps-3.2.8-pmap-smaps-rml-2.patch @@ -91,8 +91,8 @@ +The procps package is maintained by Albert Calahan. Please send +bug reports to . --- pmap.c -+++ pmap.c 2010-12-03 16:55:52.268426585 +0000 -@@ -1,372 +1,428 @@ ++++ pmap.c 2011-07-22 17:38:48.219926168 +0200 +@@ -1,372 +1,440 @@ /* - * Copyright 2002 by Albert Cahalan; all rights reserved. - * This file may be used subject to the terms and conditions of the @@ -201,6 +201,9 @@ +#define OBJECTSIZE 1024 - if(shmdt(addr)) perror("shmdt"); +- +-out_destroy: +- if(shmctl(shmid, IPC_RMID, NULL)) perror("IPC_RMID"); +struct smap { + unsigned long size; + unsigned long rss; @@ -246,8 +249,7 @@ + "display this help\n"); +} --out_destroy: -- if(shmctl(shmid, IPC_RMID, NULL)) perror("IPC_RMID"); +- return; +static int get_smap_data(struct smap *smap) +{ + unsigned long long data; @@ -353,7 +355,13 @@ + + assigned = sscanf(buff, "Anonymous: %lld", &data); + -+ /* get swap */ ++ /* get swap or get and ignore huge anonymous pages */ ++ if (assigned == 1) ++ if(!fgets(buff, BUFFERSIZE, smaps_fp)) ++ return 1; ++ ++ assigned = sscanf(buff, "AnonHugePages: %lld", &data); ++ + if (assigned == 1) + if(!fgets(buff, BUFFERSIZE, smaps_fp)) + return 1; @@ -384,8 +392,13 @@ + if (assigned != 1) + return 1; + smap->mmupagesize = data; - -- return; ++ ++ /* get and ignore locked */ ++ if (assigned == 1) ++ if(!fgets(buff, BUFFERSIZE, smaps_fp)) ++ return 0; ++ ++ assigned = sscanf(buff, "Locked: %lld", &data); +out: + return 0; } @@ -441,7 +454,8 @@ -static const char *mapping_name(proc_t *p, unsigned KLONG addr, unsigned KLONG len, const char *mapbuf, unsigned showpath, unsigned dev_major, unsigned dev_minor, unsigned long long inode){ - const char *cp; -- ++ printf("%c%c%c%c ", read_perm, write_perm, exec_perm, access_type); + - if(!dev_major && dev_minor==shm_minor && strstr(mapbuf,"/SYSV")){ - static char shmbuf[64]; - snprintf(shmbuf, sizeof shmbuf, " [ shmid=0x%Lx ]", inode); @@ -464,7 +478,8 @@ - if( (p->start_stack >= addr) && (p->start_stack <= addr+len) ) cp = " [ stack ]"; - return cp; -} -+ printf("%c%c%c%c ", read_perm, write_perm, exec_perm, access_type); ++ if (show_devices) ++ printf("%0*llx %02lx:%02lx ", WDT, offset, major, minor); -static int one_proc(proc_t *p){ - char buf[32]; @@ -602,9 +617,7 @@ - else printf(" total %8ldK\n", (total_shared + total_private_writeable + total_private_readonly) >> 10); - } - } -+ if (show_devices) -+ printf("%0*llx %02lx:%02lx ", WDT, offset, major, minor); - +- - return 0; + printf("%s\n", obj_buff); } diff --git a/procps.changes b/procps.changes index d05e274..6fb207e 100644 --- a/procps.changes +++ b/procps.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jul 22 15:43:44 UTC 2011 - werner@suse.de + +- Ignore new smaps entries AnonHugePages and Locked (bnc#706942) + ------------------------------------------------------------------- Tue May 17 14:42:31 UTC 2011 - lnussel@suse.de