Fixed pmap -x Kbytes column
The Kbytes column when using the pmap -x flag would always be zero. This was because the diff variable was reset before it could be printed. pmap with no -x was not impacted by this bug or fix.
This commit is contained in:
parent
2865ded64e
commit
23e753fd47
4
pmap.c
4
pmap.c
@ -138,6 +138,7 @@ static int one_proc(proc_t *p){
|
|||||||
unsigned long long total_rss = 0ull;
|
unsigned long long total_rss = 0ull;
|
||||||
unsigned long long total_private_dirty = 0ull;
|
unsigned long long total_private_dirty = 0ull;
|
||||||
unsigned long long total_shared_dirty = 0ull;
|
unsigned long long total_shared_dirty = 0ull;
|
||||||
|
unsigned KLONG diff=0;
|
||||||
|
|
||||||
// Overkill, but who knows what is proper? The "w" prog
|
// Overkill, but who knows what is proper? The "w" prog
|
||||||
// uses the tty width to determine this.
|
// uses the tty width to determine this.
|
||||||
@ -167,7 +168,7 @@ static int one_proc(proc_t *p){
|
|||||||
while(fgets(mapbuf,sizeof mapbuf,fp)){
|
while(fgets(mapbuf,sizeof mapbuf,fp)){
|
||||||
char flags[32];
|
char flags[32];
|
||||||
char *tmp; // to clean up unprintables
|
char *tmp; // to clean up unprintables
|
||||||
unsigned KLONG start, end, diff=0;
|
unsigned KLONG start, end;
|
||||||
unsigned long long file_offset, inode;
|
unsigned long long file_offset, inode;
|
||||||
unsigned dev_major, dev_minor;
|
unsigned dev_major, dev_minor;
|
||||||
unsigned long long smap_value;
|
unsigned long long smap_value;
|
||||||
@ -206,6 +207,7 @@ static int one_proc(proc_t *p){
|
|||||||
);
|
);
|
||||||
/* reset some counters */
|
/* reset some counters */
|
||||||
rss = shared_dirty = private_dirty = 0ull;
|
rss = shared_dirty = private_dirty = 0ull;
|
||||||
|
diff=0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Other keys */
|
/* Other keys */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user