For Satellite performance debugging, we would like to have the possibility to hook on ruby markers, but it's not possible: [root@fseven ~]# cat rubystack.stp #!/usr/bin/stap· global fn_calls; probe ruby.cmethod.entry { fn_calls[classname, methodname] <<< 1; } probe end { foreach ([classname, methodname] in fn_calls- limit 30) { printf("%dx %s.%s\n", @count(fn_calls[classname, methodname]), classname, methodname); } delete fn_calls; } # SCL RUBY [root@fseven ~]# stap rubystack.stp -c "scl enable rh-ruby22 \"ruby factorial.rb 5\"" 120 # SYSTEM RUBY (working ok) [root@fseven ~]# stap rubystack.stp -c "ruby factorial.rb 5" 120 2823x Module.=== 1728x BasicObject.== 1728x Kernel.=== 997x Symbol.to_s 980x Kernel.initialize_dup 979x Kernel.dup 960x Kernel.instance_variable_set 683x Hash.[]= 676x String.to_s 499x String.initialize_copy 445x Class.new 386x String.gsub 384x Array.initialize_copy 327x Kernel.class 320x Module.method_added 315x Array.each 286x Array.flatten 260x File.file? 242x #<Class:0x0000000213ad88>.core#define_method 236x String.<=> 220x String.to_i 204x Enumerable.any? 179x String.strip 179x File.join 177x Regexp.=~ 164x Kernel.respond_to? 164x Kernel.untaint 156x String.=~ 149x Array.last 146x Array.map! Thanks!
I will look into it.
Hi, I took your exact .stp file and I got correct SystemTap output without any issue. In your case it is caused by invalid commands order. Running `scl enable ...` command, shell environment and paths are changed, which interferes with SystemTap. # rpm -q rh-ruby22-ruby rh-ruby22-ruby-2.2.2-15.el7.x86_64 # scl enable rh-ruby22 -- stap rubystack.stp -c "ruby factorial.rb 5" 5 => 120 377x Module.method_added 317x String.gsub 269x #<Class:0x00000001df3170>.core#define_method 228x Kernel.initialize_dup 228x String.initialize_copy 228x Kernel.dup 164x BasicObject.singleton_method_added 139x #<Class:0x00000001df3170>.core#define_singleton_method 93x String.[] 92x Module.=== 84x Kernel.=== 74x BasicObject.== 71x String.<=> 69x String.replace 61x Class.inherited 41x IO.set_encoding 33x Module.attr_reader 30x Symbol.to_s 26x Kernel.require 23x Module.attr_accessor 20x Kernel.nil? 20x BasicObject.!= 18x String.=~ 17x Module.private 17x Kernel.!~ 16x Module.autoload 16x #<Class:0x00000001df3170>.core#set_method_alias 14x Class.new 13x Array.== 10x File.join [rh-ruby22 ~]# ruby --version ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] Please confirm that it works with commands in correct order.
I agree with Pavel's assessment => Closing this as a NOTABUG. Feel free to reopen in case we are wrong.
Thanks Pavel, I haven't noticed this.