lkml.org 
[lkml]   [1998]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject/proc/<pid>/statm glitch in 2.0.33 and 2.1.97
Date
From
 /proc/<pid>/statm appears to always report 0 for 'lrs' (the fifth
number, which comments suggest has to do with how many pages of shared
libraries the process is using). I think this is because the get_statm()
routine in fs/proc/array.c is using an old and now obsolete test for
this. Here's a patch against 2.0.33 to change it to something deduced
from examining how task_mem() appears to do it.

Possibly the /proc/<pid>/statm interface is obsolete, but I hope not;
it appears to give some information not readily available from elsewhere
(particularly the total size vs resident pages information).

--- fs/proc/array.c 1998/04/20 05:37:03 1.1
+++ fs/proc/array.c 1998/04/20 05:38:00
@@ -826,9 +826,9 @@
if (vma->vm_flags & VM_EXECUTABLE)
trs += pages; /* text */
else if (vma->vm_flags & VM_GROWSDOWN)
drs += pages; /* stack */
- else if (vma->vm_end > 0x60000000)
+ else if (vma->vm_flags & VM_EXEC)
lrs += pages; /* library */
else
drs += pages;
vma = vma->vm_next;
- cks

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.128 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site