When you're doing your performance analysis, you may find yourself
wishing you could run a profiler. (Or you may not, either, but
whatever.)
System/161 can actually collect kernel profiles for you without any
extra action on your part. That is, you don't have to recompile with
profiling support.
To collect a profile, use trace161 instead of sys161 (as always for
features that slow the simulator down) and use the -P option, perhaps
like this:
trace161 -P kernel 'p /sbin/poweroff'
This will leave a file in the current directory that you can feed to
gprof, like this:
gprof kernel gmon.out
Note that on ice the default version of gprof (in /usr/local/bin) is
broken, although the system one (in /usr/bin) seems to work, so you
actually need to do
/usr/bin/gprof kernel gmon.out
Because the profile timing is done internal to System/161, and the
sample rate is high, the times are considerably more accurate than
usual for profilers.
The profiling support in System/161 is completely undocumented, so
save this mail. :-(
--
- David A. Holland / dholland(a)eecs.harvard.edu
Show replies by date