2

I'm trying to generate a flame graph on ubuntu 14.04 for a node.js app. I used this guide (Brendan Gregg) : http://www.brendangregg.com/blog/2014-09-17/node-flame-graphs-on-linux.html.

1) I ran my node.js app with a --perf-basic-prof under a web user and saw it generated a perf map file in the temp folder for the process.

2) After a day I tried to generate the flame graph itself using these commands:

$ sudo bash
# perf record -F 99 -p <node_process_id> -g -- sleep 30
# perf script > out.nodestacks01
# git clone --depth 1 http://github.com/brendangregg/FlameGraph
# cd FlameGraph
# ./stackcollapse-perf.pl < ../out.nodestacks01 | ./flamegraph.pl > ../out.nodestacks01.svg

it did generate a flame graph but it looks very strange, with very few entries, some unknown and looks very far from what happening in the code.

enter image description here

Why is this happening? What am I missing here? Could it be related the node.js running promises or generators (I highly doubt that). Could it be because the sampling is 30 second and that most of my activity happen about 4 hours ago? What would I get this kind of flame graph? Do I need to do something else?

Dory Zidon
  • 9,328
  • 2
  • 20
  • 33

0 Answers0