Hi,

On Tue, Jul 27, 2010 at 03:25:15PM +0300, Alexander Shishkin wrote:
>pmap is a tool used to look at processes' memory maps, normally found
>in procps package. It provides more readable and easily sortable output
>(one line per mapping) from  maps/smaps files in /proc/PID/.  This would
>help in debugging memory usage issues, especially on devices where lots
>of typing is not a viable option.
>
>This patch does'n implement -d and -A command line options of GNU pmap,
>since those are not that must have features and I was afraid of going
>blind from looking at its code.
>
>The implementation takes smaps scanning part out of procps_scan() function
>and moves it into procps_read_smaps(), which does more detailed processing
>of a single PID's smaps data.

Unfortunately you didn't include bloat-o-meter nor size(1) stats.

>--- a/libbb/procps.c
>+++ b/libbb/procps.c

>+#ifdef ENABLE_FEATURE_TOPMEM
>+int procps_read_smaps(pid_t pid, struct smaprec *total,
>+                    void (*cb)(struct smaprec *, void *), void *data)
>+{
>+      char filename[FILENAME_MAX];

RESERVE_CONFIG_BUFFER / RELEASE_CONFIG_BUFFER

>+      FILE *file;
>+      char buf[PROCPS_BUFSIZE];

ditto

>diff --git a/procps/pmap.c b/procps/pmap.c
>new file mode 100644
>index 0000000..cf251e8
>--- /dev/null
>+++ b/procps/pmap.c

>+static int procps_get_maps(pid_t pid, unsigned int opt)
>+{
>+      char buf[BUFSIZ];

ditto

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to