CPU profiling will use perf tool to sample and get CPU profile. It will take 30 seconds
(Only one thread can obtain profile at the same time)
If you want to get the CPU profile in text form, you need to install gperftools-2.0 on the host machine,
and make sure there is a 'pprof' executable file in the system PATH or 'be/tools/bin/' directory.
Doris will obtain Profile in the following ways:
curl http://localhost:8040/pprof/profile?seconds=30 > perf.data
pprof --text be/lib/doris_be perf.data
If you want to get the flame graph, you must first make sure that there is a 'perf' command on the host machine.
And you need to download the FlameGraph and place it under 'be/tools/FlameGraph'.
Finally, check if the following files exist. And should be executable.
be/tools/FlameGraph/stackcollapse-perf.pl
be/tools/FlameGraph/flamegraph.pl
Doris will obtain the flame graph in the following ways:
perf record -m 2 -g -p be_pid -o perf.data - sleep 30
perf script -i perf.data | stackcollapse-perf.pl | flamegraph.pl > flamegraph.svg