CodingForOOo4Kids/Profiling
From Wiki.ooo4kids.org
Contents |
First: Get OOo4kids source and compile
To compile sources: global instruction
For Ubuntu: User:Benbois/Sandbox
For Mandriva: User:Matt1/sandbox/compilation_mandriva
Second: Get tools
Install Valgrind, Kcachegrind and graphviz on your system. Callgrind is included with Valgrind.
Mandriva
urpmi Kcachegrind valgrind graphviz
third: execute valgrind
- go to instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids0.9/program
- execute valgrind with callgrind
valgrind --tool=callgrind --separate-threads=no --instr-atstart=yes ./soffice
- if you want profile directly swriter, scalc or other, do not use ./swriter because valgrind will not collect data but use argument:
valgrind --tool=callgrind --separate-threads=no --instr-atstart=yes ./soffice -swriter
- wait, soffice is launching. Use function you want test.
Fourth: execute Kcachegrind
- Open Kcachegrind
- Open your data : callgrind.out
You can sort by function, source etc...
- in the column "location", source library appears.
- On the right you can see a map with function and the graph calls.
Fifth: see source code
If you want to see source code, you need to recompile module where is the librairie, with option debug.
- go to in this module
- delete unxlngi6.pro
rm -rf unxlngi6.pro
- build with --ENVCFLAGS+=-g
build --ENVCFLAGS+=-g -P2
- add /module/unxlngi6.pro/lib in configure/annotations in Kcachegring
- go to third then fourth
- In Kcachegrind you can examine this library recompiled, you see sources with percent time of processor on the right.
Bibliography
http://wiki.services.openoffice.org/wiki/Callgrind
http://wiki.services.openoffice.org/wiki/Valgrind
http://kcachegrind.sourceforge.net/html/Documentation.html
Matt1 18:51, 1 May 2010 (UTC)