Migrate to perftools 1.8.3 #33

Closed
wants to merge 1 commit into
from

Projects

None yet

10 participants

@bearded

Hello guys,

What do you think about migration at perftools 1.8.3 ?

Hope this pull request will help

@tmm1 tmm1 commented on the diff Oct 6, 2011
README.md
@@ -123,7 +123,7 @@ The sampling interval of the profiler can be adjusted to collect more
You'll also need graphviz to generate call graphs using dot:
sudo brew install graphviz ghostscript # osx
- sudo apt-get install graphviz ps2pdf # debian/ubuntu
+ sudo apt-get install graphviz ghostscript # debian/ubuntu
@tmm1
tmm1 Oct 6, 2011

Are you sure this is correct? Which ubuntu/debian version were you on?

@bearded
bearded Oct 7, 2011

Yes, I'm sure, I have checked it at 10.04.3 LTS, but you can see that ps2pdf is provided by ghostscript in every version here: http://manpages.ubuntu.com/manpages/oneiric/man1/ps2pdf.1.html

@tmm1
Owner

Looks good, but how did you update the patch files? Were there any conflicts in the rebase?

@bearded

I have checked every patch by hands and did update in the files. Do not know how to do this via rebase :(

@bearded

@tmm1, I have added few more commits but I'm not sure that all of them is needed.

perftools.rb now works with ruby 1.9.3-preview1. Please have a look

update:
perftools.rb also works with 1.9.3-rc1 (see preview_revision.yml)

@bearded

@tmm1, now it is ok?

@bearded

@tmm1, shall I remove examples?

bearded Migrate to perftools 1.8.3
* use RbConfig::CONFIG instead of Config::CONFIG
* Fixed error 'Symbol not found: _ruby_current_thread (LoadError)' for ruby-1.9.3
* Added examples of reporting add_numbers_profile in ruby '1.8.6', '1.8.7', '1.9.1', '1.9.2', '1.9.3'
df73f93
@bearded

Hey Aman,

I've rebased this request, could you please have a look and leave a comment?

@greggroth

I believe this pull request is supposed to address this error when using Ruby 1.9.3, but I'm still getting this error. I've tried both the gem on RubyGems and building the gem from the latest source. Any advice? Should I just go down to 1.9.2-head?

/Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': dlopen(/Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/perftools.rb-0.5.6/lib/perftools.bundle, 9): Symbol not found: _ruby_current_thread (LoadError)
  Referenced from: /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/perftools.rb-0.5.6/lib/perftools.bundle
  Expected in: flat namespace
 in /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/perftools.rb-0.5.6/lib/perftools.bundle - /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/perftools.rb-0.5.6/lib/perftools.bundle
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-perftools_profiler-0.5.0/lib/rack/perftools_profiler/profiler.rb:43:in `initialize'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-perftools_profiler-0.5.0/lib/rack/perftools_profiler/profiler_middleware.rb:20:in `new'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-perftools_profiler-0.5.0/lib/rack/perftools_profiler/profiler_middleware.rb:20:in `initialize'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-perftools_profiler-0.5.0/lib/rack/perftools_profiler.rb:20:in `new'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-perftools_profiler-0.5.0/lib/rack/perftools_profiler.rb:20:in `new'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:43:in `build'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:112:in `block in build'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:112:in `each'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:112:in `inject'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:112:in `build'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/engine.rb:446:in `app'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/Greggory/Programing/beerlist/config/environment.rb:5:in `<top (required)>'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
    from /Users/Greggory/Programing/beerlist/config.ru:4:in `block in <main>'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/builder.rb:51:in `instance_eval'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/builder.rb:51:in `initialize'
    from /Users/Greggory/Programing/beerlist/config.ru:1:in `new'
    from /Users/Greggory/Programing/beerlist/config.ru:1:in `<main>'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/builder.rb:40:in `eval'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/builder.rb:40:in `parse_file'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/server.rb:200:in `app'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/commands/server.rb:46:in `app'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/server.rb:301:in `wrapped_app'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.2/lib/rack/server.rb:252:in `start'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/commands/server.rb:70:in `start'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/commands.rb:54:in `block in <top (required)>'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
    from /Users/Greggory/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@bearded

@greggroth, could you please show Gemfile?

@greggroth

Right now I'm loading them only for the development environment, but I've also tried loading them for all environments.

group :development do
  gem 'perftools.rb'
  gem 'rack-perftools_profiler'
end

and in config/application.rb I've added

require 'rack/perftools_profiler'

module BlogApp
   config.middleware.use ::Rack::PerftoolsProfiler , :default_printer => 'gif', :bundler => true
end

This is in a rails 3.1 app (I've obviously removed code unrelated to this gem). I've tried with 1.9.2-head, 1.9.3-rc1, and 1.9.3-head and I get the same error every time.

@bearded

@greggroth, please try to use

group :development do
  gem 'perftools.rb', :git => 'git://github.com/bearded/perftools.rb.git', :branch => 'perftools-1.8'
  gem 'rack-perftools_profiler'
end
@greggroth

That did the trick. Thanks!

@tmm1
Owner

Sorry for the delay. I'll try to merge this this weekend.

@grzuy

I suppose this patch will fix the gcc4.6 compile issue, is that correct?

@bearded

@grzuy, I can't check it because of problems with compiling gcc46 on Mac OS X :(

@grzuy

I tried it on my Linux with gcc4.6 and it seems to fix #35 :)

@betelgeuse

@tmm1 Any problems with the merge as this is still open?

@Maher4Ever

This pull request worked for me and I was able to install perftools on Ubuntu 11.10.
All the other options didn't (master branch or installing from RubyGems).
So I say :shipit: :)

@bearded

@tmm1, maybe better will be migrate at perftools 1.9.1 ?

@brainopia

👍 awesome, this pull-request fixed undefined symbol `ruby_current_thread' when compiling against Ruby 1.9.3-p0.

@tzeskimo

Thanks bearded. This did the trick on ubuntu 11.10.

@bearded

@tzeskimo, I'm glad that this helps to people :)

@raykin

Not pulled yet?
@bearded How to use your patch? I still can't install it on GCC 4.6.1 on ubuntu 11.10

@nicoolas25

Thanks @bearded, I'm using it with ruby 1.9.3p125 (Debian Sqeeze 64 bits) and it seems working.

@tmm1 tmm1 added a commit that referenced this pull request Mar 8, 2012
@tmm1 @bearded's ruby 1.9.3 patch from #33 /cc #39 1742f97
@tmm1
Owner

Sorry for losing track of this for so long. Thanks for keeping up with the issues @bearded!

I've just pulled the new upstream gperftools 2.0 into master, and applied the ruby 1.9 fix from this branch.

Please test against master and report any bugs. If everything looks good, I'll release a new gem.

@betelgeuse

@tmm1 it worked for me with default settings. With CPUPROFILE_REALTIME=1 I get "Disabling profiler because SIGALRM handler is already in use". I am not sure if this is a regression as I haven't been able to run perftools.rb for a while before these updates.

@bearded

@tmm1, add_numbers_profile example works on rubies 1.9.3-p125, 1.9.2-p318, 1.9.1-p431, 1.8.7-p358, 1.8.6-p420 and ree-1.8.7-2012.02.

Thank you 👍

@betelgeuse, could you please create issue about CPUPROFILE_REALTIME to close this PR ?

@grzuy

@tmm1 fixed my gcc4.6 compilation issue 👍

@bearded bearded closed this Mar 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment