From: "sax (Eric Saxby)" Date: 2013-08-21T16:34:17+09:00 Subject: [ruby-core:56766] [ruby-trunk - Bug #8805] Ruby GC::Profiler returns incorrect info on Solaris (and relatives) Issue #8805 has been updated by sax (Eric Saxby). After more investigation, the clock_gettime calls for CLOCK_PROCESS_CPUTIME_ID return -1, with an errno of 22. I *think* this maps to: EINVAL The clock_id argument does not specify a known clock. Sooo I think for SmartOS, and probably for Solaris in general, GC::Profiler should use getrusage() instead of clock_gettime(). I'm a little unclear on the best way to approach this, however. Maybe configure should test for a 0 response to clock_gettime, and set a flag specific to CLOCK_PROCESS_CPUTIME_ID that gc.c can pick up? ---------------------------------------- Bug #8805: Ruby GC::Profiler returns incorrect info on Solaris (and relatives) https://bugs.ruby-lang.org/issues/8805#change-41308 Author: sax (Eric Saxby) Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-solaris2.11] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN We use SmartOS as our deployment platform, and noticed when attempting to roll out Ruby 2.0.0-p247 to some SmartOS hosts that garbage collection info is broken with integrations such as New Relic. Investigating further, we found that GC::Profiler.total_time always returns 0.0. >> GC::Profiler.enable => nil >> GC.start => nil >> GC::Profiler.total_time => 0.0 It may be related to this issue: https://bugs.ruby-lang.org/issues/7500 where the mechanism by which the profiler gets timestamps from the OS. -- http://bugs.ruby-lang.org/