Bring limited DTrace support back to OS-X #3617

Closed
EchoAbstract opened this Issue Jul 2, 2012 · 8 comments

Projects

None yet

4 participants

@EchoAbstract

When compiling Node with --with-dtrace configure prints the following message:

Exception: DTrace is currently only supported on SunOS systems.

While I understand that ustack() helpers don't work with DTrace on any platform other than solaris, it would be nice to have the old DTrace probs exposed to other OSes. In particular, it would be awesome to be able to use node-dtrace-provider and the gc-start and gc-stop probes on OS-X with instruments.

Is it not possible to allow limited (just probe) support without giving full ustack() helper support?

(Currently on OS-X running dtrace on node looking for gc-start gives: :::gc-start does not match any probes)

@bnoordhuis
Member

@davepacheco You're probably in the best position to answer this.

@davepacheco

Yeah, it should be possible to have --with-dtrace include the Node USDT probes (e.g., gc-start, gc-done) on OS X. The process is a little different than on SmartOS, but it should be doable.

FYI, --with-dtrace just controls whether we build those probes and the ustack helper. You should be able to use node-dtrace-provider without --with-dtrace, though I haven't tried that.

@EchoAbstract

@davepacheco Thanks, I'll see if node-dtrace-provider works with the default OS-X build. The gc-start and gc-done probes would be awesome as we're tracking down memory issues.

@davepacheco

Update: I looked into adding the probes to OS X. The actual build change was pretty straightforward. However, the provider makes use of USDT with translated arguments, which apparently doesn't work at all on OS X. For the GC probes, that's not a big deal, since the arguments aren't critical for making sense of what's going on. But the HTTP and net probes are much less valuable without additional information. I'm leaning toward an option where we pass raw strings and integers in addition to structured arguments, which will work on both systems without breaking compatibility.

@EchoAbstract

That sounds like a good idea, do any OSes other than SmartOS/Solaris support the USDT feature?

@davepacheco

@EchoAbstract I only really know about OS X and illumos. I'd expect the BSD port to support both USDT and translated arguments, but I've never used it, and I've been surprised before.

@davepacheco davepacheco added a commit to davepacheco/node that referenced this issue Aug 14, 2012
@davepacheco davepacheco DTrace provider support for non-illumos systems
Fixes #3617
644c998
@tjfontaine

I've updated @davepacheco's patch for master, the probes show up on osx, I need to make sure I didn't break anything else

https://github.com/tjfontaine/node/compare/dtraceosx

@tjfontaine

Landed in fe7440c and 7634069.

@tjfontaine tjfontaine closed this Apr 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment