This is the mail archive of the cygwin-developers@cygwin.com 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: Ideas for improving profil.c


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


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