Nodejs cpu 分析

Nodejs cpu profiling

我需要调试 100% cpu 使用我的 nodejs 进程。我发现 node --prof myapp.js 非常有帮助。现在我有另一个将分叉子进程的应用程序,我需要调试该子进程。这是我分叉过程的方式。

require('child_process').fork("childfile.js", ["arg1","arg2], {silent: true});

现在我的问题是,是否可以分析子进程,然后如何传递“--prof”选项。

require('child_process').fork("childfile.js", ["arg1","arg2], {silent: true,execArgv:["--prof"]});