Editing Documentation/devtools/maemo5/oprofile

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 45: Line 45:
Nokia-N900-40-12:~# opcontrol --no-vmlinux
Nokia-N900-40-12:~# opcontrol --no-vmlinux
Nokia-N900-40-12:~# opcontrol --separate=kernel
Nokia-N900-40-12:~# opcontrol --separate=kernel
-
Nokia-N900-40-12:~# opcontrol -c 8
 
Nokia-N900-40-12:~# opcontrol --init
Nokia-N900-40-12:~# opcontrol --init
</pre>
</pre>
-
Like with the ''--separate=library'' option, the ''--separate=kernel'' option separates the collected statistics per process and their components. In most use-cases cases processes (implicitly) request other processes like X server and hildon-desktop to do work for them. To optimize the CPU usage, you need to see which processes need to use most CPU and in which of its components (binary/libraries) in the whole system. The ''--separate=kernel'' option will additionally assign CPU usage within kernel under the processes that caused it. The vmlinux binary name is used for this part. The ''-c 8'' option will make oprofile collect information about the call graph, till the depth of 8 function calls.
+
Like with the ''--separate=library'' option, the ''--separate=kernel'' option separates the collected statistics per process and their components. In most use-cases cases processes (implicitly) request other processes like X server and hildon-desktop to do work for them. To optimize the CPU usage, you need to see which processes need to use most CPU and in which of its components (binary/libraries) in the whole system. The ''--separate=kernel'' option will additionally assign CPU usage within kernel under the processes that caused it. The vmlinux binary name is used for this part.
2. Start the usecase you are interested in and type:
2. Start the usecase you are interested in and type:
Line 134: Line 133:
=== Profiling with callgraphs ===
=== Profiling with callgraphs ===
-
If you have initialized opcontrol with the ''-c'' option as described before, you should now be able to get call graphs for your applications. The textual information reported by opreport in these cases is a bit difficult to read, but there are ways to generate nice graphs out of them:
+
TODO
-
<pre>
+
-
Nokia-N900-40-12:~# opreport -l /usr/bin/Xorg -c > oprofile.log
+
-
#...copy the oprofile.log to your PC...
+
-
myPC$ cat oprofile.log | python gprof2dot.py -f oprofile | dot -Tpng -o callgraph.png
+
-
</pre>
+
-
 
+
-
You need the [http://jrfonseca.googlecode.com/svn/trunk/gprof2dot/gprof2dot.py gprof2dot.py] script and the ''dot'' tool, which is part of the [http://www.graphviz.org/ Graphviz] software (which is in Ubuntu's ''graphviz'' package).
+
=== Viewing reports from a PC ===
=== Viewing reports from a PC ===
Line 166: Line 158:
# in scratchbox: opreport -gdf | op2calltree (you might want to copy op2calltree script somewhere on target)
# in scratchbox: opreport -gdf | op2calltree (you might want to copy op2calltree script somewhere on target)
# the resulting files can now be opened with kcachegrind on host, provided you set it to display ALL files (extensions are wrong)
# the resulting files can now be opened with kcachegrind on host, provided you set it to display ALL files (extensions are wrong)
 +
== Links ==
== Links ==

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: