DENX . Training2 . LddProfiling
|
- Profiling is a technique for discouvering performance bottlenecks
- For Linux two techniques available:
- ) full coverage analysis with gcov LWN article
- not included in mainline
- kernel only
- ) statistical profiling with OProfile[2]
- included in mainline and ELDK contains userspace support
- works out of the box for kernel and userspace
- OProfile
- Enable in Kernel:
- General Setup -> Profiling Support (Experimental)
- Kernel Hacking -> Compile Kernel with Debug Info
simple session (multiply example taken from [1])
# initalize oprof
$ opcontrol --init
# where's our kernel?
$ opcontrol --vmlinux=/tmp/vmlinux
# clear old data
$ opcontrol --reset
# available events?
$ opcontrol -l
# start daemon and start collecting data
$ opcontrol --start
# run application
$ while ./multiply; do ./multiply; echo -n .; done
.........
# dump data to daemon
$ opcontrol --dump
# stop daemon
$ opcontrol --stop
# examine
$ opcontrol -l ./multiply
# annotate
$ opannotate -s ./multiply
Copyright © 2002-2021 by DENX Software Engineering