Ideas for improving profil.c

Brian Ford
Tue Apr 22 23:10:00 GMT 2003

I tracked down my pc sampling (profiling) problems mentioned here:

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.

Is there any way to know this from the pc?  I am probably just a rambling
lunatic, so feel free to shut me up.

Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

More information about the Cygwin-developers mailing list