I’m trying to use ruby-prof with Ruby 1.9.1p243 on 64-bit Ubuntu.
The current released version doesn’t work, but a gem built from the
ruby-prof’s svn repo’s trunk at least installs properly. Unfortunately,
when trying to profile a Ruby 1.9 it breaks as described at
http://redmine.ruby-lang.org/issues/show/1227
I tried to clone http://github.com/trafficbroker/ruby-prof and
‘rake gem’, but a subsequent ‘gem install’ attempt results in
Building native extensions. This could take a while…
ERROR: Error installing ruby-prof-0.7.3.2.gem:
ERROR: Failed to build gem native extension.
/home/shot/opt/ruby-1.9.1-p243/bin/ruby extconf.rb install
ruby-prof-0.7.3.2.gem
checking for sys/times.h… yes
checking for rb_os_allocated_objects()… no
checking for rb_gc_allocated_size()… no
checking for rb_gc_collections()… no
checking for rb_gc_time()… no
checking for rb_heap_total_mem()… no
checking for rb_gc_heap_info()… no
checking for rb_gc_malloc_allocations()… no
checking for rb_gc_malloc_allocated_size()… no
creating Makefile
make
gcc -I. -I/home/shot/opt/ruby-1.9.1-p243/include/ruby-1.9.1/x86_64-linux
-I/home/shot/opt/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/backward
-I/home/shot/opt/ruby-1.9.1-p243/include/ruby-1.9.1 -I.
-DHAVE_SYS_TIMES_H -fPIC -O2 -g -Wall -Wno-parentheses -o
ruby_prof.o -c ruby_prof.c
ruby_prof.c:890: error: expected declaration specifiers or ‘…’ before
‘NODE’
ruby_prof.c: In function ‘prof_event_hook’:
ruby_prof.c:1137: error: ‘node’ undeclared (first use in this function)
ruby_prof.c:1137: error: (Each undeclared identifier is reported only
once
ruby_prof.c:1137: error: for each function it appears in.)
ruby_prof.c:1137: error: too many arguments to function ‘get_method’
ruby_prof.c:1143: warning: passing argument 5 of ‘get_method’ makes
pointer from integer without a cast
ruby_prof.c:1143: error: too many arguments to function ‘get_method’
make: *** [ruby_prof.o] Error 1
I finally tried to use upstream ruby-prof 0.7.3 patched just with the
patch from http://redmine.ruby-lang.org/issues/show/1227#note-6 but this
makes the profiling run for ages in most of my cases. I even tested this
in a freshly-setup 32-bit Ubuntu, but with the same results.
Does anyone know of a way to make ruby-prof
work in sensible time in my case?
Steps to reproduce:
- Install any ruby-prof version that’s supposed to work with Ruby 1.9
- git clone git://github.com/Chastell/art-decomp.git
- cd art-decomp
- export RUBYOPT="$RUBYOPT -Ku’ # -Ku doesn’t work in shebang on Linux
$ time bin/inputs kiss/s510
…
real 0m0.571s
user 0m0.468s
sys 0m0.008s
$ time bin/inputs kiss/s420
…
real 0m1.183s
user 0m1.040s
sys 0m0.012s
$ time ruby-prof bin/inputs kiss/s510
…
real 0m2.862s
user 0m2.100s
sys 0m0.556s
$ time ruby-prof bin/inputs kiss/s420
…
[take ages, but does finish eventually]
— Shot