Project

stackprofx

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
stackprofx is a hacky derivative of stackprof, the sampling profiler for Ruby 2.1+.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.0
~> 0.14
 Project Readme

stackprofx

Stackprofx is a fork of the sampling call-stack profiler for Ruby 2.1+, stackprof. It exists only because the fork's author wanted to make some terrible changes to the upstream project that no maintainer should accept.

Why "x"?

I was considering calling it stackprof2, but 2 implies a successor to 1 and this is in no way "better" than the original project.

What changes?

StackProf::run accepts an options hash to specify profiling parameters. Stackprofx adds one more (optional) key: :threads. The value for :threads should be an array of Thread objects to be profiled. All other threads will be ignored.

Even if the :threads key is not specified, the behaviour of Stackprofx is slightly different. stackprof makes use of the rb_profile_frames() function added to MRI 2.1, but this thread is limited to only profiling whatever happens to be the "current thread" when the profiling signal is received by the Ruby process. Stackprofx will profile every running thread.

To do this, Stackprofx pulls in a bunch of private Ruby headers and reimplements (copypasta) this function with one additional parameter: thread. This might (probably will) break in the future, but it's for development, not production, right?

TODO

  • Investigate terrible hacks required to link against Ruby
  • Make stack deduplication (weights) useful again
  • Less mess
  • Ask someone who knows something about the Ruby GC to review