Awesome
Erlang Easy Profiling (eep)
Erlang Easy Profiling (eep) application provides a way to analyze application performance and call hierarchy.
Main features:
- no need to modify sources (doesn't need sources at all)
- no need to stop your running system
- start and stop collecting runtime data at arbitrary time
- profile arbitrary module or whole system
- minimal impact on profiled system performance (unlike [fprof] 6)
- very informative visualization of time costs and call stacks ([kcachegrind] 7)
- ability to export call graphs in dot or image format
- optional process separation
- based on [dbg] 8 module and built-in low overhead [trace ports] 9
- optionally route runtime data over network to minimize disk load
Limitations:
- doesn't work with natively compiled code
- doesn't support parent-child links (will appear in future versions)
How to
On target system:
- Make sure the target system can use eep module (link eep to your rebar project or place compiled eep.beam at any code path)
- Collect runtime data to local file
- Copy $PWD/file_name.trace from the target system
Outside the target system:
- Make sure collected runtime data is in current directory ($PWD/file_name.trace)
- Convert to callgrind format
- Start kcachegrind
Also
- Collect specific module calls only
- Include time spent waiting for event (not running)
- Dump collected runtime data
- Remove separation by erlang process
- Route runtime data to other host, then process trace on that host
Useful
- Turn off kcachegrind "cycle detection", eep detects cycles by itself
- Absolute numbers in kcachegrind are microseconds
- ELF Objects in kcachegrind are erlang pids
- By default kcachegrind limits caller depth and node cost (can be changed in call graph context menu in Graph submenu)
- Tail recursion loop within group of functions has incorrect calls and time cost values
Screenshots
-
[Overall view] 1
-
[Call hierarchy] 2
-
[Functions navigator] 3
-
[Callees ordered by cost] 4
-
[Relative costs view] 5
Author
Igor Milyakov [virtan@virtan.com] 10
License
The MIT License (MIT)
Copyright (c) 2013 Igor Milyakov virtan@virtan.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.