getrusage.2 updates
I'm re-sending these patches from November 2009. Please can they be included?
They will apply to the current master branch, but you may wish to bump the date.
Thanks
Signature · 6 lines
Mark -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1272228153-11825-1-git-send-email-mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org
PATCH 1/3 getrusage.2: Description of maintained fields
These descriptions are taken from NetBSD 5.0's getrusage(2).
--- man2/getrusage.2 | 69 +++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 51 insertions(+), 18 deletions(-)
man2/getrusage.2 +51 -18
@@ -89,6 +89,57 @@ struct rusage { }; .fi .in +.PP +Not all fields are completed; unmaintained fields are set to zero by +the kernel. The fields are interpreted as follows: +.TP +.I ru_utime +the total amount of time spent executing in user mode. +.TP +.I ru_stime +the total amount of time spent in the system executing on behalf +of the process(es). +.TP +.IR ru_maxrss " (unmaintained)" +.TP +.IR ru_ixrss " (unmaintained)" +.TP +.IR ru_idrss " (unmaintained)" +.TP +.IR ru_isrss " (unmaintained)" +.TP +.I ru_minflt +the number of page faults serviced without any I/O activity; here +I/O activity is avoided by \*(lqreclaiming\*(rq a page frame from +the list of pages awaiting reallocation. +.TP +.I ru_majflt +the number of page faults serviced that required I/O activity. +.TP +.IR ru_nswap " (unmaintained)" +.TP +.IR ru_inblock " (since Linux 2.6.22)" +the number of times the file system had to perform input. +.TP +.IR ru_oublock " (since Linux 2.6.22)" +the number of times the file system had to perform output. +.TP +.IR ru_msgsnd " (unmaintained)" +.TP +.IR ru_msgrcv " (unmaintained)" +.TP +.IR ru_nsignals " (unmaintained)" +.TP +.IR ru_nvcsw " (since Linux 2.6)" +the number of times a context switch resulted due to a process +voluntarily giving up the processor before its time slice was +completed (usually to await availability of a resource). +.TP +.IR ru_nivcsw " (since Linux 2.6)" +the number of times a context switch resulted due to a higher +priority process becoming runnable or because the current process +exceeded its time slice. +.PP .SH "RETURN VALUE" On success, zero is returned. On error, \-1 is returned, and
@@ -140,24 +191,6 @@ This nonconformance is rectified in Linux 2.6.9 and later. .LP The structure definition shown at the start of this page was taken from 4.3BSD Reno. -Not all fields are meaningful under Linux. -In Linux 2.4 only the fields -.IR ru_utime , -.IR ru_stime , -.IR ru_minflt , -and -.I ru_majflt -are maintained. -Since Linux 2.6, -.I ru_nvcsw -and -.I ru_nivcsw -are also maintained. -Since Linux 2.6.22, -.I ru_inblock -and -.I ru_oublock -are also maintained. See also the description of .IR /proc/PID/stat
Signature · 6 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1272228153-11825-2-git-send-email-mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org
Re: [PATCH 1/3] getrusage.2: Description of maintained fields
Quoted 1 line · Mark Hills
These descriptions are taken from NetBSD 5.0's getrusage(2).
Applied for man-pages-3.25.
thanks for your patience Mark!
Cheers,
Michael
Quoted 96 lines
Signed-off-by Mark Hills <[email protected]>---
man2/getrusage.2 | 69 +++++++++++++++++++++++++++++++++++++++--------------1 files changed, 51 insertions(+), 18 deletions(-)man2/getrusage.2 +0
-0@@ -89,6 +89,57 @@ struct rusage { };.fi
.in
+.PPman2/getrusage.2 +50
-0+Not all fields are completed; unmaintained fields are set to zero by +the kernel. The fields are interpreted as follows: +.TP +.I ru_utime +the total amount of time spent executing in user mode. +.TP +.I ru_stime +the total amount of time spent in the system executing on behalf +of the process(es). +.TP +.IR ru_maxrss " (unmaintained)" +.TP +.IR ru_ixrss " (unmaintained)" +.TP +.IR ru_idrss " (unmaintained)" +.TP +.IR ru_isrss " (unmaintained)" +.TP +.I ru_minflt +the number of page faults serviced without any I/O activity; here +I/O activity is avoided by \*(lqreclaiming\*(rq a page frame from +the list of pages awaiting reallocation. +.TP +.I ru_majflt +the number of page faults serviced that required I/O activity. +.TP +.IR ru_nswap " (unmaintained)" +.TP +.IR ru_inblock " (since Linux 2.6.22)" +the number of times the file system had to perform input. +.TP +.IR ru_oublock " (since Linux 2.6.22)" +the number of times the file system had to perform output. +.TP +.IR ru_msgsnd " (unmaintained)" +.TP +.IR ru_msgrcv " (unmaintained)" +.TP +.IR ru_nsignals " (unmaintained)" +.TP +.IR ru_nvcsw " (since Linux 2.6)" +the number of times a context switch resulted due to a process +voluntarily giving up the processor before its time slice was +completed (usually to await availability of a resource). +.TP +.IR ru_nivcsw " (since Linux 2.6)" +the number of times a context switch resulted due to a higher +priority process becoming runnable or because the current process +exceeded its time slice. +.PP.SH "RETURN VALUE"
On success, zero is returned.
On error, \-1 is returned, andman2/getrusage.2 +0
-0@@ -140,24 +191,6 @@ This nonconformance is rectified in Linux 2.6.9 and later..LP
The structure definition shown at the start of this page was taken from 4.3BSD Reno.man2/getrusage.2 +0
-18-Not all fields are meaningful under Linux. -In Linux 2.4 only the fields -.IR ru_utime , -.IR ru_stime , -.IR ru_minflt , -and -.I ru_majflt -are maintained. -Since Linux 2.6, -.I ru_nvcsw -and -.I ru_nivcsw -are also maintained. -Since Linux 2.6.22, -.I ru_inblock -and -.I ru_oublock -are also maintained.See also the description of
.IR/proc/PID/stat
--
1.7.1
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface" http://blog.man7.org/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/3 getrusage.2: Add ru_maxrss
In reply to a message not in the archiveSee kernel commit 1f10206.
--- man2/getrusage.2 | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
man2/getrusage.2 +5 -1
@@ -100,7 +100,11 @@ the total amount of time spent executing in user mode. the total amount of time spent in the system executing on behalf of the process(es). .TP -.IR ru_maxrss " (unmaintained)" +.IR ru_maxrss " (since Linux 2.6.32)" +the maximum resident set size used (in kilobytes). For +.B RUSAGE_CHILDREN +this is the resident set size of the largest child, not the maximum +resident set size of the process tree. .TP .IR ru_ixrss " (unmaintained)" .TP
Signature · 6 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1272228153-11825-3-git-send-email-mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org
Re: [PATCH 2/3] getrusage.2: Add ru_maxrss
Hi Mark,
Quoted 1 line · Mark Hills
See kernel commit 1f10206.
Thanks. Applied for 3.25
Cheers,
Michael
Quoted 26 lines
Signed-off-by Mark Hills <[email protected]>---
man2/getrusage.2 | 6 +++++-1 files changed, 5 insertions(+), 1 deletions(-)man2/getrusage.2 +0
-0@@ -100,7 +100,11 @@ the total amount of time spent executing in user mode.the total amount of time spent in the system executing on behalf of the process(es).
.TP
-.IRru_maxrss" (unmaintained)"
+.IRru_maxrss" (since Linux 2.6.32)"man2/getrusage.2 +4
-0+the maximum resident set size used (in kilobytes). For +.B RUSAGE_CHILDREN +this is the resident set size of the largest child, not the maximum +resident set size of the process tree..TP
.IRru_ixrss" (unmaintained)"
.TP
--
1.7.1
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface" http://blog.man7.org/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/3 getrusage.2: Bump revision
In reply to a message not in the archive--- man2/getrusage.2 | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
man2/getrusage.2 +3 -1
@@ -32,8 +32,10 @@ .\" when SIGCHLD is being ignored is fixed in 2.6.9. .\" 2008-02-22, Sripathi Kodi <[email protected]>: Document RUSAGE_THREAD .\" 2008-05-25, mtk, clarify RUSAGE_CHILDREN + other clean-ups. +.\" 2009-11-28, Mark Hills <[email protected]>: Description of fields, +.\" document ru_maxrss .\" -.TH GETRUSAGE 2 2009-08-25 "Linux" "Linux Programmer's Manual" +.TH GETRUSAGE 2 2009-11-28 "Linux" "Linux Programmer's Manual" .SH NAME getrusage \- get resource usage .SH SYNOPSIS
Signature · 6 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1272228153-11825-4-git-send-email-mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org
Re: [PATCH 3/3] getrusage.2: Bump revision
Hi Mark,
Applied a fix like you suggest below, but marked with today's date (2010-05-24). Sorry about the large gap between the two dates....
Thanks
Michael
Quoted 26 lines · Mark Hills
Signed-off-by Mark Hills <[email protected]>---
man2/getrusage.2 | 4 +++-1 files changed, 3 insertions(+), 1 deletions(-)man2/getrusage.2 +0
-0@@ -32,8 +32,10 @@.\" when SIGCHLD is being ignored is fixed in 2.6.9.
.\" 2008-02-22, Sripathi Kodi <[email protected]>: DocumentRUSAGE_THREAD.\" 2008-05-25, mtk, clarifyRUSAGE_CHILDREN+ other clean-ups.
+.\" 2009-11-28, Mark Hills <[email protected]>: Description of fields, +.\" documentru_maxrss
.\"
-.TH GETRUSAGE 2 2009-08-25 "Linux" "Linux Programmer's Manual"
+.TH GETRUSAGE 2 2009-11-28 "Linux" "Linux Programmer's Manual"
.SH NAME
getrusage \- get resource usage
.SH SYNOPSIS
--
1.7.1
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface" http://blog.man7.org/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] getrusage.2: Bump revision
In reply to a message not in the archiveHello Mark,
Your patches prompted me to add various other pieces to the man page. Your comments welcome, if you have a chance to review.
Cheers,
Michael
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992
.\" and Copyright (c) 2002 Michael Kerrisk
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formerly included
.\" coverage of getrusage(2), has been split, so that the latter is
.\" now covered in its own getrusage.2. For older details of change
.\" history, etc., see getrlimit.2
.\"
.\" Modified 2004-11-16, mtk, Noted that the nonconformance
.\" when SIGCHLD is being ignored is fixed in 2.6.9.
.\" 2008-02-22, Sripathi Kodi <[email protected]>: Document RUSAGE_THREAD .\" 2008-05-25, mtk, clarify RUSAGE_CHILDREN + other clean-ups.
.\" 2010-05-24, Mark Hills <[email protected]>: Description of fields,
.\" document ru_maxrss
.\" 2010-05-24, mtk, enhanced description of various fields
.\"
.TH GETRUSAGE 2 2010-05-24 "Linux" "Linux Programmer's Manual"
.SH NAME
getrusage \- get resource usage
.SH SYNOPSIS
.B #include <sys/time.h>
.br
.B #include <sys/resource.h>
.sp
.BI "int getrusage(int " who ", struct rusage *" usage );
.SH DESCRIPTION
.PP
.BR getrusage ()
returns resource usage measures for
.IR who ,
which can be one of the following:
.TP
.B RUSAGE_SELF
Return resource usage statistics for the calling process,
which is the sum of resources used by all threads in the process.
.TP
.B RUSAGE_CHILDREN
Return resource usage statistics for all children of the
calling process that have terminated and been waited for.
These statistics will include the resources used by grandchildren,
and further removed descendants,
if all of the intervening descendants waited on their terminated children.
.TP
.BR RUSAGE_THREAD " (since Linux 2.6.26)"
Return resource usage statistics for the calling thread.
.PP
The resource usages are returned in the structure pointed to by
.IR usage ,
which has the following form:
.PP
.in +4n
.nf
struct rusage {
struct timeval ru_utime; /* user CPU time used */
struct timeval ru_stime; /* system CPU time used */
long ru_maxrss; /* maximum resident set size */
long ru_ixrss; /* integral shared memory size */
long ru_idrss; /* integral unshared data size */
long ru_isrss; /* integral unshared stack size */
long ru_minflt; /* page reclaims (soft page faults) */
long ru_majflt; /* page faults (hard page faults) */
long ru_nswap; /* swaps */
long ru_inblock; /* block input operations */
long ru_oublock; /* block output operations */
long ru_msgsnd; /* IPC messages sent */
long ru_msgrcv; /* IPC messages received */
long ru_nsignals; /* signals received */
long ru_nvcsw; /* voluntary context switches */
long ru_nivcsw; /* involuntary context switches */
};
.fi
.in
.PP
Not all fields are completed; unmaintained fields are set to zero by
the kernel. The fields are interpreted as follows:
.TP
.I ru_utime
This is the total amount of time spent executing in user mode,
expressed in a
.I timeval
structure (seconds plus microseconds).
.TP
.I ru_stime
This is the total amount of time spent executing in kernel mode,
expressed in a
.I timeval
structure (seconds plus microseconds).
.TP
.IR ru_maxrss " (since Linux 2.6.32)"
This is the maximum resident set size used (in kilobytes). For
.BR RUSAGE_CHILDREN ,
this is the resident set size of the largest child, not the maximum
resident set size of the process tree.
.TP
.IR ru_ixrss " (unmaintained)"
On some systems, this is the integral of the text segment memory consumption,
expressed in kilobyte-seconds.
.TP
.IR ru_idrss " (unmaintained)"
On some systems, this is the integral of the data segment memory consumption,
expressed in kilobyte-seconds.
.TP
.IR ru_isrss " (unmaintained)"
On some systems, this is the integral of the stack memory consumption,
expressed in kilobyte-seconds.
.TP
.I ru_minflt
The number of page faults serviced without any I/O activity; here
I/O activity is avoided by \*(lqreclaiming\*(rq a page frame from
the list of pages awaiting reallocation.
.TP
.I ru_majflt
The number of page faults serviced that required I/O activity.
.TP
.IR ru_nswap " (unmaintained)"
On some systems, this is the number of swaps out of physical memory.
.TP
.IR ru_inblock " (since Linux 2.6.22)"
The number of times the file system had to perform input.
.TP
.IR ru_oublock " (since Linux 2.6.22)"
The number of times the file system had to perform output.
.TP
.IR ru_msgsnd " (unmaintained)"
.\" On FreeBSD 6.2, this appears to measure messages sent on sockets
On some systems,
this field records the number of messages sent over sockets.
.TP
.IR ru_msgrcv " (unmaintained)"
.\" On FreeBSD 6.2, this appears to measure messages received on sockets
On some systems,
this field records the number of messages received over sockets.
.TP
.IR ru_nsignals " (unmaintained)"
On some systems, this field records the numner of signals received.
.TP
.IR ru_nvcsw " (since Linux 2.6)"
The number of times a context switch resulted due to a process
voluntarily giving up the processor before its time slice was
completed (usually to await availability of a resource).
.TP
.IR ru_nivcsw " (since Linux 2.6)"
The number of times a context switch resulted due to a higher
priority process becoming runnable or because the current process
exceeded its time slice.
.PP
.SH "RETURN VALUE"
On success, zero is returned.
On error, \-1 is returned, and
.I errno
is set appropriately.
.SH ERRORS
.TP
.B EFAULT
.I usage
points outside the accessible address space.
.TP
.B EINVAL
.I who
is invalid.
.SH "CONFORMING TO"
SVr4, 4.3BSD.
POSIX.1-2001 specifies
.BR getrusage (),
but only specifies the fields
.I ru_utime
and
.IR ru_stime .
.B RUSAGE_THREAD
is Linux-specific.
.SH NOTES
Resource usage metrics are preserved across an
.BR execve (2).
Including
.I <sys/time.h>
is not required these days, but increases portability. (Indeed,
.I struct timeval
is defined in
.IR <sys/time.h> .)
.PP
In Linux kernel versions before 2.6.9, if the disposition of .B SIGCHLD
is set to
.B SIG_IGN
then the resource usages of child processes
are automatically included in the value returned by .BR RUSAGE_CHILDREN ,
although POSIX.1-2001 explicitly prohibits this. This nonconformance is rectified in Linux 2.6.9 and later. .\" See the description of getrusage() in XSH.
.\" A similar statement was also in SUSv2.
.LP
The structure definition shown at the start of this page was taken from 4.3BSD Reno.
See also the description of
.IR /proc/PID/stat
in
.BR proc (5).
.SH "SEE ALSO"
.BR clock_gettime (2),
.BR getrlimit (2),
.BR times (2),
.BR wait (2),
.BR wait4 (2),
.BR clock (3)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): AANLkTikYUdg2o9JAH8NOK0Wjk6aWQlr-x2k4-Ts_XF3Z-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 3/3] getrusage.2: Bump revision
Quoted 2 lines · Michael Kerrisk
Your patches prompted me to add various other pieces to the man page. Your comments welcome, if you have a chance to review.
Sure, no problem.
The extra detail to the descriptions is good, but I have some comments on the unmaintained ones:
Quoted 12 lines
.IR
ru_ixrss" (unmaintained)"
On some systems, this is the integral of the text segment memory consumption, expressed in kilobyte-seconds.
.TP
.IRru_idrss" (unmaintained)"
On some systems, this is the integral of the data segment memory consumption, expressed in kilobyte-seconds.
.TP
.IRru_isrss" (unmaintained)"
On some systems, this is the integral of the stack memory consumption, expressed in kilobyte-seconds.
.TP
[...]
Quoted 3 lines
.IR
ru_nswap" (unmaintained)"
On some systems, this is the number of swaps out of physical memory. .TP
[...]
Quoted 5 lines
.IR
ru_msgsnd" (unmaintained)"
.\" On FreeBSD 6.2, this appears to measure messages sent on sockets On some systems,
this field records the number of messages sent over sockets. .TP
Quoted 8 lines
.IR
ru_msgrcv" (unmaintained)"
.\" On FreeBSD 6.2, this appears to measure messages received on sockets On some systems,
this field records the number of messages received over sockets. .TP
.IRru_nsignals" (unmaintained)"
On some systems, this field records the numner of signals received. .TP
In my changes I decided specifically to leave out the unmaintained fields. My reasoning was an assumption that the man page is to document the Linux getrusage() call. If something is unimplemented on Linux then a explanation of what it does or "appears to" do on another platform is not relevant, and will easily be misleading or out of date; that information can easily and definitively be found in documentation for the other platforms.
Including them has opened a can of worms already: what is the difference between messages "sent on" sockets, or "sent over" sockets?
There's a typo: "numner".
Thanks for applying the patches.
Signature · 5 lines
Mark -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): alpine.NEB.2.01.1005271220220.21247-4Gsws06j5aKxDRllUHgonQ@public.gmane.org
Re: [PATCH 3/3] getrusage.2: Bump revision
Hi Mark,
Quoted 49 lines · Mark Hills
Quoted 2 lines · Michael Kerrisk
Your patches prompted me to add various other pieces to the man page. Your comments welcome, if you have a chance to review.
Sure, no problem.
The extra detail to the descriptions is good, but I have some comments on the unmaintained ones:
Quoted 12 lines
.IR
ru_ixrss" (unmaintained)"
On some systems, this is the integral of the text segment memory consumption, expressed in kilobyte-seconds.
.TP
.IRru_idrss" (unmaintained)"
On some systems, this is the integral of the data segment memory consumption, expressed in kilobyte-seconds.
.TP
.IRru_isrss" (unmaintained)"
On some systems, this is the integral of the stack memory consumption, expressed in kilobyte-seconds.
.TP[...]
Quoted 3 lines
.IR
ru_nswap" (unmaintained)"
On some systems, this is the number of swaps out of physical memory. .TP[...]
Quoted 5 lines
.IR
ru_msgsnd" (unmaintained)"
.\" On FreeBSD 6.2, this appears to measure messages sent on sockets On some systems,
this field records the number of messages sent over sockets. .TPQuoted 8 lines
.IR
ru_msgrcv" (unmaintained)"
.\" On FreeBSD 6.2, this appears to measure messages received on sockets On some systems,
this field records the number of messages received over sockets. .TP
.IRru_nsignals" (unmaintained)"
On some systems, this field records the numner of signals received. .TPIn my changes I decided specifically to leave out the unmaintained fields. My reasoning was an assumption that the man page is to document the Linux
getrusage()call. If something is unimplemented on Linux then a explanation of what it does or "appears to" do on another platform is not relevant, and will easily be misleading or out of date; that information can easily and definitively be found in documentation for the other platforms.
Quoted 2 lines
Including them has opened a can of worms already: what is the difference between messages "sent on" sockets, or "sent over" sockets?
Hmmm -- that's just a language issue.
Quoted 1 line
There's a typo: "numner".
Thanks.
Quoted 1 line
Thanks for applying the patches.
I see your point, but on the other hand, people will always ask: why are those fields there? The text was my attempt to address that question. But, perhaps you are right. I've commented out my text, and added a generic statement for each of the fields that it is currently unused on Linux, and an overall statement about why the unmaintained fields even appear in the structure.
Cheers,
Michael
man2/getrusage.2 +6 -3
@@ -36,7 +36,7 @@ .\" document ru_maxrss .\" 2010-05-24, mtk, enhanced description of various fields .\" -.TH GETRUSAGE 2 2010-05-24 "Linux" "Linux Programmer's Manual" +.TH GETRUSAGE 2 2010-06-14 "Linux" "Linux Programmer's Manual" .SH NAME getrusage \- get resource usage .SH SYNOPSIS
@@ -93,8 +93,11 @@ struct rusage { .fi .in .PP -Not all fields are completed; unmaintained fields are set to zero by -the kernel. The fields are interpreted as follows: +Not all fields are completed; +unmaintained fields are set to zero by the kernel. +(The unmaintained fields are provided for compatibility with other systems, +and because they may one day be supported on Linux.) +The fields are interpreted as follows: .TP .I ru_utime This is the total amount of time spent executing in user mode,
@@ -115,16 +118,20 @@ this is the resident set size of the largest
child, not the maximum
resident set size of the process tree.
.TP
.IR ru_ixrss " (unmaintained)"
-On some systems, this is the integral of the text segment memory consumption, -expressed in kilobyte-seconds.
+This field is currently unused on Linux.
+.\" On some systems,
+.\" this is the integral of the text segment memory consumption, +.\" expressed in kilobyte-seconds.
.TP
.IR ru_idrss " (unmaintained)"
-On some systems, this is the integral of the data segment memory consumption, -expressed in kilobyte-seconds.
+This field is currently unused on Linux.
+.\" On some systems, this is the integral of the data segment memory consumption,
+.\" expressed in kilobyte-seconds.
.TP
.IR ru_isrss " (unmaintained)"
-On some systems, this is the integral of the stack memory consumption, -expressed in kilobyte-seconds.
+This field is currently unused on Linux.
+.\" On some systems, this is the integral of the stack memory consumption, +.\" expressed in kilobyte-seconds.
.TP
.I ru_minflt
The number of page faults serviced without any I/O activity; here
@@ -135,7 +142,8 @@ the list of pages awaiting reallocation.
The number of page faults serviced that required I/O activity. .TP
.IR ru_nswap " (unmaintained)"
-On some systems, this is the number of swaps out of physical memory. +This field is currently unused on Linux.
+.\" On some systems, this is the number of swaps out of physical memory.
.TP
.IR ru_inblock " (since Linux 2.6.22)"
The number of times the file system had to perform input.
@@ -144,17 +152,20 @@ The number of times the file system had to perform input.
The number of times the file system had to perform output.
.TP
.IR ru_msgsnd " (unmaintained)"
+This field is currently unused on Linux.
.\" On FreeBSD 6.2, this appears to measure messages sent over sockets
-On some systems,
-this field records the number of messages sent over sockets.
+.\" On some systems,
+.\" this field records the number of messages sent over sockets.
.TP
.IR ru_msgrcv " (unmaintained)"
+This field is currently unused on Linux.
.\" On FreeBSD 6.2, this appears to measure messages received over sockets
-On some systems,
-this field records the number of messages received over sockets. +.\" On some systems,
+.\" this field records the number of messages received over sockets.
.TP
.IR ru_nsignals " (unmaintained)"
-On some systems, this field records the number of signals received. +This field is currently unused on Linux.
+.\" On some systems, this field records the number of signals received.
.TP
.IR ru_nvcsw " (since Linux 2.6)"
The number of times a context switch resulted due to a process
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): AANLkTilIJP0qepLuCReHIbVvia5ajVjyJ25Xxrhop4pR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 3/3] getrusage.2: Bump revision
Quoted 3 lines · Michael Kerrisk
Hi Mark,
On Thu, May 27, 2010 at 1:49 PM, Mark Hills <[email protected]> wrote:
[...]
Quoted 8 lines
Quoted 8 lines
In my changes I decided specifically to leave out the unmaintained fields. My reasoning was an assumption that the man page is to document the Linux
getrusage()call. If something is unimplemented on Linux then a explanation of what it does or "appears to" do on another platform is not relevant, and will easily be misleading or out of date; that information can easily and definitively be found in documentation for the other platforms.
Quoted 4 lines
Quoted 2 lines
Including them has opened a can of worms already: what is the difference between messages "sent on" sockets, or "sent over" sockets?
Hmmm -- that's just a language issue.
That makes sense. Sorry, I didn't realise that the FreeBSD notes are actually in a comment and do not appear in the actual page.
Quoted 4 lines
Quoted 1 line
There's a typo: "numner".
Thanks.
Quoted 8 lines
Quoted 1 line
Thanks for applying the patches.
I see your point, but on the other hand, people will always ask: why are those fields there? The text was my attempt to address that question. But, perhaps you are right. I've commented out my text, and added a generic statement for each of the fields that it is currently unused on Linux, and an overall statement about why the unmaintained fields even appear in the structure.
Great, I think it's better overall now.
Quoted 95 lines
Cheers,
Michael
man2/getrusage.2 +6
-3@@ -36,7 +36,7 @@ .\" document ru_maxrss .\" 2010-05-24, mtk, enhanced description of various fields .\" -.TH GETRUSAGE 2 2010-05-24 "Linux" "Linux Programmer's Manual" +.TH GETRUSAGE 2 2010-06-14 "Linux" "Linux Programmer's Manual" .SH NAME getrusage \- get resource usage .SH SYNOPSIS@@ -93,8 +93,11 @@ struct rusage { .fi .in .PP -Not all fields are completed; unmaintained fields are set to zero by -the kernel. The fields are interpreted as follows: +Not all fields are completed; +unmaintained fields are set to zero by the kernel. +(The unmaintained fields are provided for compatibility with other systems, +and because they may one day be supported on Linux.) +The fields are interpreted as follows: .TP .I ru_utime This is the total amount of time spent executing in user mode,@@ -115,16 +118,20 @@ this is the resident set size of the largestchild, not the maximum
resident set size of the process tree.
.TP
.IRru_ixrss" (unmaintained)"man2/getrusage.2 +6
-4-On some systems, this is the integral of the text segment memory consumption, -expressed in kilobyte-seconds. +This field is currently unused on Linux. +.\" On some systems, +.\" this is the integral of the text segment memory consumption, +.\" expressed in kilobyte-seconds. .TP .IR ru_idrss " (unmaintained)" -On some systems, this is the integral of the data segment memory consumption, -expressed in kilobyte-seconds. +This field is currently unused on Linux. +.\" On some systems, this is the integral of the data segment memoryconsumption,
+.\" expressed in kilobyte-seconds.
.TP
.IRru_isrss" (unmaintained)"man2/getrusage.2 +13
-8-On some systems, this is the integral of the stack memory consumption, -expressed in kilobyte-seconds. +This field is currently unused on Linux. +.\" On some systems, this is the integral of the stack memory consumption, +.\" expressed in kilobyte-seconds. .TP .I ru_minflt The number of page faults serviced without any I/O activity; here@@ -135,7 +142,8 @@ the list of pages awaiting reallocation. The number of page faults serviced that required I/O activity. .TP .IR ru_nswap " (unmaintained)" -On some systems, this is the number of swaps out of physical memory. +This field is currently unused on Linux. +.\" On some systems, this is the number of swaps out of physical memory. .TP .IR ru_inblock " (since Linux 2.6.22)" The number of times the file system had to perform input.@@ -144,17 +152,20 @@ The number of times the file system had to perform input. The number of times the file system had to perform output. .TP .IR ru_msgsnd " (unmaintained)" +This field is currently unused on Linux. .\" On FreeBSD 6.2, this appears to measure messages sent over sockets -On some systems, -this field records the number of messages sent over sockets. +.\" On some systems, +.\" this field records the number of messages sent over sockets. .TP .IR ru_msgrcv " (unmaintained)" +This field is currently unused on Linux. .\" On FreeBSD 6.2, this appears to measure messages received over sockets -On some systems, -this field records the number of messages received over sockets. +.\" On some systems, +.\" this field records the number of messages received over sockets. .TP .IR ru_nsignals " (unmaintained)" -On some systems, this field records the number of signals received. +This field is currently unused on Linux. +.\" On some systems, this field records the number of signals received. .TP .IR ru_nvcsw " (since Linux 2.6)" The number of times a context switch resulted due to a process
Signature · 5 lines
Mark -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html