admin管理员组

文章数量:1287556

I am currently profiling my node.js application.I found this blog: / that suggests I should use Dtrace. I installed dtrace on ubuntu 12.04 using steps given here:

However when I run this mand in my terminal while my node application is running:

dtrace -o stacks.out -n 'profile-97/execname == "node" && arg1/{
@[jstack(100, 8000)] = count(); } tick-60s { exit(0); }'

stacks.out remains blank except this: CPU ID FUNCTION:NAME 1 387695 :tick-60s

Any suggestions what might be wrong?

I am currently profiling my node.js application.I found this blog: http://blog.nodejs/2012/04/25/profiling-node-js/ that suggests I should use Dtrace. I installed dtrace on ubuntu 12.04 using steps given here: https://askubuntu./questions/60940/how-do-i-install-dtrace

However when I run this mand in my terminal while my node application is running:

dtrace -o stacks.out -n 'profile-97/execname == "node" && arg1/{
@[jstack(100, 8000)] = count(); } tick-60s { exit(0); }'

stacks.out remains blank except this: CPU ID FUNCTION:NAME 1 387695 :tick-60s

Any suggestions what might be wrong?

Share Improve this question edited Apr 13, 2017 at 12:22 CommunityBot 11 silver badge asked Jun 26, 2012 at 10:29 nerandellnerandell 4011 gold badge6 silver badges16 bronze badges 1
  • With latest node.js in Linux you could have a look at Systemtap. I do not know how much is supported. Measure GC => gist.github./bnoordhuis/4078925. I have not played with this yet but looks promising/interesting. – Alfred Commented Mar 23, 2013 at 11:10
Add a ment  | 

3 Answers 3

Reset to default 6

The Linux DTrace implementations are currently very young and missing a number of important features (and are not in any way ready for production use). Specifically the DTrace implementation you are using (Paul Fox's) has not done much if any work to support userspace tracing. So you will not be able to do this under Linux (right now).

If you want to get this to work you will need to use an operating system with a more plete implementation of DTrace. You're best bet is to use one of the Illumos derivatives (such as OmniOS, SmartOS or OpenIndiana).

You should re-read the 'prerequisites' section of the the article you linked to. It states that you also need to make sure you use 32bit NodeJS with DTrace support turned on at pile time.

(Mac OS X does have a good DTrace implementation, but according to the article it does not support ustack helpers which are needed for this example.)

@psanford has a good answer specifically involving your issues with DTrace, but from your opening sentence, it looks like what you want is to be able to trace your Node.js app, and DTrace was just one example on how to do so.

In that case, a bination of node-inspector and v8-profiler would provide you with the desired introspection into your application. I'm not sure if it works with Node 0.6.x, however, since the last time I used it was with 0.4.10.

Oracle announced DTrace availability on Oracle Linux. You can download this distro here.

本文标签: javascriptProfiling Nodejs using DTraceStack Overflow