All of lore.kernel.org
 help / color / mirror / Atom feed
* For review: memusage(1) man page
@ 2014-07-18  9:00 Jan Chaloupka
  2014-07-18  9:20 ` Alfred M. Szmidt
       [not found] ` <53C8E244.2080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-18  9:00 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

Hi,

memusage command is no documented. My collegue (95%) and I (5%) have 
written a man page for it. All informations come from inspecting the 
script code. This is the first script, others are memusagestat (1) and 
mtrace(1).

Feel free to comment or ask any question.

Thank you
Jan

.\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.TH MEMUSAGE 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
.SH NAME
memusage \- profile memory usage of a program
.SH SYNOPSIS
.BR memusage " [\fIOPTION\fR]... \fIPROGRAM\fR [\fIPROGRAMOPTION\fR]..."
.SH DESCRIPTION
.B memusage
is a bash script which can profile memory usage of a program. It preloads
.B libmemusage.so
library to the user's environment using
.B LD_PRELOAD
environment variable. The
.B libmemusage.so
library traces memory allocation by intercepting calls to
.BR malloc (3),
.BR free (3),
.BR realloc (3)
and various other calls.
.PP
.B memusage
can output text representation of the collected data, or it can use
.BR memusagestat (1)
utility (see
.B -p
option)
to create a PNG file containing graphical representation
of the collected data.
.TP
List of monitored functions:
.RS
.BI "void *malloc(size_t " "size" );
.RE
.RS
.BI "void *calloc(size_t " "nmemb" ", size_t " "size" );
.RE
.RS
.BI "void *realloc(void " "*ptr" ", size_t "  "size" );
.RE
.RS
.BI "void *mmap(void " "*addr" ", size_t " "length" ", int " "prot",
.BI "int " "flags" ", int " "fd" ", off_t " "offset");
.RE
.RS
.BI "void *mremap(void " "*old_address" ", size_t " "old_size",
.BI "size_t " "new_size" ", int " "flags",
.BI "... /* void " "*new_address" " */);"
.RE
.TP
Description of a memory usage summary:
.RE
\fBheap total\fR:
.RS
Sum of \fIsize\fR arguments of all malloc calls,
sum of all product of arguments (\fInmemb\fR*\fIsize\fR) of calloc call
and sum of \fIlength\fR arguments of mmap calls.
In a case of realloc, respectively mremap, if a new size of an original 
malloc,
respectively mremap call is bigger than an old one,
sum of all such differences (new size - old size) is added.
.RE
\fBheap peak\fR:
.RS
Maximum of all \fIsize\fR arguments of malloc,
all products of \fInmemb\fR*\fIsize\fR of calloc,
all \fIsize\fR arguments of realloc, \fIlength\fR arguments of mmap and
\fInew_size\fR arguments of mremap.
.RE
\fBstack peak\fR:
.RS
Before the first call to any monitored function,
stack pointer address (base stack pointer) is saved.
After each function call, actual stack pointer address is read and
the difference between the base stack pointer computed.
Maximum of these differences is then the stack peak.
.RE

If a realloc function is called on a mallocced memory with a new size being
smaller than an old one, total memory of realloc cell is not updated.
This can cause sum of all cells (excluding free) of total memory being
greater than free cell.
.SH OPTIONS
.TP
.BI \-n\  name \fR,\ \fB\-\-progname= name
Name of the program file to profile.
.TP
.BI \-p\  file \fR,\ \fB\-\-png= file
Generate PNG graphic and store it in the file.
.TP
.BI \-d\  file \fR,\ \fB\-\-data= file
Generate binary data file and store it in the file.
.TP
.BI \-u\fR,\ \fB\-\-unbuffered
Do not buffer output.
.TP
.BI \-b\  size \fR,\ \fB\-\-buffer= size
Collect size entries before writing them out.
.TP
.BI \fB\-\-no-timer
Do not collect additional information through timer.
.TP
.BI \-m\fR,\ \fB\-\-mmap
Also trace mmap and friends.
.TP
.BI \-?\fR,\ \fB\-\-help
Print help and exit.
.TP
.BI \fB\-\-usage
Print a short usage message and exit.
.TP
.BI \-V\fR,\ \fB\-\-version
Print version information and exit.
.TP
The following options only apply when generating graphical output:
.TP
.BI \-t\fR,\ \fB\-\-time\-based
Make graph linear in time.
.TP
.BI \-T\fR,\ \fB\-\-total
Also draw graph of total memory use.
.TP
.BI \fB\-\-title= name
Use the name as a title of the graph.
.TP
.BI \-x\  size \fR,\ \fB\-\-x\-size= size
Make graphic size pixels wide.
.TP
.BI \-y\  size \fR,\ \fB\-\-y\-size= size
Make graphic size pixels high.
.SH EXIT STATUS
Exit status is equal to the exit status of profiled program.
.SH BUGS
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
.SH SEE ALSO
.BR memusagestat (1),
.BR ld.so (8)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
  2014-07-18  9:00 For review: memusage(1) man page Jan Chaloupka
@ 2014-07-18  9:20 ` Alfred M. Szmidt
  2014-07-18  9:50   ` Jan Chaloupka
       [not found]   ` <E1X84Kh-00041J-2z-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
       [not found] ` <53C8E244.2080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  1 sibling, 2 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2014-07-18  9:20 UTC (permalink / raw)
  To: Jan Chaloupka
  Cc: mtk.manpages, linux-man, libc-alpha, myllynen, drepper, pschiffe

   memusage command is no documented. My collegue (95%) and I (5%)
   have written a man page for it. All informations come from
   inspecting the script code. This is the first script, others are
   memusagestat (1) and mtrace(1).

This, memusagestat, and mtrace should rather be put into the glibc
manual.  mtrace is already (though partially) documented there, and
much of the details regarding the mtrace functions.  Having the
corresponding commands documented would be awesome though.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
  2014-07-18  9:20 ` Alfred M. Szmidt
@ 2014-07-18  9:50   ` Jan Chaloupka
       [not found]   ` <E1X84Kh-00041J-2z-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
  1 sibling, 0 replies; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-18  9:50 UTC (permalink / raw)
  To: ams; +Cc: mtk.manpages, linux-man, libc-alpha, myllynen, drepper, pschiffe


On 07/18/2014 11:20 AM, Alfred M. Szmidt wrote:
>     memusage command is no documented. My collegue (95%) and I (5%)
>     have written a man page for it. All informations come from
>     inspecting the script code. This is the first script, others are
>     memusagestat (1) and mtrace(1).
>
> This, memusagestat, and mtrace should rather be put into the glibc
> manual.
Having for example malloc in man pages, it is reasonable for me to put 
these three man pages here too. Searching manual for memusagestat help 
is time consuming. But yes, it should me in the manual too.
>    mtrace is already (though partially) documented there, and
> much of the details regarding the mtrace functions.  Having the
> corresponding commands documented would be awesome though.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]   ` <E1X84Kh-00041J-2z-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
@ 2014-07-22  6:10     ` Michael Kerrisk (man-pages)
       [not found]       ` <53CE004A.3060706-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-07-22  6:10 UTC (permalink / raw)
  To: ams-mXXj517/zsQ, Jan Chaloupka
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA

On 07/18/2014 11:20 AM, Alfred M. Szmidt wrote:
>    memusage command is no documented. My collegue (95%) and I (5%)
>    have written a man page for it. All informations come from
>    inspecting the script code. This is the first script, others are
>    memusagestat (1) and mtrace(1).
> 
> This, memusagestat, and mtrace should rather be put into the glibc
> manual.  mtrace is already (though partially) documented there, and
> much of the details regarding the mtrace functions.  Having the
> corresponding commands documented would be awesome though.
> .

I must say that this is an odd position to take. While it would be 
nice to have documentation in the glibc manual, the glibc developers
did not bother to add anything to the manual when writing these 
interfaces, so it hardly seems like anyone else is obligated to do
so (assuming that person wanted to even jump the CLA hurdle...). 
In any case, man pages does (good) pages that describe the 
libc interfaces (including commands).

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found] ` <53C8E244.2080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-07-22  6:14   ` Michael Kerrisk (man-pages)
       [not found]     ` <53CE0144.7050405-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-07-22  6:14 UTC (permalink / raw)
  To: Jan Chaloupka
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

Jan,

On 07/18/2014 11:00 AM, Jan Chaloupka wrote:
> Hi,
> 
> memusage command is no documented. My collegue (95%) and I (5%) have 
> written a man page for it. All informations come from inspecting the 
> script code. This is the first script, others are memusagestat (1) and 
> mtrace(1).
> 
> Feel free to comment or ask any question.

Thanks for these submissions. It will take me a while to get to
looking at them more closely. My time is very limited at the moment.

I'll eventually have some other comments, but it strikes me that
this page could use a small example, if it is feasible to create
one. Would you (or Peter) be willing to have a go at that?

Cheers,

Michael


> Thank you
> Jan
> 
> .\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
> .\"
> .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
> .\" This is free documentation; you can redistribute it and/or
> .\" modify it under the terms of the GNU General Public License as
> .\" published by the Free Software Foundation; either version 2 of
> .\" the License, or (at your option) any later version.
> .\"
> .\" The GNU General Public License's references to "object code"
> .\" and "executables" are to be interpreted as the output of any
> .\" document formatting or typesetting system, including
> .\" intermediate and printed output.
> .\"
> .\" This manual is distributed in the hope that it will be useful,
> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> .\" GNU General Public License for more details.
> .\"
> .\" You should have received a copy of the GNU General Public
> .\" License along with this manual; if not, see
> .\" <http://www.gnu.org/licenses/>.
> .\" %%%LICENSE_END
> .TH MEMUSAGE 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
> .SH NAME
> memusage \- profile memory usage of a program
> .SH SYNOPSIS
> .BR memusage " [\fIOPTION\fR]... \fIPROGRAM\fR [\fIPROGRAMOPTION\fR]..."
> .SH DESCRIPTION
> .B memusage
> is a bash script which can profile memory usage of a program. It preloads
> .B libmemusage.so
> library to the user's environment using
> .B LD_PRELOAD
> environment variable. The
> .B libmemusage.so
> library traces memory allocation by intercepting calls to
> .BR malloc (3),
> .BR free (3),
> .BR realloc (3)
> and various other calls.
> .PP
> .B memusage
> can output text representation of the collected data, or it can use
> .BR memusagestat (1)
> utility (see
> .B -p
> option)
> to create a PNG file containing graphical representation
> of the collected data.
> .TP
> List of monitored functions:
> .RS
> .BI "void *malloc(size_t " "size" );
> .RE
> .RS
> .BI "void *calloc(size_t " "nmemb" ", size_t " "size" );
> .RE
> .RS
> .BI "void *realloc(void " "*ptr" ", size_t "  "size" );
> .RE
> .RS
> .BI "void *mmap(void " "*addr" ", size_t " "length" ", int " "prot",
> .BI "int " "flags" ", int " "fd" ", off_t " "offset");
> .RE
> .RS
> .BI "void *mremap(void " "*old_address" ", size_t " "old_size",
> .BI "size_t " "new_size" ", int " "flags",
> .BI "... /* void " "*new_address" " */);"
> .RE
> .TP
> Description of a memory usage summary:
> .RE
> \fBheap total\fR:
> .RS
> Sum of \fIsize\fR arguments of all malloc calls,
> sum of all product of arguments (\fInmemb\fR*\fIsize\fR) of calloc call
> and sum of \fIlength\fR arguments of mmap calls.
> In a case of realloc, respectively mremap, if a new size of an original 
> malloc,
> respectively mremap call is bigger than an old one,
> sum of all such differences (new size - old size) is added.
> .RE
> \fBheap peak\fR:
> .RS
> Maximum of all \fIsize\fR arguments of malloc,
> all products of \fInmemb\fR*\fIsize\fR of calloc,
> all \fIsize\fR arguments of realloc, \fIlength\fR arguments of mmap and
> \fInew_size\fR arguments of mremap.
> .RE
> \fBstack peak\fR:
> .RS
> Before the first call to any monitored function,
> stack pointer address (base stack pointer) is saved.
> After each function call, actual stack pointer address is read and
> the difference between the base stack pointer computed.
> Maximum of these differences is then the stack peak.
> .RE
> 
> If a realloc function is called on a mallocced memory with a new size being
> smaller than an old one, total memory of realloc cell is not updated.
> This can cause sum of all cells (excluding free) of total memory being
> greater than free cell.
> .SH OPTIONS
> .TP
> .BI \-n\  name \fR,\ \fB\-\-progname= name
> Name of the program file to profile.
> .TP
> .BI \-p\  file \fR,\ \fB\-\-png= file
> Generate PNG graphic and store it in the file.
> .TP
> .BI \-d\  file \fR,\ \fB\-\-data= file
> Generate binary data file and store it in the file.
> .TP
> .BI \-u\fR,\ \fB\-\-unbuffered
> Do not buffer output.
> .TP
> .BI \-b\  size \fR,\ \fB\-\-buffer= size
> Collect size entries before writing them out.
> .TP
> .BI \fB\-\-no-timer
> Do not collect additional information through timer.
> .TP
> .BI \-m\fR,\ \fB\-\-mmap
> Also trace mmap and friends.
> .TP
> .BI \-?\fR,\ \fB\-\-help
> Print help and exit.
> .TP
> .BI \fB\-\-usage
> Print a short usage message and exit.
> .TP
> .BI \-V\fR,\ \fB\-\-version
> Print version information and exit.
> .TP
> The following options only apply when generating graphical output:
> .TP
> .BI \-t\fR,\ \fB\-\-time\-based
> Make graph linear in time.
> .TP
> .BI \-T\fR,\ \fB\-\-total
> Also draw graph of total memory use.
> .TP
> .BI \fB\-\-title= name
> Use the name as a title of the graph.
> .TP
> .BI \-x\  size \fR,\ \fB\-\-x\-size= size
> Make graphic size pixels wide.
> .TP
> .BI \-y\  size \fR,\ \fB\-\-y\-size= size
> Make graphic size pixels high.
> .SH EXIT STATUS
> Exit status is equal to the exit status of profiled program.
> .SH BUGS
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>.
> .SH SEE ALSO
> .BR memusagestat (1),
> .BR ld.so (8)
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]     ` <53CE0144.7050405-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-07-22  6:30       ` Jan Chaloupka
       [not found]         ` <53CE0517.2040005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-22  6:30 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

On 07/22/2014 08:14 AM, Michael Kerrisk (man-pages) wrote:
> Jan,
>
> On 07/18/2014 11:00 AM, Jan Chaloupka wrote:
>> Hi,
>>
>> memusage command is no documented. My collegue (95%) and I (5%) have
>> written a man page for it. All informations come from inspecting the
>> script code. This is the first script, others are memusagestat (1) and
>> mtrace(1).
>>
>> Feel free to comment or ask any question.
> Thanks for these submissions. It will take me a while to get to
> looking at them more closely. My time is very limited at the moment.

Thank you for review.

> I'll eventually have some other comments, but it strikes me that
> this page could use a small example, if it is feasible to create
> one. Would you (or Peter) be willing to have a go at that?

I will create one.

> Cheers,
>
> Michael
>
>
>> Thank you
>> Jan
>>
>> .\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
>> .\"
>> .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
>> .\" This is free documentation; you can redistribute it and/or
>> .\" modify it under the terms of the GNU General Public License as
>> .\" published by the Free Software Foundation; either version 2 of
>> .\" the License, or (at your option) any later version.
>> .\"
>> .\" The GNU General Public License's references to "object code"
>> .\" and "executables" are to be interpreted as the output of any
>> .\" document formatting or typesetting system, including
>> .\" intermediate and printed output.
>> .\"
>> .\" This manual is distributed in the hope that it will be useful,
>> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
>> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> .\" GNU General Public License for more details.
>> .\"
>> .\" You should have received a copy of the GNU General Public
>> .\" License along with this manual; if not, see
>> .\" <http://www.gnu.org/licenses/>.
>> .\" %%%LICENSE_END
>> .TH MEMUSAGE 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
>> .SH NAME
>> memusage \- profile memory usage of a program
>> .SH SYNOPSIS
>> .BR memusage " [\fIOPTION\fR]... \fIPROGRAM\fR [\fIPROGRAMOPTION\fR]..."
>> .SH DESCRIPTION
>> .B memusage
>> is a bash script which can profile memory usage of a program. It preloads
>> .B libmemusage.so
>> library to the user's environment using
>> .B LD_PRELOAD
>> environment variable. The
>> .B libmemusage.so
>> library traces memory allocation by intercepting calls to
>> .BR malloc (3),
>> .BR free (3),
>> .BR realloc (3)
>> and various other calls.
>> .PP
>> .B memusage
>> can output text representation of the collected data, or it can use
>> .BR memusagestat (1)
>> utility (see
>> .B -p
>> option)
>> to create a PNG file containing graphical representation
>> of the collected data.
>> .TP
>> List of monitored functions:
>> .RS
>> .BI "void *malloc(size_t " "size" );
>> .RE
>> .RS
>> .BI "void *calloc(size_t " "nmemb" ", size_t " "size" );
>> .RE
>> .RS
>> .BI "void *realloc(void " "*ptr" ", size_t "  "size" );
>> .RE
>> .RS
>> .BI "void *mmap(void " "*addr" ", size_t " "length" ", int " "prot",
>> .BI "int " "flags" ", int " "fd" ", off_t " "offset");
>> .RE
>> .RS
>> .BI "void *mremap(void " "*old_address" ", size_t " "old_size",
>> .BI "size_t " "new_size" ", int " "flags",
>> .BI "... /* void " "*new_address" " */);"
>> .RE
>> .TP
>> Description of a memory usage summary:
>> .RE
>> \fBheap total\fR:
>> .RS
>> Sum of \fIsize\fR arguments of all malloc calls,
>> sum of all product of arguments (\fInmemb\fR*\fIsize\fR) of calloc call
>> and sum of \fIlength\fR arguments of mmap calls.
>> In a case of realloc, respectively mremap, if a new size of an original
>> malloc,
>> respectively mremap call is bigger than an old one,
>> sum of all such differences (new size - old size) is added.
>> .RE
>> \fBheap peak\fR:
>> .RS
>> Maximum of all \fIsize\fR arguments of malloc,
>> all products of \fInmemb\fR*\fIsize\fR of calloc,
>> all \fIsize\fR arguments of realloc, \fIlength\fR arguments of mmap and
>> \fInew_size\fR arguments of mremap.
>> .RE
>> \fBstack peak\fR:
>> .RS
>> Before the first call to any monitored function,
>> stack pointer address (base stack pointer) is saved.
>> After each function call, actual stack pointer address is read and
>> the difference between the base stack pointer computed.
>> Maximum of these differences is then the stack peak.
>> .RE
>>
>> If a realloc function is called on a mallocced memory with a new size being
>> smaller than an old one, total memory of realloc cell is not updated.
>> This can cause sum of all cells (excluding free) of total memory being
>> greater than free cell.
>> .SH OPTIONS
>> .TP
>> .BI \-n\  name \fR,\ \fB\-\-progname= name
>> Name of the program file to profile.
>> .TP
>> .BI \-p\  file \fR,\ \fB\-\-png= file
>> Generate PNG graphic and store it in the file.
>> .TP
>> .BI \-d\  file \fR,\ \fB\-\-data= file
>> Generate binary data file and store it in the file.
>> .TP
>> .BI \-u\fR,\ \fB\-\-unbuffered
>> Do not buffer output.
>> .TP
>> .BI \-b\  size \fR,\ \fB\-\-buffer= size
>> Collect size entries before writing them out.
>> .TP
>> .BI \fB\-\-no-timer
>> Do not collect additional information through timer.
>> .TP
>> .BI \-m\fR,\ \fB\-\-mmap
>> Also trace mmap and friends.
>> .TP
>> .BI \-?\fR,\ \fB\-\-help
>> Print help and exit.
>> .TP
>> .BI \fB\-\-usage
>> Print a short usage message and exit.
>> .TP
>> .BI \-V\fR,\ \fB\-\-version
>> Print version information and exit.
>> .TP
>> The following options only apply when generating graphical output:
>> .TP
>> .BI \-t\fR,\ \fB\-\-time\-based
>> Make graph linear in time.
>> .TP
>> .BI \-T\fR,\ \fB\-\-total
>> Also draw graph of total memory use.
>> .TP
>> .BI \fB\-\-title= name
>> Use the name as a title of the graph.
>> .TP
>> .BI \-x\  size \fR,\ \fB\-\-x\-size= size
>> Make graphic size pixels wide.
>> .TP
>> .BI \-y\  size \fR,\ \fB\-\-y\-size= size
>> Make graphic size pixels high.
>> .SH EXIT STATUS
>> Exit status is equal to the exit status of profiled program.
>> .SH BUGS
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/libc/bugs.html>.
>> .SH SEE ALSO
>> .BR memusagestat (1),
>> .BR ld.so (8)
>>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]         ` <53CE0517.2040005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-07-22  8:07           ` Jan Chaloupka
       [not found]             ` <53CE1BC4.6040707-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-22  8:07 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

Adding example with small C code to demonstrate progress of memory usage

.\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.TH MEMUSAGESTAT 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
.SH NAME
memusagestat \- generate graphic from memory profiling data
.SH SYNOPSIS
.BR memusagestat " [\fIOPTION\fR]... \fIDATAFILE\fR [\fIOUTFILE\fR]"
.SH DESCRIPTION
.B memusagestat
can create a PNG file with graphical representation of memory profiling 
data.
Red line in the graph shows the heap usage (allocated memory),
green line shows the stack usage,
x-scale number of memory handling functions calls or time (\fB-t\fR option).
.I DATAFILE
is a binary data file generated by
.BR memusage (1)
utility with
.B -d
option.
.SH OPTIONS
.TP
.BI \-o\  file \fR,\ \fB\-\-output= file
Name of the output file.
.TP
.BI \-s\  string \fR,\ \fB\-\-string= string
Title string used in the output graphic.
.TP
.BI \-t\fR,\ \fB\-\-time
Generate output linear to time
(default is linear to number of function calls).
.TP
.BI \-T\fR,\ \fB\-\-total
Also draw graph for total memory consumption.
.TP
.BI \-x\  size \fR,\ \fB\-\-x-size= size
Make graphic size pixels wide.
.TP
.BI \-y\  size \fR,\ \fB\-\-y\-size= size
Make graphic size pixels high.
.TP
.BI \-?\fR,\ \fB\-\-help
Print help and exit.
.TP
.BI \fB\-\-usage
Print a short usage message and exit.
.TP
.BI \-V\fR,\ \fB\-\-version
Print version information and exit.
.SH EXAMPLES
Here is a simple program \fImemusagestatexample.c\fR simulating increase 
and decrease of memory usage:

.RS 4
#include <stdio.h>
.RS 0
#include <stdlib.h>
.RE
.RS 0
#define CYCLES 20
.RE

int main(int argc, char ** argv) {
         int i, j;
         int *p = NULL;
         printf("malloc: %d\\n", sizeof(int)*100);
         p = malloc(sizeof(int)*100);

         for (i = 0; i < CYCLES; i++) {
                 if (i < CYCLES/2) j = i; else j--;
                 printf("realloc: %d\\n", sizeof(int)*((j)*50 + 110));
                 p = realloc(p, sizeof(int)*(j*50 + 100));
                 printf("realloc: %d\\n", sizeof(int)*((j+1)*150 + 110));
                 p = realloc(p, sizeof(int)*((j+1)*150 + 110));
         }
         free(p);
         return 0;
.RS 0
}
.RE
.RE

After compiling and running the following, you can see progress of 
memory usage (memusagestatexample.png):

memusage --data=memusagestatexample.dat ./memusagestatexample
.RS 0
memusagestat memusagestatexample.dat memusagestatexample.png
.RE

.SH BUGS
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
.SH SEE ALSO
.BR memusage (1)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]       ` <53CE004A.3060706-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-07-22  8:39         ` Alfred M. Szmidt
       [not found]           ` <E1X9VbA-0002Bk-Ox-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Alfred M. Szmidt @ 2014-07-22  8:39 UTC (permalink / raw)
  Cc: jchaloup-H+wXaHxf7aLQT0dZR+AlfA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA

Jan, are you willing to assign copyright for those documenation bits
to the FSF? I'll happily convert them into texinfo.

   I must say that this is an odd position to take. While it would be
   nice to have documentation in the glibc manual, the glibc
   developers did not bother to add anything to the manual when
   writing these interfaces, so it hardly seems like anyone else is
   obligated to do so (assuming that person wanted to even jump the
   CLA hurdle...).  In any case, man pages does (good) pages that
   describe the libc interfaces (including commands).

Someone sends a useful patch for glibc, but glibc is not documented
using man pages so the natural thing is to have it in a format that
can be accepted into glibc.

What is odd is to dismiss such a contribution and start making excuses
as to why one should not "bother" updating the offical, and canonical
documentation for glibc.  And accusing people because they "couldn't
be bothered" is quite an unfriendly attidue.  We all have things to
do, and only have so much time to try and do everything.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]           ` <E1X9VbA-0002Bk-Ox-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
@ 2014-07-22 10:20             ` Jan Chaloupka
       [not found]               ` <53CE3AF3.40005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2014-07-22 19:02             ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-22 10:20 UTC (permalink / raw)
  To: ams-mXXj517/zsQ, Michael Kerrisk (man-pages)
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA


On 07/22/2014 10:39 AM, Alfred M. Szmidt wrote:
> Jan, are you willing to assign copyright for those documenation bits
> to the FSF? I'll happily convert them into texinfo.
Alfred, can you be more specific? What would it imply for me, Peter and 
man pages? Is there a problem with GPLv2+ or the copyright? What should 
be changed?
>     I must say that this is an odd position to take. While it would be
>     nice to have documentation in the glibc manual, the glibc
>     developers did not bother to add anything to the manual when
>     writing these interfaces, so it hardly seems like anyone else is
>     obligated to do so (assuming that person wanted to even jump the
>     CLA hurdle...).  In any case, man pages does (good) pages that
>     describe the libc interfaces (including commands).
>
> Someone sends a useful patch for glibc, but glibc is not documented
> using man pages so the natural thing is to have it in a format that
> can be accepted into glibc.
>
> What is odd is to dismiss such a contribution and start making excuses
> as to why one should not "bother" updating the offical, and canonical
> documentation for glibc.  And accusing people because they "couldn't
> be bothered" is quite an unfriendly attidue.  We all have things to
> do, and only have so much time to try and do everything.
Because you responded it means you don't have problems being bothered. 
Please, lets close this discussion. No need to continue.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]               ` <53CE3AF3.40005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-07-22 11:00                 ` Alfred M. Szmidt
       [not found]                   ` <E1X9XoF-0007Vz-Lm-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Alfred M. Szmidt @ 2014-07-22 11:00 UTC (permalink / raw)
  To: Jan Chaloupka
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA

   > Jan, are you willing to assign copyright for those documenation
   > bits to the FSF? I'll happily convert them into texinfo.

   Alfred, can you be more specific? What would it imply for me, Peter
   and man pages? Is there a problem with GPLv2+ or the copyright?
   What should be changed?

Please see:

	https://sourceware.org/glibc/wiki/Contribution%20checklist#FSF_copyright_Assignment

It should explain everything.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]           ` <E1X9VbA-0002Bk-Ox-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
  2014-07-22 10:20             ` Jan Chaloupka
@ 2014-07-22 19:02             ` Michael Kerrisk (man-pages)
  2014-07-23 14:41               ` Alfred M. Szmidt
  1 sibling, 1 reply; 18+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-07-22 19:02 UTC (permalink / raw)
  To: ams-mXXj517/zsQ
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	jchaloup-H+wXaHxf7aLQT0dZR+AlfA,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA

Hello Alfred,

On 07/22/2014 10:39 AM, Alfred M. Szmidt wrote:
> Jan, are you willing to assign copyright for those documenation bits
> to the FSF? I'll happily convert them into texinfo.
> 
>    I must say that this is an odd position to take. While it would be
>    nice to have documentation in the glibc manual, the glibc
>    developers did not bother to add anything to the manual when
>    writing these interfaces, so it hardly seems like anyone else is
>    obligated to do so (assuming that person wanted to even jump the
>    CLA hurdle...).  In any case, man pages does (good) pages that
>    describe the libc interfaces (including commands).
> 
> Someone sends a useful patch for glibc, but glibc is not documented
> using man pages so the natural thing is to have it in a format that
> can be accepted into glibc.

My problem was with your earlier statement: "This, memusagestat, and
mtrace should rather be put into the glibc manual." Perhaps it is
just a language misstep, but "should" implies that the author is
in some sense obliged to send documentation patches to the glibc 
manual, rather than elsewhere (e.g., man pages). I don't agree. 
(But, I'll repeat what I said earlier that it would be good if the
doc is in the glibc manual, also.)

> What is odd is to dismiss such a contribution 

I did not dismiss any contribution (or I am misunderstanding your point).

> and start making excuses
> as to why one should not "bother" updating the offical, and canonical
> documentation for glibc.  

I'm not making excuses. But, I am suggesting that the CLA is a 
rather pointless hurdle. Yes, we can argue that one; I've already
made my position clear and public elsewhere [1].

And, I can't help but make the observation that man-pages provides
documentation of the glibc interfaces that is frequently more thorough,
complete, and up-to-date than the "official and canonical" glibc manual.
I leave others to speculate how that situation could come about.

> And accusing people because they "couldn't
> be bothered" is quite an unfriendly attidue.  We all have things to
> do, and only have so much time to try and do everything.

I did not "accuse" anyone of anything, but it seems clear that
there are many cases where documentation was considered unimportant.
And, I probably could have expressed myself a little better and 
more temperately; I was reacting a little to what I perceived
was your implication (as I describe above).
 
Mostly, I was expressing frustration with a too common developer
attitude that the job ends at coding. For, without documentation
(i.e., a formal or informal spec), how can one tell where the
developer's implementation differs from their intention (i.e., a bug)?
Personally speaking, I've never considered a development project
complete if I did not also provide (extensive) documentation.

Cheers,

Michael

https://lwn.net/Articles/529522/

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
  2014-07-22 19:02             ` Michael Kerrisk (man-pages)
@ 2014-07-23 14:41               ` Alfred M. Szmidt
  0 siblings, 0 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2014-07-23 14:41 UTC (permalink / raw)
  Cc: mtk.manpages, jchaloup, linux-man, libc-alpha, myllynen, drepper,
	pschiffe

   I did not "accuse" anyone of anything, but it seems clear that
   there are many cases where documentation was considered
   unimportant.

There is a different team doing work now -- what might have been in
the past is not what is now, documentation is not unimportant.

To twist it, it would be very nice to merge whatever changes,
additions, and improvments that the man pages have with regard to the
glibc manual.  Anyone who would like to take a stab at doing that?  A
good start would be a list of undocumented interfaces, tools, and
such.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]                   ` <E1X9XoF-0007Vz-Lm-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
@ 2014-07-24  5:25                     ` Jan Chaloupka
  2014-07-24  7:26                       ` Alfred M. Szmidt
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-24  5:25 UTC (permalink / raw)
  To: ams-mXXj517/zsQ
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA

Hi, Alfred,

I, as a Red Hat employee, am covered by Red Hat's standing copyright 
assignment
with the FSF.

On 07/22/2014 01:00 PM, Alfred M. Szmidt wrote:
>     > Jan, are you willing to assign copyright for those documenation
>     > bits to the FSF? I'll happily convert them into texinfo.
>
>     Alfred, can you be more specific? What would it imply for me, Peter
>     and man pages? Is there a problem with GPLv2+ or the copyright?
>     What should be changed?
>
> Please see:
>
> 	https://sourceware.org/glibc/wiki/Contribution%20checklist#FSF_copyright_Assignment
>
> It should explain everything.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
  2014-07-24  5:25                     ` Jan Chaloupka
@ 2014-07-24  7:26                       ` Alfred M. Szmidt
       [not found]                         ` <E1XADPx-0007U6-2t-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Alfred M. Szmidt @ 2014-07-24  7:26 UTC (permalink / raw)
  To: Jan Chaloupka
  Cc: mtk.manpages, linux-man, libc-alpha, myllynen, drepper, pschiffe

   I, as a Red Hat employee, am covered by Red Hat's standing
   copyright assignment with the FSF.

Didn't know that such a thing existed, if it does you are.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]                         ` <E1XADPx-0007U6-2t-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
@ 2014-07-24  7:39                           ` Jan Chaloupka
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Chaloupka @ 2014-07-24  7:39 UTC (permalink / raw)
  To: ams-mXXj517/zsQ
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	pschiffe-H+wXaHxf7aLQT0dZR+AlfA

I know it from today :)

On 07/24/2014 09:26 AM, Alfred M. Szmidt wrote:
>     I, as a Red Hat employee, am covered by Red Hat's standing
>     copyright assignment with the FSF.
>
> Didn't know that such a thing existed, if it does you are.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]             ` <53CE1BC4.6040707-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-08-04  5:26               ` Jan Chaloupka
  2014-08-30 13:57               ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 18+ messages in thread
From: Jan Chaloupka @ 2014-08-04  5:26 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

ping

On 07/22/2014 10:07 AM, Jan Chaloupka wrote:
> Adding example with small C code to demonstrate progress of memory usage
>
> .\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
> .\"
> .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
> .\" This is free documentation; you can redistribute it and/or
> .\" modify it under the terms of the GNU General Public License as
> .\" published by the Free Software Foundation; either version 2 of
> .\" the License, or (at your option) any later version.
> .\"
> .\" The GNU General Public License's references to "object code"
> .\" and "executables" are to be interpreted as the output of any
> .\" document formatting or typesetting system, including
> .\" intermediate and printed output.
> .\"
> .\" This manual is distributed in the hope that it will be useful,
> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> .\" GNU General Public License for more details.
> .\"
> .\" You should have received a copy of the GNU General Public
> .\" License along with this manual; if not, see
> .\" <http://www.gnu.org/licenses/>.
> .\" %%%LICENSE_END
> .TH MEMUSAGESTAT 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
> .SH NAME
> memusagestat \- generate graphic from memory profiling data
> .SH SYNOPSIS
> .BR memusagestat " [\fIOPTION\fR]... \fIDATAFILE\fR [\fIOUTFILE\fR]"
> .SH DESCRIPTION
> .B memusagestat
> can create a PNG file with graphical representation of memory 
> profiling data.
> Red line in the graph shows the heap usage (allocated memory),
> green line shows the stack usage,
> x-scale number of memory handling functions calls or time (\fB-t\fR 
> option).
> .I DATAFILE
> is a binary data file generated by
> .BR memusage (1)
> utility with
> .B -d
> option.
> .SH OPTIONS
> .TP
> .BI \-o\  file \fR,\ \fB\-\-output= file
> Name of the output file.
> .TP
> .BI \-s\  string \fR,\ \fB\-\-string= string
> Title string used in the output graphic.
> .TP
> .BI \-t\fR,\ \fB\-\-time
> Generate output linear to time
> (default is linear to number of function calls).
> .TP
> .BI \-T\fR,\ \fB\-\-total
> Also draw graph for total memory consumption.
> .TP
> .BI \-x\  size \fR,\ \fB\-\-x-size= size
> Make graphic size pixels wide.
> .TP
> .BI \-y\  size \fR,\ \fB\-\-y\-size= size
> Make graphic size pixels high.
> .TP
> .BI \-?\fR,\ \fB\-\-help
> Print help and exit.
> .TP
> .BI \fB\-\-usage
> Print a short usage message and exit.
> .TP
> .BI \-V\fR,\ \fB\-\-version
> Print version information and exit.
> .SH EXAMPLES
> Here is a simple program \fImemusagestatexample.c\fR simulating 
> increase and decrease of memory usage:
>
> .RS 4
> #include <stdio.h>
> .RS 0
> #include <stdlib.h>
> .RE
> .RS 0
> #define CYCLES 20
> .RE
>
> int main(int argc, char ** argv) {
>         int i, j;
>         int *p = NULL;
>         printf("malloc: %d\\n", sizeof(int)*100);
>         p = malloc(sizeof(int)*100);
>
>         for (i = 0; i < CYCLES; i++) {
>                 if (i < CYCLES/2) j = i; else j--;
>                 printf("realloc: %d\\n", sizeof(int)*((j)*50 + 110));
>                 p = realloc(p, sizeof(int)*(j*50 + 100));
>                 printf("realloc: %d\\n", sizeof(int)*((j+1)*150 + 110));
>                 p = realloc(p, sizeof(int)*((j+1)*150 + 110));
>         }
>         free(p);
>         return 0;
> .RS 0
> }
> .RE
> .RE
>
> After compiling and running the following, you can see progress of 
> memory usage (memusagestatexample.png):
>
> memusage --data=memusagestatexample.dat ./memusagestatexample
> .RS 0
> memusagestat memusagestatexample.dat memusagestatexample.png
> .RE
>
> .SH BUGS
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>.
> .SH SEE ALSO
> .BR memusage (1)
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-man" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Jan Chaloupka
------------------------------
* Software Engineer          *
* ENG Base Operating Systems *
* Red Hat Czech, s. r. o.    *
* UTC+1 (CET), jchaloup      *

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]             ` <53CE1BC4.6040707-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2014-08-04  5:26               ` Jan Chaloupka
@ 2014-08-30 13:57               ` Michael Kerrisk (man-pages)
       [not found]                 ` <5401D83C.3050806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 18+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-08-30 13:57 UTC (permalink / raw)
  To: Jan Chaloupka
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

Hi Jan,

You resubmitted this page in the meusage(1) thread, but
it's a page for memusagestat(1). I'm getting a little 
confused as I try to review these threads.

Could I ask you to create two new threads that submit
the current memusage.1 and memusagestat.1 pages.
Along the way, could you convert the keywords in the
command lines to lowercase+italic (\fI). (See for example
the current mtrace.1 in Git.)

My apologies for being so slow to follow up on this.

Thanks,

Michael



On 07/22/2014 10:07 AM, Jan Chaloupka wrote:
> Adding example with small C code to demonstrate progress of memory usage
> 
> .\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
> .\"
> .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
> .\" This is free documentation; you can redistribute it and/or
> .\" modify it under the terms of the GNU General Public License as
> .\" published by the Free Software Foundation; either version 2 of
> .\" the License, or (at your option) any later version.
> .\"
> .\" The GNU General Public License's references to "object code"
> .\" and "executables" are to be interpreted as the output of any
> .\" document formatting or typesetting system, including
> .\" intermediate and printed output.
> .\"
> .\" This manual is distributed in the hope that it will be useful,
> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> .\" GNU General Public License for more details.
> .\"
> .\" You should have received a copy of the GNU General Public
> .\" License along with this manual; if not, see
> .\" <http://www.gnu.org/licenses/>.
> .\" %%%LICENSE_END
> .TH MEMUSAGESTAT 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
> .SH NAME
> memusagestat \- generate graphic from memory profiling data
> .SH SYNOPSIS
> .BR memusagestat " [\fIOPTION\fR]... \fIDATAFILE\fR [\fIOUTFILE\fR]"
> .SH DESCRIPTION
> .B memusagestat
> can create a PNG file with graphical representation of memory profiling 
> data.
> Red line in the graph shows the heap usage (allocated memory),
> green line shows the stack usage,
> x-scale number of memory handling functions calls or time (\fB-t\fR option).
> .I DATAFILE
> is a binary data file generated by
> .BR memusage (1)
> utility with
> .B -d
> option.
> .SH OPTIONS
> .TP
> .BI \-o\  file \fR,\ \fB\-\-output= file
> Name of the output file.
> .TP
> .BI \-s\  string \fR,\ \fB\-\-string= string
> Title string used in the output graphic.
> .TP
> .BI \-t\fR,\ \fB\-\-time
> Generate output linear to time
> (default is linear to number of function calls).
> .TP
> .BI \-T\fR,\ \fB\-\-total
> Also draw graph for total memory consumption.
> .TP
> .BI \-x\  size \fR,\ \fB\-\-x-size= size
> Make graphic size pixels wide.
> .TP
> .BI \-y\  size \fR,\ \fB\-\-y\-size= size
> Make graphic size pixels high.
> .TP
> .BI \-?\fR,\ \fB\-\-help
> Print help and exit.
> .TP
> .BI \fB\-\-usage
> Print a short usage message and exit.
> .TP
> .BI \-V\fR,\ \fB\-\-version
> Print version information and exit.
> .SH EXAMPLES
> Here is a simple program \fImemusagestatexample.c\fR simulating increase 
> and decrease of memory usage:
> 
> .RS 4
> #include <stdio.h>
> .RS 0
> #include <stdlib.h>
> .RE
> .RS 0
> #define CYCLES 20
> .RE
> 
> int main(int argc, char ** argv) {
>          int i, j;
>          int *p = NULL;
>          printf("malloc: %d\\n", sizeof(int)*100);
>          p = malloc(sizeof(int)*100);
> 
>          for (i = 0; i < CYCLES; i++) {
>                  if (i < CYCLES/2) j = i; else j--;
>                  printf("realloc: %d\\n", sizeof(int)*((j)*50 + 110));
>                  p = realloc(p, sizeof(int)*(j*50 + 100));
>                  printf("realloc: %d\\n", sizeof(int)*((j+1)*150 + 110));
>                  p = realloc(p, sizeof(int)*((j+1)*150 + 110));
>          }
>          free(p);
>          return 0;
> .RS 0
> }
> .RE
> .RE
> 
> After compiling and running the following, you can see progress of 
> memory usage (memusagestatexample.png):
> 
> memusage --data=memusagestatexample.dat ./memusagestatexample
> .RS 0
> memusagestat memusagestatexample.dat memusagestatexample.png
> .RE
> 
> .SH BUGS
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>.
> .SH SEE ALSO
> .BR memusage (1)
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: For review: memusage(1) man page
       [not found]                 ` <5401D83C.3050806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-09-01  7:22                   ` Jan Chaloupka
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Chaloupka @ 2014-09-01  7:22 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw,
	myllynen-H+wXaHxf7aLQT0dZR+AlfA, drepper-Re5JQEeQqe8AvxtiuMwx3w,
	Peter Schiffer

Hello, Michael

On 08/30/2014 03:57 PM, Michael Kerrisk (man-pages) wrote:
> Hi Jan,
>
> You resubmitted this page in the meusage(1) thread, but
> it's a page for memusagestat(1). I'm getting a little
> confused as I try to review these threads.

Oh, sorry about that. Man pages resent with changelog.

> Could I ask you to create two new threads that submit
> the current memusage.1 and memusagestat.1 pages.
> Along the way, could you convert the keywords in the
> command lines to lowercase+italic (\fI). (See for example
> the current mtrace.1 in Git.)
>
> My apologies for being so slow to follow up on this.

No big deal. These man pages are of low priority.

>
> Thanks,
>
> Michael
>
>
>
> On 07/22/2014 10:07 AM, Jan Chaloupka wrote:
>> Adding example with small C code to demonstrate progress of memory usage
>>
>> .\" Copyright (c) 2013, Peter Schiffer (pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)
>> .\"
>> .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
>> .\" This is free documentation; you can redistribute it and/or
>> .\" modify it under the terms of the GNU General Public License as
>> .\" published by the Free Software Foundation; either version 2 of
>> .\" the License, or (at your option) any later version.
>> .\"
>> .\" The GNU General Public License's references to "object code"
>> .\" and "executables" are to be interpreted as the output of any
>> .\" document formatting or typesetting system, including
>> .\" intermediate and printed output.
>> .\"
>> .\" This manual is distributed in the hope that it will be useful,
>> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
>> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> .\" GNU General Public License for more details.
>> .\"
>> .\" You should have received a copy of the GNU General Public
>> .\" License along with this manual; if not, see
>> .\" <http://www.gnu.org/licenses/>.
>> .\" %%%LICENSE_END
>> .TH MEMUSAGESTAT 1 2013-04-10 "GNU glibc 2.18" "Memory diagnostic tools"
>> .SH NAME
>> memusagestat \- generate graphic from memory profiling data
>> .SH SYNOPSIS
>> .BR memusagestat " [\fIOPTION\fR]... \fIDATAFILE\fR [\fIOUTFILE\fR]"
>> .SH DESCRIPTION
>> .B memusagestat
>> can create a PNG file with graphical representation of memory profiling
>> data.
>> Red line in the graph shows the heap usage (allocated memory),
>> green line shows the stack usage,
>> x-scale number of memory handling functions calls or time (\fB-t\fR option).
>> .I DATAFILE
>> is a binary data file generated by
>> .BR memusage (1)
>> utility with
>> .B -d
>> option.
>> .SH OPTIONS
>> .TP
>> .BI \-o\  file \fR,\ \fB\-\-output= file
>> Name of the output file.
>> .TP
>> .BI \-s\  string \fR,\ \fB\-\-string= string
>> Title string used in the output graphic.
>> .TP
>> .BI \-t\fR,\ \fB\-\-time
>> Generate output linear to time
>> (default is linear to number of function calls).
>> .TP
>> .BI \-T\fR,\ \fB\-\-total
>> Also draw graph for total memory consumption.
>> .TP
>> .BI \-x\  size \fR,\ \fB\-\-x-size= size
>> Make graphic size pixels wide.
>> .TP
>> .BI \-y\  size \fR,\ \fB\-\-y\-size= size
>> Make graphic size pixels high.
>> .TP
>> .BI \-?\fR,\ \fB\-\-help
>> Print help and exit.
>> .TP
>> .BI \fB\-\-usage
>> Print a short usage message and exit.
>> .TP
>> .BI \-V\fR,\ \fB\-\-version
>> Print version information and exit.
>> .SH EXAMPLES
>> Here is a simple program \fImemusagestatexample.c\fR simulating increase
>> and decrease of memory usage:
>>
>> .RS 4
>> #include <stdio.h>
>> .RS 0
>> #include <stdlib.h>
>> .RE
>> .RS 0
>> #define CYCLES 20
>> .RE
>>
>> int main(int argc, char ** argv) {
>>           int i, j;
>>           int *p = NULL;
>>           printf("malloc: %d\\n", sizeof(int)*100);
>>           p = malloc(sizeof(int)*100);
>>
>>           for (i = 0; i < CYCLES; i++) {
>>                   if (i < CYCLES/2) j = i; else j--;
>>                   printf("realloc: %d\\n", sizeof(int)*((j)*50 + 110));
>>                   p = realloc(p, sizeof(int)*(j*50 + 100));
>>                   printf("realloc: %d\\n", sizeof(int)*((j+1)*150 + 110));
>>                   p = realloc(p, sizeof(int)*((j+1)*150 + 110));
>>           }
>>           free(p);
>>           return 0;
>> .RS 0
>> }
>> .RE
>> .RE
>>
>> After compiling and running the following, you can see progress of
>> memory usage (memusagestatexample.png):
>>
>> memusage --data=memusagestatexample.dat ./memusagestatexample
>> .RS 0
>> memusagestat memusagestatexample.dat memusagestatexample.png
>> .RE
>>
>> .SH BUGS
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/libc/bugs.html>.
>> .SH SEE ALSO
>> .BR memusage (1)
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-09-01  7:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-18  9:00 For review: memusage(1) man page Jan Chaloupka
2014-07-18  9:20 ` Alfred M. Szmidt
2014-07-18  9:50   ` Jan Chaloupka
     [not found]   ` <E1X84Kh-00041J-2z-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-07-22  6:10     ` Michael Kerrisk (man-pages)
     [not found]       ` <53CE004A.3060706-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-22  8:39         ` Alfred M. Szmidt
     [not found]           ` <E1X9VbA-0002Bk-Ox-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-07-22 10:20             ` Jan Chaloupka
     [not found]               ` <53CE3AF3.40005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-07-22 11:00                 ` Alfred M. Szmidt
     [not found]                   ` <E1X9XoF-0007Vz-Lm-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-07-24  5:25                     ` Jan Chaloupka
2014-07-24  7:26                       ` Alfred M. Szmidt
     [not found]                         ` <E1XADPx-0007U6-2t-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-07-24  7:39                           ` Jan Chaloupka
2014-07-22 19:02             ` Michael Kerrisk (man-pages)
2014-07-23 14:41               ` Alfred M. Szmidt
     [not found] ` <53C8E244.2080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-07-22  6:14   ` Michael Kerrisk (man-pages)
     [not found]     ` <53CE0144.7050405-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-22  6:30       ` Jan Chaloupka
     [not found]         ` <53CE0517.2040005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-07-22  8:07           ` Jan Chaloupka
     [not found]             ` <53CE1BC4.6040707-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-08-04  5:26               ` Jan Chaloupka
2014-08-30 13:57               ` Michael Kerrisk (man-pages)
     [not found]                 ` <5401D83C.3050806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-01  7:22                   ` Jan Chaloupka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.