Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Message-ID: <015001c0d419$1dbe8530$0200a8c0@lifelesswks> From: "Robert Collins" To: "DJ Delorie" Cc: References: <000801c0d415$96ccf4b0$0200a8c0 AT lifelesswks> <200105032130 DOT RAA03969 AT envy DOT delorie DOT com> Subject: Re: DJ Please read - profiling Date: Fri, 4 May 2001 07:36:28 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 03 May 2001 21:31:15.0718 (UTC) FILETIME=[6223A260:01C0D418] Chris! Can I please have DJ's profiler. Pretty please! If I get this going I'll happily document it. Rob ----- Original Message ----- From: "DJ Delorie" To: Cc: Sent: Friday, May 04, 2001 7:30 AM Subject: Re: DJ Please read - profiling > > > I recall you have done serious work on profiling cygwin? I don't > > have dejagnu running here, nor _any idea_ on how to profile cygwin. > > To use gprof, you need to build cygwin as a static library with -pg. > That in itself is tricky, because you first have to replace malloc > with some other implementation so that it doesn't recurse (cygwin > calls the user's malloc, which *is* cygwin's malloc if you link > statically). You also have to rewrite all the startup code to work in > a non-dll situation. It's not easy to get cygwin to run this way, and > expect to end up with a useless mess when you're done profiling. > > The next step is the profiler itself - you can use gprof, but the > granularity is pretty bad for quick-lived things like cygwin. I wrote > something that single-stepped the program using the debug API and > built a profile from that; you'd have to ask Chris if I can publish > it, assuming it still works. It (my profiler) should work with cygwin > as a DLL, so that makes things easier, but programs run about 1000 > times slower :-( and you have to manually specify the range of > addresses you want to profile. You can, however, profile individual > functions via OutputDebugString controls to the profiler. > > I don't remember if my profiler infers call graph counts or if you > have to build cygwin1.dll with -pg. I think it infers the graph. > > I will gladly impart my wisdom and experience in detail if someone is > willing to validate what still currently works and write up a page for > cygwin.com. > > You don't need dejagnu at all, unless that's what you're profiling. >