mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-04 05:55:38 +08:00
Cygwin: Make gmondump conform to its doc + adjust doc
The doc for gmondump says 1 or more FILENAME are expected, but 0 is handled. That's an oversight. Make invocation with 0 FILENAMEs print a one-line help message. Reword the beginning of profiler's description doc to clarify target's child processes are run but only optionally profiled.
This commit is contained in:
parent
15c53a34bc
commit
99a4b087d4
@ -2240,9 +2240,10 @@ specifying an empty password.
|
|||||||
|
|
||||||
<refsect1 id="profiler-desc">
|
<refsect1 id="profiler-desc">
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
<para>The <command>profiler</command> utility executes a given program, and
|
<para>The <command>profiler</command> utility executes a given program and
|
||||||
optionally the children of that program, collecting the location of the
|
any children of that program, collecting the location of the CPU
|
||||||
CPU instruction pointer (IP) many times per second. This gives a profile
|
instruction pointer (IP) many times per second. (It is optional to
|
||||||
|
collect this info from child processes.) This info gives a profile
|
||||||
of the program's execution, showing where the most time is being spent.
|
of the program's execution, showing where the most time is being spent.
|
||||||
This profiling technique is called "IP sampling".</para>
|
This profiling technique is called "IP sampling".</para>
|
||||||
|
|
||||||
|
@ -46,6 +46,14 @@ OPTIONS are:\n\
|
|||||||
exit (where == stderr ? 1 : 0 );
|
exit (where == stderr ? 1 : 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __attribute__ ((__noreturn__))
|
||||||
|
usage1 (FILE *where)
|
||||||
|
{
|
||||||
|
fprintf (where, "Usage: %s [OPTIONS] FILENAME...\n", pgm);
|
||||||
|
|
||||||
|
exit (where == stderr ? 1 : 0 );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
note (const char *fmt, ...)
|
note (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -248,6 +256,10 @@ main(int argc, char **argv)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optind >= argc)
|
||||||
|
/* Print one-line help and exit. */
|
||||||
|
usage1 (ofile);
|
||||||
|
|
||||||
for (int i = optind; i < argc; i++)
|
for (int i = optind; i < argc; i++)
|
||||||
gmondump1 (argv[i]);
|
gmondump1 (argv[i]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user