Dr. Werner Fink 2011-07-22 15:45:54 +00:00 committed by Git OBS Bridge
parent 7f0831cd4d
commit 26b377717e
2 changed files with 30 additions and 12 deletions

View File

@ -91,8 +91,8 @@
+The procps package is maintained by Albert Calahan. Please send
+bug reports to <albert@users.sf.net>.
--- 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);
}

View File

@ -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