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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top