<snip questions about how to turn on profiling in Mac VM code>
On 2001-04-28 at 1:30:31 PM, johnmci@smalltalkconsulting.com replied:
I'm not sure anyone has really explain this since it's tied to Code Warrior. If you build a Code Warrior project you must build it with CW profiling turned on in order to get the profile: to work.
(using CodeWarrior 6) Uh, yeah. I guess I forgot to mention I'd done just that; OTOH I can't for the life of me understand why the VM would slow down so drastically if profiling _hadn't_ been turned on. I disassembled the code produced and sure enough, there's stuff at function entry/exit points to read the real time clock (cycle clock? whatever) in the PPC chip itself.
And speaking of _profile:_ itself, I guess if I'm stupid enough to try to compile my own copy of the VM, it won't hurt to ask this of the group: Could I please see working example code using _profile:_ (no underscores of course) to profile, say, tinyBenchmarks? Laugh at this at your leisure, but is it SystemDictionary profile: [0 tinyBenchmarks]. "hit doIt (cmd-d) on this line" or what? Told you this would be a hairy problem! ;-)
Also you should build the VM with no inlining. This makes it much easier to read the C code and to get proper profiling information.
If it's just a case of easier, I guess I'm okay... also, I generated the C source at one other point when I specifically requested inlining where I ended up with at least one source file in the 500 kilobyte range, FWIW, but that's not what I'm currently working with. I can't seem to locate the simple list of commands to issue to generate the sources anyway - saw them here I think, but searching through the Squeak image previously showed enough to compile a working VM - looking for an "official" list anyway, maybe someday?
Apple also makes product that captures branch locations via hardware. With a .SYM file you can also get a good picture of where code usage is happening.
Sounds interesting. If I ever have any money I would consider looking into that one.
Thanks in advance for any assistance, Jean
P.S. If I ever write my own experimental version of the PPC jitter, may I call it "Oil?"
on 4/28/01 3:57 PM, Fleeberz@aol.com at Fleeberz@aol.com wrote: [...]
And speaking of _profile:_ itself, I guess if I'm stupid enough to try to compile my own copy of the VM, it won't hurt to ask this of the group: Could I please see working example code using _profile:_ (no underscores of course) to profile, say, tinyBenchmarks? Laugh at this at your leisure, but is it SystemDictionary profile: [0 tinyBenchmarks]. "hit doIt (cmd-d) on this line" or what? Told you this would be a hairy problem! ;-)
I don't really Squeak much, but I dug up a 2.7 image and browsed a bit. Use:
Smalltalk profile: [0 tinyBenchmarks]
The global variable "Smalltalk" contains an instance (the *only* instance) of SystemDictionary. After using Smalltalk for a while longer you would have discovered this, probably by printing or inspecting Smalltalk some day.
squeak-dev@lists.squeakfoundation.org