Skip to content

Instantly share code, notes, and snippets.

@jroesch
Created August 22, 2014 21:24
Show Gist options
  • Save jroesch/7cf3c1b045fe424655c4 to your computer and use it in GitHub Desktop.
Save jroesch/7cf3c1b045fe424655c4 to your computer and use it in GitHub Desktop.
trace = TracePoint.new(:call, :b_call, :c_call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
end
trace.enable
puts "Hello, TracePoint!"
puts [1,2,3].length
[7, Kernel, :puts, :c_call]
[7, IO, :puts, :c_call]
[7, IO, :write, :c_call]
Hello, TracePoint![7, IO, :write, :c_call]
[9, Kernel, :puts, :c_call]
[9, IO, :puts, :c_call]
[9, Fixnum, :to_s, :c_call]
[9, IO, :write, :c_call]
3[9, IO, :write, :c_call]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment