eval.in

Paste #85228

Ruby — MRI 2.1.0, pasted 3 months ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
class Car
  def self.start
    print "Started"
  end
end

TracePoint.trace(:c_call) do |tp|
  puts "'#{tp.event}' event occurred in #{tp.defined_class}##{tp.method_id} on line number #{tp.lineno}"
end

Car.start

Program Output

'c_call' event occurred in Kernel#print on line number 3
'c_call' event occurred in IO#write on line number 3
Started

OK (0.044 sec real, 0.050 sec wall, 9 MB, 18 syscalls)

Fork