(C) 2002 Robert Collins How to profile cygwin1.dll. The hard way: Build libc.a and libm.a with -pg. Build all the cygwin1.dll source - except mcount.c - with -pg and no -O2. -O2 interferes with -pg in some inlined code. Link libgmon.a into cygwin1.dll. I used a CCNOPROF target in Makefile.in to make this relatively easy. Voila.