-
Notifications
You must be signed in to change notification settings - Fork 145
Using the profiling tools
Karsten Poeck edited this page May 25, 2020
·
9 revisions
Profiling tools are in clasp/src/profile
git clone https://github.com/brendangregg/FlameGraph
in<path-to-flamegraph>
-
git clone https://github.com/clasp-developers/FlameGraph.git
in<path-to-flamegraph>
export FLAME_GRAPH_HOME=<path-to-flamegraph>/FlameGraph
- find out the
<pid>
of the clasp you want to meter withps
on the command line or(sys:getpid)
within clasp. - Execute
./do-flame <pid>
- that leaves a .svg file in/tmp/out-<pid>.svg
- View with your browser
./do-dtrace <pid>
Generates the file /tmp/out-symbol-.user_stacks
./count-calls -i /tmp/out-symbol-<pid>.user_stacks -o /tmp/out.txt
Generates a sorted list of function names and how many of the backtraces contained that function name.
./prune -i /tmp/out-symbol-<pid>.user_stacks -o /tmp/out-pruned.user_stacks -s <PART-OF-FUNCTION-NAME>
Generates backtraces that start with the frame .
./flame /tmp/out-pruned.user_stacks
Generates /tmp/out-.svg - view this in chrome
The profiling code has some specifics to filter clasp frames, but works for other compilers as well (tested with ecl)