/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/debugging/profiling/perf.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-21 03:52:00 UTC
  • Revision ID: csa@suren.me-20150821035200-xu1zh22cqlk2omcq
Profiling

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Events
2
 
======
3
 
    perf list
4
 
    
5
 
Operation modes
6
 
===============
7
 
 perf stat                              Collects statistics
8
 
 perf record                            Record events
9
 
 perf report/annotate                   Report the recorded events
10
 
    
11
 
 
12
 
Usage
13
 
========
14
 
 - Basic statics
15
 
    perf stat -d ./mult_sse_debug 
16
 
    perf stat -d -p PID                                 (until Ctrl+C)
17
 
    perf stat -d -a                                     (system wide)
18
 
 - Analyze stack
19
 
    perf record -e '{instructions}' -g dwarf -a
20
 
 - Hardware events
21
 
    perf stat -e event1,event2 <app>                    (specific events)
22
 
 - Profiling
23
 
    perf record -F 1000 ./mult_sse_debug                (sampling at 1000 Hz)
24
 
    perf report                                         (all samples separately)
25
 
    perf script                                         (better for script processing)
26
 
    perf report -n                                      (standard profile)
27
 
    perf report -n --stdio                              (output to standard output)
28
 
    perf annotate --source                              (mixed with assembler, no other way)
29
 
 - Memory
30
 
    perf mem -t load record <application>               (recording)
31
 
    perf mem -t load report
32
 
    perf mem -t load report --sort mem
33
 
 
34
 
 
35
 
Probes
36
 
======
37
 
 - Instrument the kernel tcp_sendmsg() function
38
 
    perf probe --add tcp_sendmsg
39
 
    perf record -e probe:tcp_sendmsg -ag -- sleep 5
40
 
    perf probe --del tcp_sendmsg
41
 
    perf report
42
 
 
43
 
 
44
 
 
45
 
 
46
 
Examples
47
 
=========
48
 
 perf stat -e 'syscalls:sys_enter_*'                                    Count system calls
49
 
 perf stat -e 'block:*' -a                                              Count block device I/O events
50
 
 perf stat -e L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores    L1 analyses
51
 
 perf stat -e 'syscalls:sys_enter_*'                                    Count syscalls
52
 
 
53
 
 
54
 
 Memory analysis
55
 
 ===============
56
 
 perf stat -e task-clock,cycles,instructions,cache-references,cache-misses <app>
57
 
 
58
 
 
 
 
b'\\ No newline at end of file'