1
Compilation Requirements
2
* Debuging flags: -g -gdwarf-2 -g3
3
* Disable inlining: -fno-inline
6
opcontrol --list-events
8
CPU_CLK_UNHALTED - CPU load
9
BR_MISSP_EXEC - Branch missprediction
10
L2_LINES_IN - L2 Cache lines modifications
16
opcontrol --start-daemon
17
opcontrol --vmlinux=vmlinux (uncompressed and not stripped
18
Normally coudl be found after compilation in
19
/usr/src/linux/arch/x86/boot/compressed/vmlinux
21
opcontrol --status - Daemon configuration
27
opcontrol --event=<event1_spec> --event=<event2_spec>
28
- This should be executed before daemon started
29
- The number of supported counters dependens on CPU (1-8)
30
- Default event counter (depends on CPU): CPU_CLK_UNHALTED:100000:0:1:1
31
- Multiple events are not working for me (core duo, just first is collected)
33
event_spec: <name:sample_rate:mask:kernel_mode:user_mode>
34
+ name and mask are obtained using 'ophelp'
35
+ sample_rate - events are generated once at specified amount of cycles
36
+ if kernel_mode = 0, the events obtained in kernel mode are ignored
37
+ if user_mode = 0, the events obtained in user mode are ignored
39
opcontrol --separate=<mode>
40
+ none - do not separate the profiles (default)
41
+ library - generate per-application profiles for libraries
42
+ kernel - generate per-application profiles for the kernel
44
+ all - generate per-application profiles for libraries and
45
per-application profiles for the kernel and kernel
48
oprof_start - Simple UI allowing selection of events from list
56
opcontrol --dump forces daemon to flush current data
59
Dump all shared libraries and apps consumed cpu cycles
60
opreport --threshold 4.0
62
Dump symbols used cpu cycles (apps should be compiled with -g to get this info)
63
opreport --symbols --debug-info /path/to/library_or_app
66
opreport --symbols --debug-info --details --include-symbols symbol /path/to/library_or_app
68
Anotate library source
69
opannotate --source /home/csa/opc/libds/libds.so
70
opannotate --source --output-dir=<result_dir> /home/csa/opc/libds/libds.so
71
opannotate --assembly /home/csa/opc/libds/libds.so
73
Filtering certain events:
74
opreport event:CPU_CLK_UNHALTED cpu:1 ... (see man opreport)
75
opreport -l /usr/sbin/apach2 (full path is mandatory)
80
There is limited amount of counters which can monitor arbitrary events. AMD
81
have 4 and Intel have 2 (actually 5, but 3 is predefined and not used by
82
oprofile). To count more, the counter multiplexing is could be used by
83
modules. This actually implemented for AMD (and probably old P4 of Intel).
84
However, the support for modern Intel CPU's is still missing.
85
Development is going on in oprofile git branch by Robert Richter and he is
86
promising to include complete version 2.6.30 or 31.
87
http://git.kernel.org/?p=linux/kernel/git/rric/oprofile.git;a=shortlog;h=multiplexing
88
arch/x86/oprofile/nmi_int.c:op_nmi_init appropriate CPU model
89
op_model_ppro.c - is currently used for Core* processors
90
Patch agains 2.6.28 is certainly not including support for Intel
91
There is also was development to update oprofile apps to work with perfmon2
92
module, already supporting multiplexing, but it's only for ia64 at the moment
93
http://sourceforge.net/mailarchive/forum.php?thread_name=20090212222748.GA7205%40suse.de&forum_name=perfmon2-devel