Question

I spent some time learning about using Dtrace and Ruby.. then found the new TracePoint class in Ruby core for 2.0. Does TracePoint use the same probes under the covers that dtrace uses to monitor ruby execution?

Was it helpful?

Solution

No, they are implemented using a separate set of C macros in the ruby source. However most places where there is a DTrace probe there is also a call to EXEC_EVENT_HOOK (which is what TracePoint uses). There are DTrace probes in low level string and array allocation that do not have corresponding TracePoint hooks. There are also one place that has calls to EXEC_EVENT_HOOK with no DTrace probes (thread switching).

Remember that TracePoint allow you to execute arbitrary ruby. This gives you more flexibility using TracePoint but at the cost of having a much greater probe effect than when using DTrace.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top