This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: Ideas for improving profil.c
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Tue, 22 Apr 2003 20:37:40 -0400
- Subject: Re: Ideas for improving profil.c
- References: <Pine.GSO.4.44.0304221738160.8320-100000@eos>
- Reply-to: cygwin-developers at cygwin dot com
On Tue, Apr 22, 2003 at 06:10:25PM -0500, Brian Ford wrote:
>I tracked down my pc sampling (profiling) problems mentioned here:
>
>http://cygwin.com/ml/cygwin/2003-04/msg01781.html
>
>My problem was that the eip returned was almost never in the profiling
>range. It was usually way down in the bowels of Windows that I have yet
>to understand. Something like 0x7ffe0304.
>
>Raising the profiling thread priority helped catch a few more valid
>addresses. I would be glad to submit a one line patch for this if anyone
>is interested.
>
>I think most OS's are able to trace processes in the kernel back to the
>entering trap, thus finding an in-range pc. So, my idea was to (and I do
>have a rough version working) naively try and walk the stack back some
>maximum number of frames until I hit the range. Better yet, only
>walk back if we are below a cygwin entry point and only up to that point.
The frame pointer in windows routines is often not right so following
the frame chain back to the caller is problematic. That's why cygwin's
signal routines go out of their way to save known frame information
whenever possible. See exceptions.cc.
cgf