Issue #5291 has been reported by Charlie Savage.

----------------------------------------
Feature #5291: Enabling GC Profiler GC_PROFILE_MORE_DETAIL and CALC_EXACT_MALLOC_SIZE
http://redmine.ruby-lang.org/issues/5291

Author: Charlie Savage
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 1.9.3


I would like to hook ruby-prof into the new GC profiler. However, by default a lot of the profile stats are disabled by these two defines in gcc.c.

#define GC_PROFILE_MORE_DETAIL 0
#define CALC_EXACT_MALLOC_SIZE 0

To turn on these stats, you have to modify the ruby source code!  That is a high barrier for most people.

So would it be possible to:

* Set them to 1 by default.  Or would this be too much of a performance hit?

- or - 

* Remove the lines entirely and then change the logic in the file from this:

#if GC_PROFILE_MORE_DETAIL

To this:

#if defined?(GC_PROFILE_MORE_DETAIL)

Then when buildig Ruby you could tell the compiler to define the symbols  (-DGC_PROFILE_MORE_DETAIL).

- or -

* Add these two defines to the ./configure script so they end up in config.h.  That would make it easy for users to enable them if they wish, and would be also allow ruby-prof to use them too.

Would a patch be accepted to do this?


-- 
http://redmine.ruby-lang.org