How to generate a Node.js flame graph on CentOS?

How to generate a Node.js flame graph on CentOS?

I’d like to generate a flame graph for my node.js app. Unfortunately, my dev box is OSX (doesn’t support utrace helpers, per the linked article) and my production box is CentOS (doesn’t even have dtrace).
I’ve found some indication that something like SystemTap might be a dtrace alternative, but I’ve been unable to cobble together an effective working way to generate the appropriate stacks.out file to feed into stackvis.
Does anybody know of a decent tutorial on how to get this up and running? I’d prefer it on CentOS (so I can examine my production app) but OSX would also be sufficient.


Solution 1:

From the latest google searches, people are unhappy with SystemTap on Centos, but here is an article that was referenced by someone’s FlameGraph github project

I would say move towards the real solution, of getting dtrace installed rather than relying on the work around.

Solution 2:

On Linux, the perf_events profiler can be used to sample stack traces, and has JIT symbol support. For node.js, you need to be running version 0.11.13 or higher, with the v8 option –perf-basic-prof. That option creates a /tmp/ file for symbol translation, which perf uses. Once you have perf profiling stack traces with JavaScript symbols, you can then create flame graphs using (from the FlameGraph repo) on the output of “perf script”.

I wrote up the full instructions here:

Related:  Can't find Python.h file on CentOS