[comp.sys.mac.programmer] THINK Profiler Question

jackiw@cs.swarthmore.edu (Nick Jackiw) (08/12/90)

Arghh!  Try this, instead:

-----

Meister,

I'm having a horrible time trying to profile my code (THINK Pascal v.3.0
on an 8M SE/30 under 6.0.3 Multifinder)--I keep crashing. If any one
can offer any suggestions, I'd be most grateful.

Circumstances:

Profiling seems to go okay for a few minutes, and then hangs. If I hit
the interrupt switch and 'es' from Macsbug, my (active-under-Pascal)
program shuts down and THINK resumes control, telling me there's an
illegal instruction at (finger).  Finger sometimes points to part of
my code--always at a function or procedure call--or it points to
Runtime.lib. 

Sometimes it crashes during what must be my DumpProfileToFile call, in
that a partial profile is generated.  The stats collected in this partial
program are almost definitely wrong, and include (for instance) functions
which have never been called.

An annoying side effect is that the crash somehow converts my Project. I
use SANELib881.LIB, which is kept in my main segment.  After the crash,
<<SaneLib>> (which only shows up in the Project window under Segment-View)
has been moved to a new segment of its own.

Things I've tried, both from the instructions and through guesswork:

- InitProfile and InitProfiler(n) for both very small and very large n.
My total project code size is 324K, with about 300 routines (my guess).

- Ensuring that profile.lib is in the main segment.

- Making sure that all segments are <32K (which isn't a requirement if
you're running in the environment).

- Having DEBUG and NAMES on for all routines.  I've tried both long and
short format names.

That's it.  I'd love to see a profile, but if this keeps corrupting my
project, I'll have to wait for some expert advice.  Can you give me some?

Thanks,  Nick.





-- 
------------------------
Nick Jackiw		jackiw@cs.swarthmore.edu  "Just break out the
Visual Geometry Project	jackiw@swarthmr.bitnet     rum so we seem natural!"
Swarthmore College, PA 19081-1397				-F. Franklin

tim@efi.com (Tim Maroney) (08/18/90)

In article <ZLWNMP@cs.swarthmore.edu> jackiw@cs.swarthmore.edu (Nick Jackiw)
writes:
>I'm having a horrible time trying to profile my code (THINK Pascal v.3.0
>on an 8M SE/30 under 6.0.3 Multifinder)--I keep crashing. If any one
>can offer any suggestions, I'd be most grateful.
>
>Sometimes it crashes during what must be my DumpProfileToFile call, in
>that a partial profile is generated.  The stats collected in this partial
>program are almost definitely wrong, and include (for instance) functions
>which have never been called.

I have had much the same experience with the THINK Pascal 3.1
profiler.  It tells me that all my time is spent in routines which are
not in fact called at all when I have the profiler activated -- and in
many cases, are never called at all.  For instance, it likes to tell me
that I am spending a lot of time in the MacApp busy cursor VBL routine,
although I have qBusyCursor set to zero and I have verified that the
VBL task is not installed.  I am using TP 3.0.1, MacApp 2.0, compiled
with both MacApp debugger and LightsBug, with names, running under the
THINK debugging environment with an 8 Meg Mac IIci.