File: ProfilePrograms.rst

package info (click to toggle)
seqan2 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 228,748 kB
  • sloc: cpp: 257,602; ansic: 91,967; python: 8,326; sh: 1,056; xml: 570; makefile: 229; awk: 51; javascript: 21
file content (45 lines) | stat: -rw-r--r-- 1,236 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.. sidebar:: ToC

    .. contents::

.. _infra-misc-profile-programs:

Profiling Programs
==================

Linux Perf Tools (Linux)
------------------------

*  https://perf.wiki.kernel.org/
*  Requires ``echo '-1' > /proc/sys/kernel/perf_event_paranoid`` as root.

Useful commands:

*  ``perf top`` - display ``top``-like display but on function granularity
*  ``perf record PROGRAM`` - execute PROGRAM with profiling
*  ``perf report PROGRAM`` - display report for PROGRAM

Google Perftools (Linux, Mac Os X)
----------------------------------

*  Download and install https://code.google.com/p/gperftools/ (also available through Ubuntu/Debian packages)
*  Compile your program with debug symbols (you probably want to enable optimization as well).

.. code-block:: console

    # Tell the profiler where to write its output.
    export CPUPROFILE=${OUT}
    LD_PRELOAD="/usr/lib/libprofiler.so.0" ${PROGRAM} ${COMMAND_LINE}
    google-pprof ${PROGRAM} ${OUT}

Interesting commands:

*  ``gv``/``web`` - display weighted call graph in gv or in your browser
*  ``top``/``topX`` - display top 10/X hitters
*  ``disasm NAME`` - disassemble functions matching NAME

Instruments (Mac Os X)
----------------------

.. todo:: Write me!