VM Profiling in Linux
Scott A Crosby
crosby at qwes.math.cmu.edu
Mon Mar 11 22:41:15 UTC 2002
On Mon, 11 Mar 2002, Anthony Hannan wrote:
> Scott A Crosby <crosby at qwes.math.cmu.edu> wrote:
> > Whoops. This got lost in the mail. :) You get profiling to work?
> I would work but all result would be zero. Do I have to run it for a
> very long time. I just ran it for about 4 minutes.
You will get profiling results just starting up. (less than a second of
runtime) The only way to not get profiling results is if the program
actually crashes. (In that case, the file is not written)
Ok.. Edit squeak/src/Squeak-3.1a-4164/build/Makefile
CFLAGS= -I/usr/X11R6/include -g -O2 -pg -DLSB_FIRST=1 -funroll-loops
#CFLAGS= -I/usr/X11R6/include -g -O2 -pg -a -DLSB_FIRST=1 -funroll-loops
I uncomment one of these two lines to enable either normal profiling
(first line), or basic-block level profiling (second line)
Then to view, 'gprof ../squeak.2.pg' (where that is the path to the
aforementioned executable.)
Or, 'gprof -l ../squeak.2.pg' to get line-level profiling.
Note that you must have all components compiled with the '-pg' flag for
profiling. If a component isn't so marked, the times may be non-existant
or misattributed.
There's also basic-block level profiling, which for each branch or other
control-flow change, it tells you how many times it was taken and how many
times it wasn't taken. (Useful for getting cache hit/miss rates. finding
hotspots, etc.)
>
> > BTW, have you gotten the new method cache integrated in? I'm back from
> > visiting grad schools, so I have a little more time to help out. For
> > profiling under linux, the method cache, fulltext, or anything else.
>
> Thanks Scott, maybe I'll need your help later, but for now I'm putting
> off these enhancements until I'm ready to release BC version 3, which I
> haven't started yet but will contain some compiler improvements so it
> generates better bytecodes. In particular, I want to avoid initializing all
Excellent
Scott
More information about the Squeak-dev
mailing list
|