[PATCH] Cygwin: New tool: cygmon

Jon Turney jon.turney@dronecode.org.uk
Sun Jun 13 14:40:56 GMT 2021

On 12/06/2021 07:46, Mark Geisert wrote:
> This tool is a sampling profiler of Cygwin programs with their DLLs.
> Presently its development is managed at https://github.com/mgeisert/cygmon.
> Documentation of cygmon has been added to the usual doc/utils.xml file.


How attached are you to the name?

There's nothing cygwin specific about this (you could profile any 
Windows executable), so does it really need 'cyg' in the name?

It's a profiler, so what is 'mon' short for?

A more detailed review to follow.

> There are a couple of one-line fixes to unrelated files for minor issues
> noticed while implementing cygmon.  The files involved are gmon.c and
> doc/utils.xml (one line not part of the cygmon updates to that file).

Please submit the gmon fix as a separate patch, ideally with some 
commentary about what it fixes.

> diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml
> index 22bd86904..2f256d602 100644
> --- a/winsup/doc/utils.xml
> +++ b/winsup/doc/utils.xml
> +
> +    <refsect1 id="cygmon-desc">
> +      <title>Description</title>
> +    <para>The <command>cygmon</command> utility executes a given program, and
> +      optionally the children of that program, collecting the location of the
> +      CPU instruction pointer (IP) many times per second. This gives a profile
> +      of the program's execution, showing where the most time is being spent.
> +      This profiling technique is called "IP sampling".</para>

Contrasting this with how 'ssp' profiles (and vice versa there) would be 

> +
> +    <para>A novel feature of <command>cygmon</command> is that time spent in
> +      DLLs loaded with or by your program is profiled too. You use
> +      <command>gprof</command> to process and display the resulting profile
> +      information. In this fashion you can determine whether your own code,
> +      the Cygwin DLL, or another DLL has "hot spots" that might benefit from
> +      tuning.</para>
> +
> +    <para> Note that <command>cygmon</command> is a native Windows program
> +      and so does not rely on the Cygwin DLL itself (you can verify this with
> +      <command>cygcheck</command>). As a result it does not understand
> +      symlinks in its command line.</para>
> +    </refsect1>

More information about the Cygwin-patches mailing list