bhb / rack-perftools_profiler Goto Github PK
View Code? Open in Web Editor NEWMiddleware for profiling Rack-compatible apps using perftools.rb
License: MIT License
Middleware for profiling Rack-compatible apps using perftools.rb
License: MIT License
The package "ps2pdf" does not exist in my Ubuntu or Linux Mint repositories (11.10 and 13 respectively). I believe the package you need for Ubuntu is the same as the other systems: ghostscript
If this is the case, the command in the README should be: sudo apt-get install ghostscript
Currently this gem depends on Rack ~> 1.0.0.
What I did:
Visit http://localhost:3000/__start__
Do some requests.
Then visit http://localhost:3000/__stop__
The server (started with rails s
) crashes.
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/profiler.rb:89: [BUG] Segmentation fault at 0x00000000000000
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
-- Control frame information -----------------------------------------------
c:0059 p:---- s:0301 e:000300 CFUNC :stop
c:0058 p:0015 s:0298 e:000297 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/prof
c:0057 p:0009 s:0295 e:000294 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/stop
c:0056 p:0035 s:0292 e:000291 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/prof
c:0055 p:0011 s:0286 e:000285 BLOCK /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:35 [FINISH]
c:0054 p:---- s:0284 e:000283 CFUNC :catch
c:0053 p:0066 s:0280 e:000279 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34
c:0052 p:0011 s:0275 e:000274 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23
c:0051 p:0050 s:0267 e:000266 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25
c:0050 p:0011 s:0260 e:000259 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11
c:0049 p:0034 s:0253 e:000252 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/params_parser.
c:0048 p:0011 s:0248 e:000247 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/flash.rb:241
c:0047 p:0023 s:0241 e:000240 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225
c:0046 p:0009 s:0233 e:000232 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220
c:0045 p:0011 s:0229 e:000228 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/cookies.rb:486
c:0044 p:0059 s:0221 e:000220 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activerecord-4.0.5/lib/active_record/query_cache.rb:36
c:0043 p:0021 s:0213 e:000212 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstr
c:0042 p:0013 s:0207 e:000206 BLOCK /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:2
c:0041 p:0036 s:0205 e:000204 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:373
c:0040 p:0023 s:0200 e:000199 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:80
c:0039 p:0014 s:0194 E:0015f0 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:2
c:0038 p:0135 s:0188 e:000187 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rails-dev-tweaks-1.1.0/lib/rails_dev_tweaks/granular_autoload/
c:0037 p:0032 s:0183 e:000182 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/remote_ip.rb:7
c:0036 p:0011 s:0179 e:000178 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/debug_exceptio
c:0035 p:0011 s:0170 e:000169 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/show_exception
c:0034 p:0081 s:0165 e:000164 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:38
c:0033 p:0011 s:0158 e:000157 BLOCK /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20
c:0032 p:0007 s:0156 e:000155 BLOCK /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68
c:0031 p:0016 s:0154 e:000153 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:26
c:0030 p:0011 s:0149 e:000148 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68
c:0029 p:0042 s:0145 e:000144 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20
c:0028 p:0032 s:0140 e:000139 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/request_id.rb:
c:0027 p:0075 s:0136 e:000135 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21
c:0026 p:0024 s:0131 e:000130 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17
c:0025 p:0035 s:0122 e:000121 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/cache/strategy/local_ca
c:0024 p:0056 s:0118 e:000117 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/lock.rb:17
c:0023 p:0094 s:0111 e:000110 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/static.rb:64
c:0022 p:0011 s:0105 e:000104 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112
c:0021 p:0060 s:0095 e:000094 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/engine.rb:511
c:0020 p:0039 s:0091 e:000090 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/application.rb:97
c:0019 p:0011 s:0087 e:000086 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/content_length.rb:14
c:0018 p:0014 s:0078 e:000077 BLOCK /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:86 [FINISH]
c:0017 p:---- s:0076 e:000075 CFUNC :catch
c:0016 p:0091 s:0072 e:000071 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:84
c:0015 p:0060 s:0066 e:000064 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:53
c:0014 p:0033 s:0062 e:000061 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:39 [FINISH]
c:0013 p:---- s:0057 e:000056 CFUNC :run_machine
c:0012 p:0267 s:0054 e:000053 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187
c:0011 p:0059 s:0047 E:000cf0 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/backends/base.rb:73
c:0010 p:0111 s:0043 E:000aa8 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/server.rb:162
c:0009 p:0136 s:0040 e:000039 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16
c:0008 p:0194 s:0031 E:000080 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:264
c:0007 p:0257 s:0025 E:0001f8 METHOD /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands/server.rb:84
c:0006 p:0044 s:0020 e:000019 BLOCK /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:76 [FINISH]
c:0005 p:---- s:0017 e:000016 CFUNC :tap
c:0004 p:0562 s:0014 e:000013 TOP /me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:71 [FINISH]
c:0003 p:---- s:0008 e:000007 CFUNC :require
c:0002 p:0045 s:0004 E:0005d8 EVAL script/rails:6 [FINISH]
c:0001 p:0000 s:0002 E:000068 TOP [FINISH]
script/rails:6:in `<main>'
script/rails:6:in `require'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:71:in `<top (required)>'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:71:in `tap'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:76:in `block in <top (required)>'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands/server.rb:84:in `start'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/application.rb:97:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/engine.rb:511:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/static.rb:64:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `tagged'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:26:in `tagged'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `block in call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/rack/logger.rb:38:in `call_app'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rails-dev-tweaks-1.1.0/lib/rails_dev_tweaks/granular_autoload/middleware.rb:34:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:80:in `run_callbacks'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:373:in `_run__616644286970088589__call__callbacks'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activerecord-4.0.5/lib/active_record/query_cache.rb:36:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/cookies.rb:486:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/flash.rb:241:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/profiler_middleware.rb:28:in `call'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/stop_profiling.rb:6:in `act'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/profiler.rb:89:in `stop'
/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-perftools_profiler-0.6.1/lib/rack/perftools_profiler/profiler.rb:89:in `stop'
-- C level backtrace information -------------------------------------------
0 ruby 0x000000010e41295d rb_vm_bugreport + 141
1 ruby 0x000000010e2dd6fd report_bug + 285
2 ruby 0x000000010e2dd5d3 rb_bug + 179
3 ruby 0x000000010e39be89 sigsegv + 153
4 libsystem_platform.dylib 0x00007fff941e05aa _sigtramp + 26
5 ruby 0x000000010e335bc4 rb_class_real + 52
6 ??? 0x00007fff51952d10 0x0 + 140734562118928
-- Other runtime information -----------------------------------------------
* Loaded script: script/rails
* Loaded features:
0 enumerator.so
1 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin12.0/enc/encdb.bundle
2 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin12.0/enc/trans/transdb.bundle
3 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin12.0/rbconfig.rb
4 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/compatibility.rb
5 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/defaults.rb
6 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/deprecate.rb
7 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/errors.rb
8 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/version.rb
9 /me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/requirement.rb
Adding ?profile=true to my url following the instructions i get this:
PROFILE: interrupts/evictions/bytes = 0/0/64
Running the command 'bundle exec pprof.rb --gif /private/var/folders/7h/y502phtj2b1g8cjs0c173hrw0000gn/T/rack_perftools_profiler.prof' exited with status 1
Using local file /Users/nico/.rvm/rubies/ruby-2.0.0-p247/bin/ruby.
Using local file /private/var/folders/7h/y502phtj2b1g8cjs0c173hrw0000gn/T/rack_perftools_profiler.prof.
No nodes to print
On latest rails, I needed to run this to make everything work:
gem install perftools.rb
Until doing this I received the below stacktrace. I recommend telling people to add this to their Gemfiles in the quickstart instructions, this isn't self-evident to people unfamiliar with this project, nor is the below error very clear
PROFILE: interrupts/evictions/bytes = 85/0/32528
Running the command 'bundle exec pprof.rb --gif /private/var/folders/1n/m5whr5kx649c6r8zs65s92gr0000gn/T/rack_perftools_profiler.prof' exited with status 1
/Users/evan/.rvm/gems/ruby-1.9.3-p194/gems/perftools.rb-2.0.0/bin/pprof.rb:3:in `exec': No such file or directory - /Users/evan/.rvm/gems/ruby-1.9.3-p194/gems/perftools.rb-2.0.0/bin/pprof (Errno::ENOENT)
from /Users/evan/.rvm/gems/ruby-1.9.3-p194/gems/perftools.rb-2.0.0/bin/pprof.rb:3:in `<top (required)>'
from /Users/evan/.rvm/gems/ruby-1.9.3-p194/bin/pprof.rb:19:in `load'
from /Users/evan/.rvm/gems/ruby-1.9.3-p194/bin/pprof.rb:19:in `<main>'
from /Users/evan/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/evan/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
I'm trying to use rack-perftools_profiler on the openstreetmap Rails app but it crashes on every profiling request.
See here for diagnostics: https://gist.github.com/3934003
I'd like the ability to choose profiling mode by providing a parameter to the __start__
URL or to a one-off run using profile=true
. This would override what is set where I add the middleware to my chain. What are your thoughts on this feature?
Hi, when I have a
config.middleware.use ::Rack::PerftoolsProfiler, :default_printer => 'pdf', :bundler => true
and a
devise_for :users
in the routes.rb file, I get a
Could not find devise mapping for path "/users/sign_in"
error (Rails307, ruby192p180, devise134, rack-perftools_profiler 0.4.1)
I tried to change the middleware order with no luck and would be thankful for any hints.
--Frank
It even fails after installing Cygwin which includes tar.
From mkmf.log: "tar zpxvf gperftools-2.0.tar.gz"
From gem_make.out:
C:/.../Ruby192/bin/ruby.exe extconf.rb
(I'm about to compile google-perftools.. this will definitely take a while)
-- tar zpxvf gperftools-2.0.tar.gz
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/.../Ruby192/bin/ruby
extconf.rb:6:in `sys': tar zpxvf gperftools-2.0.tar.gz failed, please report to https://github.com/tmm1/perfools.rb/issues/new with C:/.../Ruby192/lib/ruby/gems/1.9.1/gems/perftools.rb-2.0.0/ext/src/mkmf.log and C:/.../Ruby192/lib/ruby/gems/1.9.1/gems/perftools.rb-2.0.0/ext/src/gperftools-2.0/config.log (RuntimeError)
from extconf.rb:39:in `block in <main>'
from extconf.rb:36:in `chdir'
from extconf.rb:36:in `<main>'
I can start the profiler via the start URL and then run requests fine, then stop it. But when I try to view the data URL, I get Perl errors:
Running the command 'bundle exec pprof.rb --gif /private/var/folders/xd/k4cggzwd3gg9by03qt2mcl5jnp8jjx/T/rack_perftools_profiler.prof' exited with status 1
Using local file /Users/noah.gibbs/.rvm/rubies/ruby-2.0.0-p247/bin/ruby.
Using local file /private/var/folders/xd/k4cggzwd3gg9by03qt2mcl5jnp8jjx/T/rack_perftools_profiler.prof.
substr outside of string at /Users/noah.gibbs/.rvm/gems/ruby-2.0.0-p247/gems/perftools.rb-2.0.1/bin/pprof line 3543.
Use of uninitialized value in string eq at /Users/noah.gibbs/.rvm/gems/ruby-2.0.0-p247/gems/perftools.rb-2.0.1/bin/pprof line 3543.
substr outside of string at /Users/noah.gibbs/.rvm/gems/ruby-2.0.0-p247/gems/perftools.rb-2.0.1/bin/pprof line 3545.
Use of uninitialized value in string eq at /Users/noah.gibbs/.rvm/gems/ruby-2.0.0-p247/gems/perftools.rb-2.0.1/bin/pprof line 3545.
/private/var/folders/xd/k4cggzwd3gg9by03qt2mcl5jnp8jjx/T/rack_perftools_profiler.prof: header size >= 2**16
As a perftools newbie I'm running into problems trying to get it running with my Sinatra application. I've created a minimal 'hello world' app that illustrates my problem:
https://github.com/petewarden/sinatraperftoolsexample
I did my best to follow the directions in the documentation, but I'm betting there's just a step that I'm missing. In more detail, here's what I'm doing:
Installing the perftools gem using this in my Gemfile and running bundle install:
gem "rack-perftools_profiler"
Including the file in my application:
require 'rack/perftools_profiler'
Also including a configuration block:
configure :profiling do
use ::Rack::PerftoolsProfiler, :default_printer => 'gif'
end
Launch the application using rackup and visit http://localhost:9292/?profile=true
From my reading of the documentation, I would expect to see a gif displayed in the result showing profile information, but instead I see exactly the same page that appears without the profile argument.
What am I doing wrong? Any help much appreciated, I'm itching to use the framework.
ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
uname -v
Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
open4 (1.1.0)
perftools.rb (0.5.6)
rack (1.3.2)
rack-perftools_profiler (0.5.0)
open4 (> 1.0)> 0.5.6)
perftools.rb (
rack (> 1.0)> 1.1)
sinatra (1.2.6)
rack (
tilt (< 2.0, >= 1.2.2)
tilt (1.3.2)
Howdy, I get a beautiful graph when in cputime mode, but the following error in objects mode:
Running the command 'bundle exec pprof.rb --gif /tmp/rack_perftools_profiler.prof' exited with status 1
Standard error:
Using local file /home/micah/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby.
Using local file /tmp/rack_perftools_profiler.prof.
No nodes to print
Looking at /tmp/rack_perftools_profiler.prof, it does seem light: https://gist.github.com/2374901
For context, I'm running this in a Rails 3.1 app on REE-1.8.7-2011.03, on an action that takes over 15 seconds to complete, where the cputime graph shows ~80% time being spent in GC.
Any ideas?
You get the "password not correct" response even with you don't supply a profile parameter in the URL.
Currently, rack-perftools_profiler.gemspec
has a dependency of ~> 0.5.6
for perftools.rb. But that version doesn’t work with Ruby 1.9.3. perftools version 2.0.0 does work with 1.9.3 and also seems to work fine with rack-perftools_profiler.
Would you mind updating the dependency to allow using perftools.rb 2.0.0?
Thanks,
Chris
Installation for ruby 2.1.0-preview1 fails. This is the error message:
killa@ubuntu:~/workspace/one_flexo$ gem install rack-perftools_profiler
Building native extensions. This could take a while...
ERROR: Error installing rack-perftools_profiler:
ERROR: Failed to build gem native extension.
/home/killa/.rvm/rubies/ruby-2.1.0-preview1/bin/ruby extconf.rb
(I'm about to compile google-perftools.. this will definitely take a while)
-- tar zpxvf gperftools-2.0.tar.gz
-- patch -p1 < ../../../patches/perftools.patch
-- patch -p1 < ../../../patches/perftools-notests.patch
-- patch -p1 < ../../../patches/perftools-pprof.patch
-- patch -p1 < ../../../patches/perftools-gc.patch
-- patch -p1 < ../../../patches/perftools-debug.patch
-- patch -p1 < ../../../patches/perftools-objects.patch
-- patch -p1 < ../../../patches/perftools-frames.patch
-- patch -p1 < ../../../patches/perftools-realtime.patch
-- patch -p1 < ../../../patches/perftools-pause.patch
-- sed -i -e 's,SpinLock,ISpinLock,g' src/.cc src/.h src/base/.cc src/base/.h
-- ./configure --disable-heap-profiler --disable-heap-checker --disable-debugalloc --disable-shared
-- make
checking for method.h... no
checking for vm_core.h... no
Makefile creation failed
No source for ruby-2.1.0 (revision 43011) provided with debugger-ruby_core_source gem.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/killa/.rvm/rubies/ruby-2.1.0-preview1/bin/ruby
Gem files will remain installed in /home/killa/.rvm/gems/ruby-2.1.0-preview1/gems/perftools.rb-2.0.1 for inspection.
Results logged to /home/killa/.rvm/gems/ruby-2.1.0-preview1/gems/perftools.rb-2.0.1/ext/gem_make.out
I'll be happy to provide any other informations if needed.
Hi,
Apologies for opening an issue on what may be an implementation question, but I'm unable to get useful profiling data, and the Googling doesn't turn up any useful information. Regardless of how high I set the sampling rate (currently 300) or how many times I rerun the operation using the times parameter (10, 20, higher tends to not send back a response to the browser) the generated PDF always says there's just one sample, and unsurprisingly (given only one sample) usually doesn't have any useful information on what calls were made. It's mostly just the chain of Rack middleware, ending in something like IO#read or Time#new, which takes up 100% of the one sample. Even when it shows a number of code paths being executed, the sample size never increases, which makes it hard to figure out where to optimize.
Have seen anything like this had any experience with this? Is it just that the method is too fast (though in that case, should times=20 still produce data)? Unfortunately the project isn't public so I can't link to the code, but I'd be happy to provide whatever other information I can. The app is running locally in production mode, and the middleware is set up simply as config.middleware.use ::Rack::PerftoolsProfiler, { :default_printer => 'pdf', :bundler => true}, my call parameters are ?profile=true×=20.
Any help would be most appreciated.
Thanks!
Alex
So I'm profiling a Rails 3.2 app on Ruby 1.9.3 which has the following filter in ApplicationController to reduce the frequency of GC runs:
@@last_gc_run = Time.now
around_filter do |c, &action|
GC.disable
rv = action.call()
if Time.now - @@last_gc_run > 1.0
GC.enable
GC.start
@@last_gc_run = Time.now
end
rv
end
Ordinarily, this makes things about 30% faster. If I hit http://mysite/controller/action
, it runs as expected, only taking a few seconds... but if I hit http://mysite/controller/action?profile=1
, it causes the Ruby process to spin up to 100% CPU usage and run forever. Doesn't respond to signals, needs to be SIGKILLed. Removing this around_filter makes ?profile=1
requests work normally again.
My configuration is { :default_printer => :text, :mode => :walltime }
, although the bug seems to occur no matter which printer I use.
This gem does not work with Ruby 2.0 unless the gem's dependency on perftools.rb
is bumped to 2.0.1
(which fixes issues with Ruby 2 compatibility). An alternative, which I am currently doing, is to make an explicit dependency on perftools.rb (2.0.1)
in my Gemfile
, but that is more of a workaround than anything.
^
Example showcase at
https://github.com/Fonsan/rack-perftools_profiler-params-bug
Workaround one could circumvent this by using the start stop api
Running into an error on running the server.
bundle install
seemed to work fine with Rails 3.1.x and Ruby 1.9.3-p0 with rvm 1.9.2. I did run the gem install perftools.rb -v '0.5.6'
prior to bundling.
The error is as follows:
dlopen(/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/perftools.rb-0.5.6/lib/perftools.bundle, 9): Symbol not found: _ruby_current_thread
Referenced from: /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/perftools.rb-0.5.6/lib/perftools.bundle
Expected in: flat namespace
in /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/perftools.rb-0.5.6/lib/perftools.bundle - /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/perftools.rb-0.5.6/lib/perftools.bundle
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in require' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
block in require'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in block in load_dependency' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in
new_constants_in'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in load_dependency' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
require'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rack-perftools_profiler-0.5.1/lib/rack/perftools_profiler/profiler.rb:43:in initialize' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rack-perftools_profiler-0.5.1/lib/rack/perftools_profiler/profiler_middleware.rb:20:in
new'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rack-perftools_profiler-0.5.1/lib/rack/perftools_profiler/profiler_middleware.rb:20:in initialize' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rack-perftools_profiler-0.5.1/lib/rack/perftools_profiler.rb:20:in
new'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rack-perftools_profiler-0.5.1/lib/rack/perftools_profiler.rb:20:in new' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:43:in
build'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:in block in build' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:in
each'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:in inject' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:in
build'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/engine.rb:447:in app' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/application/finisher.rb:37:in
block in module:Finisher'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/initializable.rb:30:in instance_exec' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/initializable.rb:30:in
run'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/initializable.rb:55:in block in run_initializers' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/initializable.rb:54:in
each'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/initializable.rb:54:in run_initializers' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/application.rb:96:in
initialize!'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in method_missing' /Volumes/Users/username/Documents/Development/ruby/rails/AppName/config/environment.rb:5:in
<top (required)>'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in require' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
block in require'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in block in load_dependency' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in
new_constants_in'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in load_dependency' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
require'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/application.rb:83:in require_environment!' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/railties-3.1.3/lib/rails/application.rb:193:in
block (2 levels) in initialize_tasks'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
block in execute'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
execute'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:176:in
block in invoke_prerequisites'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:174:in each' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
invoke_prerequisites'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:157:in block in invoke_with_call_chain' /Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
invoke'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block (2 levels) in top_level'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block in top_level'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:88:in
top_level'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/gems/rake-0.9.2.2/bin/rake:33:in
<top (required)>'
/Users/username/.rvm/gems/ruby-1.9.3-p0@default/bin/rake:19:in load' /Users/username/.rvm/gems/ruby-1.9.3-p0@default/bin/rake:19:in
I use Rails 3.1.0 on ruby version:
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2011.03
in application.rb:
config.middleware.use ::Rack::PerftoolsProfiler, :default_printer => 'gif', :bundler => true, :mode => :objects
Traceback:
$ script/rails server -p8888
=> Booting Mongrel
=> Rails 3.1.0 application starting in development on http://0.0.0.0:8888
=> Call with -d to detach
=> Ctrl-C to shutdown server
Then I make request http://localhost:8888/?profile=true×=3
and console show:
Segmentation fault
This could work like Rack::Bug and would display:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.