This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] profile support


On 2011-08-23 PM 2:40, Christopher Faylor wrote:
On Tue, Aug 23, 2011 at 02:05:06PM +0900, jojelino wrote:
Index: winsup/cygwin/Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.248
diff -u -p -r1.248 Makefile.in
--- winsup/cygwin/Makefile.in	2 May 2011 19:14:39 -0000	1.248
+++ winsup/cygwin/Makefile.in	22 Aug 2011 20:27:57 -0000
@@ -233,7 +233,7 @@ EXTRALIBS:=libautomode.a libbinmode.a li
INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o
TARGET_LIBS:=$(LIB_NAME) $(CYGWIN_START) $(GMON_START) $(LIBGMON_A) $(SUBLIBS) $(INSTOBJS) $(EXTRALIBS)

-ifneq "${filter -O%,$(CFLAGS)}" ""
+ifneq "" ""

-    void *rv = malloc(size);
+    void *rv = LocalAlloc(0x40,size);

There are a few things in your patch which make no sense. The above are two of them. I am not going to look further. The patch certainly can't go in as is.

cgf

The two of them is now

 ifneq "${filter -O%,$(CFLAGS)}" ""
+ifneq '$(profile)' '1'
 endif
...
...
+endif

+#if !defined(PROFILE)
     void *rv = malloc(size);
+#else
+    void *rv = LocalAlloc(LMEM_FIXED,size);
+#endif

changelog of winsup-profile-support-3.diff
Following patch are not effective unless you 'make profile=1'

* profil.h: (struct profinfo::{queue,operational}): New member.
(struct clk): New struct.
* gmon.h: (struct gmonparam::comm_kcount): New member.
* gmon.c: (_gmonparam): Add NO_COPY_INIT.
* profil.c: (prof): Ditto.
(profile_off): Flush profiling request.
(apc_spawnthread): New function.
(profile_on): Initialize init_global_security prior to use it, and spawn the consumer by issuing APC call.
(fake_sbrk): Use LocalAlloc instead of malloc.
(monstartup): Claim memory for comm_kcount.
(_mcleanup): Alter formatting of cleanup filename, decide hz which maximizes kcount, calculate kcount using comm_kcount.
* gcrt0.c (PROFILE): Define.
(_monstartup): Use it.
* exceptions.cc (ctrl_c_handler): Stop the consumer thread explicitly to avoid deadlock.
* external.cc (exit_process): Ditto.
* pinfo.cc (pinfo::exit): Ditto.
* init.cc (respawn_wow64_process): Ditto.
(dll_entry): call __cyg_profile_{func,tls}_{ctor,dtor} to {un}initialize instrument function.
* dcrt0.cc (dll_crt0_0): call _monstartup,atexit in proper order.
* Makefile.in (EXTRA_DEPENDENCIES_1): Define variable.
(EXTRA_LDFLAGS_1): Ditto.
(profile): Ditto.
(PROFILE_OPT_OUT): Ditto.
(CFLAGS_SAVE): Clobber CFLAGS.
(CFLAGS): Redefine.
(gcrt1.o): use gcrt0.c as prerequisite.
(TEST_DLL_NAME): use EXTRA_DEPENDENCIES_?, EXTRA_LDFLAGS_?.
* sec_helper.cc (init_global_security): Check if called twice.
* boundbuffer.c: New file.
* boundbuffer.h: Ditto.
* instrument.c: Ditto.
* instrument.h: Ditto.

changelog of winsup-makefile.diff
* Makefile.common (ALL_CFLAGS): Replace simple expansion to recursive expansion.

Attachment: winsup-profile-support-3.diff
Description: Text document

Attachment: winsup-makefile.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]