Compile ruby 2.0 for profiling (gperf)

Hello!
I would like to profile ruby 2.0. I compiled it with CFLAGS=’-O0 -pg’,
which made ruby executable to produce gmon.out file. It is about 900k
big. The problem is, when I open it with gperf ruby gmon.out -p, I
receive blank output (without any information about function call). I
know that granularity of gperf is 0.01s, which is quite big, but
still…

Guys, has anyone tried profiling ruby interpreter?

The output of gperf:

Flat profile:

Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name

% the percentage of the total running time of the
time program used by this function.

cumulative a running sum of the number of seconds accounted
seconds for by this function and those listed above it.

self the number of seconds accounted for by this
seconds function alone. This is the major sort for this
listing.

calls the number of times this function was invoked, if
this function is profiled, else blank.

self the average number of milliseconds spent in this
ms/call function per call, if this function is profiled,
else blank.

total the average number of milliseconds spent in this
ms/call function and its descendents per call, if this
function is profiled, else blank.

name the name of the function. This is the minor sort
for this listing. The index shows the location of
the function in the gprof listing. If the index is
in parenthesis it shows where it would appear in
the gprof listing if it were to be printed.

On Aug 24, 2012, at 09:51 , Łukasz Pełszyński [email protected]
wrote:

I would like to profile ruby 2.0. I compiled it with CFLAGS=‘-O0 -pg’,
which made ruby executable to produce gmon.out file. It is about 900k
big. The problem is, when I open it with gperf ruby gmon.out -p, I
receive blank output (without any information about function call). I
know that granularity of gperf is 0.01s, which is quite big, but
still…

Guys, has anyone tried profiling ruby interpreter?

You’d do a lot better sending this to ruby-core@