Discussion:
[PATCH] you can use this patch to profile cygwin
jojelino
2011-08-11 03:49:29 UTC
Permalink
And, as usual, the formatting is completely off so it couldn't be
incorporated into the source code as is regardless.
But i don't know where the formatting guideline is. may i ask you giving
me the link?
Corinna Vinschen
2011-08-11 07:12:14 UTC
Permalink
Post by jojelino
And, as usual, the formatting is completely off so it couldn't be
incorporated into the source code as is regardless.
But i don't know where the formatting guideline is. may i ask you
giving me the link?
http://cygwin.com/contrib.html, see the Section "When you have finalized
your changes"

http://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C
http://www.gnu.org/prep/standards/html_node/Change-Logs.html


Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
Christopher Faylor
2011-08-11 14:47:32 UTC
Permalink
Post by Corinna Vinschen
Post by jojelino
And, as usual, the formatting is completely off so it couldn't be
incorporated into the source code as is regardless.
But i don't know where the formatting guideline is. may i ask you
giving me the link?
http://cygwin.com/contrib.html, see the Section "When you have finalized
your changes"
http://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C
Huh. I don't see that on the contrib.html page even though I would have
sworn it was there. It is now.

cgf
Ryan Johnson
2011-08-11 16:21:06 UTC
Permalink
Post by Christopher Faylor
Post by Corinna Vinschen
Post by jojelino
And, as usual, the formatting is completely off so it couldn't be
incorporated into the source code as is regardless.
But i don't know where the formatting guideline is. may i ask you
giving me the link?
http://cygwin.com/contrib.html, see the Section "When you have finalized
your changes"
http://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C
Huh. I don't see that on the contrib.html page even though I would have
sworn it was there. It is now.
Could you please also add some guidance on what should be attached vs.
inlined in a patch submission? That has tripped me up in the past.

Ryan
Post by Christopher Faylor
cgf
jojelino
2011-08-19 21:48:18 UTC
Permalink
Post by jojelino
And, as usual, the formatting is completely off so it couldn't be
incorporated into the source code as is regardless.
But i don't know where the formatting guideline is. may i ask you giving
me the link?
The formatting is revised to adopt GNU code style (using Eclipse CDT).
and if you want make new-cygwin1.dll to profiling itself, please command

cd i686-pc-cygwin/winsup/cygwin;rm *.o;make profile=1

it would work.
and there was some issue to winsup/Makefile.common, simply expanding
ALL_CFLAGS resulted in CFLAGS are not expanded to ALL_CFLAGS. in cases
of gmon.c,

gcc -L/tmp/winsup/i686-pc-cygwin/winsup
-L/tmp/winsup/i686-pc-cygwin/winsup/cygwin
-L/tmp/winsup/i686-pc-cygwin/winsup/w32api/lib -isystem
/tmp/winsup/winsup/include -isystem /tmp/winsup/winsup/cygwin/include
-isystem /tmp/winsup/winsup/w32api/include
-B/tmp/winsup/i686-pc-cygwin/newlib/ -isystem
/tmp/winsup/i686-pc-cygwin/newlib/targ-include -isystem
/tmp/winsup/newlib/libc/include -c -Wall -Wstrict-aliasing
-Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 -I.
-I/tmp/winsup/winsup/cygwin -I/tmp/winsup/winsup/w32api/include
-I../../.././winsup/cygwin/config/i386
-I/usr/lib/gcc/i686-pc-cygwin/4.7.0/include -o ./gmon.o
/tmp/winsup/winsup/cygwin/gmon.c

after replacing simple expansion to recursively expansion, CFLAGS are
expanded properly. is it intended one?

gcc -L/tmp/winsup/i686-pc-cygwin/winsup
-L/tmp/winsup/i686-pc-cygwin/winsup/cygwin
-L/tmp/winsup/i686-pc-cygwin/winsup/w32api/lib -isystem
/tmp/winsup/winsup/include -isystem /tmp/winsup/winsup/cygwin/include
-isystem /tmp/winsup/winsup/w32api/include
-B/tmp/winsup/i686-pc-cygwin/newlib/ -isystem
/tmp/winsup/i686-pc-cygwin/newlib/targ-include -isystem
/tmp/winsup/newlib/libc/include -c -DHAVE_CONFIG_H -O4
-fomit-frame-pointer -mstackrealign -march=core2 -g -mfpmath=sse -MMD
-fmerge-constants -ftracer -mno-use-libstdc-wrappers -Wall
-Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin
-fmessage-length=0 -I. -I/tmp/winsup/winsup/cygwin
-I/tmp/winsup/winsup/w32api/include
-I../../.././winsup/cygwin/config/i386
-I/usr/lib/gcc/i686-pc-cygwin/4.7.0/include -o ./gmon.o
/tmp/winsup/winsup/cygwin/gmon.c
jojelino
2011-08-19 21:57:48 UTC
Permalink
Post by jojelino
cd i686-pc-cygwin/winsup/cygwin;rm *.o;make profile=1
it would work.
Please ignore attachment from 6:48, i have mistaken by attaching
invalid winsup-profile-support.diff

So i am replying.
jojelino
2011-08-19 21:59:19 UTC
Permalink
Post by jojelino
cd i686-pc-cygwin/winsup/cygwin;rm *.o;make profile=1
it would work.
Please ignore attachment from 6:48, i have mistaken by attaching
invalid winsup-profile-support.diff

So i am replying.
Corinna Vinschen
2011-08-20 08:49:46 UTC
Permalink
Hi Jin-woo,
Post by jojelino
Post by jojelino
cd i686-pc-cygwin/winsup/cygwin;rm *.o;make profile=1
it would work.
Please ignore attachment from 6:48, i have mistaken by attaching
invalid winsup-profile-support.diff
So i am replying.
Yes, but to the wrong list ;-)

Would you mind to resend your patches as a reply to your original
threada on the cygwin-patches list? That's where the official
patch submissions are suppsoed to go.

Btw., you don't have to attach the ChangeLog. For the lazy reader
it's easier if the ChangeLog is just inline in your mail. If you
want to avoid more spam, just omit your email address from the
ChangeLog date/name/email header.

But there's something I don't grok in your patch:

In dll_crt0_0:

+ _monstartup();

but

+#ifdef PROFILE
+ atexit (&_mcleanup);
+#endif

Shouldn't the call to _monstartup also be guarded with #ifdef PROFILE?
Same question for calls to profile_thread_off and any other profiling
code in other places.

In gcrt0.c:

+#ifndef PROFILE
void _monstartup (void) __attribute__((__constructor__));
-
+#endif

#if*n*def? Is that a typo?


Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
Loading...