Skip to content
Erlang Easy Profiling (eep) application provides a way to analyze application performance and call hierarchy
Erlang
Latest commit 8f6e5e3 May 24, 2016 @virtan Merge pull request #11 from fogfish/master
fix application crash application:start(eep).
Failed to load latest commit information.
doc buggy view Nov 25, 2013
src fix application crash application:start(eep). May 19, 2016
.gitignore more details Nov 12, 2013
README.md make copy-paste run easier Jan 26, 2015
rebar.config initial commit Nov 12, 2013

README.md

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)
  • very informative visualization of time costs and call stacks (kcachegrind)
  • ability to export call graphs in dot or image format
  • optional process separation
  • based on dbg module and built-in low overhead trace ports
  • 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:

  1. Make sure the target system can use eep module (link eep to your rebar project or place compiled eep.beam at any code path)
  2. Collect runtime data to local file
    1> eep:start_file_tracing("file_name"), timer:sleep(10000), eep:stop_tracing().
    
  3. Copy $PWD/file_name.trace from the target system

Outside the target system:

  1. Make sure collected runtime data is in current directory ($PWD/file_name.trace)
  2. Convert to callgrind format
    1> eep:convert_tracing("file_name").
    
  3. Start kcachegrind
    $ kcachegrind callgrind.out.file_name
    

Also

  1. Collect specific module calls only
    1> eep:start_file_tracing("file_name", [], [my_module_1, my_module_2]).
    
  2. Include time spent waiting for event (not running)
    1> eep:convert_tracing("file_name", [waits]).
    
  3. Dump collected runtime data
    1> eep:dump_tracing("file_name").
    
  4. Remove separation by erlang process
    $ grep -v "^ob=" callgrind.out.file_name > callgrind.out.merged_file_name
    
  5. Route runtime data to other host, then process trace on that host
    (eep@otherhost) 1> eep:start_net_client("targethost", 1088, "file_name", wait).
    (eep@targethost) 1> eep:start_net_tracing(1088).
    

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

Author

Igor Milyakov virtan@virtan.com

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.

Something went wrong with that request. Please try again.