Editing Documentation/Maemo Eclipse Tutorial/Eclipse Performance Profiling

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 1: Line 1:
-
To obtain high-quality applications to be deployed on user's mobile devices, making sure that your application is bug-free is not enough. Mobile devices have limited resources, mainly CPU processing and memory. Also the way that applications interact with system resources impacts directly on performance. It is very problematic if your application crashes during execution. However, it can be worse if the application freezes due to excessive CPU processing, for example. The [[Documentation/devtools/maemo5/oprofile|OProfile]] tool can be used to monitor your application and define bottle necks in real-world systems. In order to find problems in performance, Maemo SDK also provides OProfile packages so it can be used to profiling Maemo applications as well Internet Tablet environments.
+
To obtain high-quality applications to be deployed on user's mobile devices, making sure that your application is bug-free is not enough. Mobile devices have limited resources, mainly CPU processing and memory. Also the way that applications interact with system resources impacts directly on performance. It is very problematic if your application crashes during execution. However, it can be worse if the application freezes due to excessive CPU processing, for example. The OProfile tool can be used to monitor your application and define bottle necks in real-world systems. In order to find problems in performance, Maemo SDK also provides OProfile packages so it can be used to profiling Maemo applications as well Internet Tablet environments.
Maemo Eclipse IDE integration products (ESbox and PluThon) provide support to profiling applications by using OProfile profiling and monitoring tool. This tutorial starts with a quickly introduction to OProfile profiling and monitoring tool. After that, it demonstrates how you can profile C/C++, Qt4 and Python applications at ESbox and PluThon using the OProfile tool integration. Finally, you can see how to interpret OProfile output at ESbox and PluThon.
Maemo Eclipse IDE integration products (ESbox and PluThon) provide support to profiling applications by using OProfile profiling and monitoring tool. This tutorial starts with a quickly introduction to OProfile profiling and monitoring tool. After that, it demonstrates how you can profile C/C++, Qt4 and Python applications at ESbox and PluThon using the OProfile tool integration. Finally, you can see how to interpret OProfile output at ESbox and PluThon.
Line 7: Line 7:
OProfile is an open source project that helps you to identify common performance issues, such as loop unrolling, poor cache utilization, inefficient type conversion and redundant operations, branch mispredictions, and so on. OProfile collects information about different counters: interrupt handlers, shared libraries, and much more. OProfile generates different outputs, ranging from simple tables with numbers that describe the total of samples registered during monitoring, to call graphs with detailed information about shared libraries. You can also obtain detailed source annotation, instruction-level reports and call graphs.
OProfile is an open source project that helps you to identify common performance issues, such as loop unrolling, poor cache utilization, inefficient type conversion and redundant operations, branch mispredictions, and so on. OProfile collects information about different counters: interrupt handlers, shared libraries, and much more. OProfile generates different outputs, ranging from simple tables with numbers that describe the total of samples registered during monitoring, to call graphs with detailed information about shared libraries. You can also obtain detailed source annotation, instruction-level reports and call graphs.
-
To start collecting profiling data, it is necessary to start <code>opcontrol</code> tool. It is OProfile tool that collects the information that is then used to generate profiling reports. After profiling information has been collected with <code>opcontrol</code> tool you can generate the reports you want to with <span><font face="monospace">opreport</font></span> tool.
+
To start collecting profiling data, it is necessary to start <span><font face="monospace">opcontrol</font></span> tool. It is OProfile tool that collects the information that is then used to generate profiling reports. After profiling information has been collected with <span><font face="monospace">opcontrol</font></span> tool you can generate the reports you want to with <span><font face="monospace">opreport</font></span> tool.
-
You can use OProfile on Maemo devices. However, you need to enable it on the kernel, so OProfile can monitor the system and applications. For more information about this step, see the  chapter on [[#Configuring your Maemo device|configuring your Maemo device]].
+
You can use OProfile on Maemo devices. However, you need to enable it on the kernel, so OProfile can monitor the system and applications. For more information about this step, see chapter [[#Configuring your Maemo device]].
== OProfile and IDE Integration ==
== OProfile and IDE Integration ==
Line 15: Line 15:
Both Maemo Eclipse IDE integration products ESbox and PluThon provide support for OProfile tool for C/C++, Qt4 and Python projects only on Maemo device environments. It does make sense to profile Maemo applications on Scratchbox with OProfile: it would catch also host machine interruptions, signals and produce a lot of other useless information so the result would not be accurate.
Both Maemo Eclipse IDE integration products ESbox and PluThon provide support for OProfile tool for C/C++, Qt4 and Python projects only on Maemo device environments. It does make sense to profile Maemo applications on Scratchbox with OProfile: it would catch also host machine interruptions, signals and produce a lot of other useless information so the result would not be accurate.
-
OProfile support on ESbox and PluThon uses the command <code>opreport -a -l -g</code> to generate profiling reports. In such cases, OProfile generates the report with source file and line for each symbol (<code>-g</code>) and it also accumulates sample and percentage counts in the symbol list (<code>-a</code>). This section shows how to profile your applications at ESbox and PluThon and how to analyse profiling results.
+
OProfile support on ESbox and PluThon uses the command <span><font face="monospace">opreport -a -l -g</font></span> to generate profiling reports. In such cases, OProfile generates the report with source file and line for each symbol (<span><font face="monospace">-g</font></span>) and it also accumulates sample and percentage counts in the symbol list (<span><font face="monospace">-a</font></span>). This section shows how to profile your applications at ESbox and PluThon and how to analyse profiling results.
=== Configuring your Maemo device ===
=== Configuring your Maemo device ===
Line 21: Line 21:
If you want to configure your device to profile Maemo applications, you need to enable the Maemo device kernel to execute OProfile on it. For more information, see documentation from the OProfile site like ''OProfile Manual'' <ref name=r4>OProfile Manual. http://oprofile.sourceforge.net/doc/index.html</ref> and from maemo.org site like ''OProfiling with Maemo'' <ref name=r3>OProfiling with Maemo. http://maemo.org/development/tools/doc/diablo/oprofile/</ref>.
If you want to configure your device to profile Maemo applications, you need to enable the Maemo device kernel to execute OProfile on it. For more information, see documentation from the OProfile site like ''OProfile Manual'' <ref name=r4>OProfile Manual. http://oprofile.sourceforge.net/doc/index.html</ref> and from maemo.org site like ''OProfiling with Maemo'' <ref name=r3>OProfiling with Maemo. http://maemo.org/development/tools/doc/diablo/oprofile/</ref>.
-
ESbox and PluThon products can configure the OProfile environment for you. If the system detects that your Maemo device kernel is not properly configured, a dialog prompts the user (figure [[#figure-eclipse_performance_profiling_prompt_kernel|11.1]]) to configure the kernel for OProfile.
+
ESbox and PluThon products can configure the OProfile environment for you. If the system detects that your Maemo device kernel is not properly configured, a dialog prompts the user (figure [[#fig:eclipse_performance_profiling_prompt_kernel|11.1]]) to configure the kernel for OProfile.
-
<div id="figure-eclipse_performance_profiling_prompt_kernel">
+
{| summary="Profiling application with OProfile"
-
[[Image:oprofile-04.png|frame|center|alt=Screenshot of oprofile profiling an application|Figure 11.1: Profiling application with OProfile]]
+
|+ align="BOTTOM" |'''Figure 11.1:''' Profiling application with OProfile
-
</div>
+
|-
 +
|
 +
[[Image:oprofile-04.png|Image oprofile-04]]
 +
|}
=== Profiling your Maemo application ===
=== Profiling your Maemo application ===
-
At first, you must create a C/C++, Qt4 or Python project and select an <code>ARMEL</code> Scratchbox target. To run OProfile, right-click on the application (binary for C/C++ and qt4 projects or the Python script for Python projects) and select '''Profile As &gt; Remote OProfile Profiler''', figure [[#figure-eclipse_performance_profiling_oprofile-menu|11.2]]. If the tool is not properly installed at the selected target, the system can automatically install it for you.
+
At first, you must create a C/C++, Qt4 or Python project and select an <span><font face="monospace">ARMEL</font></span> Scratchbox target. To run OProfile, right-click on the application (binary for C/C++ and qt4 projects or the Python script for Python projects) and select '''Profile As &gt; Remote OProfile Profiler''', figure [[#fig:eclipse_performance_profiling_oprofile-menu|11.2]]. If the tool is not properly installed at the selected target, the system can automatically install it for you.
-
<div id="figure-eclipse_performance_profiling_oprofile-menu">
+
{| summary="OProfile Launch Menu"
-
[[Image:oprofile-01.png|frame|center|alt=Screenshot of OProfile launch menu|'''Figure 11.2:''' OProfile Launch Menu]]
+
|+ align="BOTTOM" |'''Figure 11.2:''' OProfile Launch Menu
-
</div>
+
|-
 +
|
 +
[[Image:oprofile-01.png|Image oprofile-01]]
 +
|}
-
ESbox and PluThon runs your application on the Maemo device and the result is shown in the OProfile view, figure [[#figure-eclipse_performance_profiling_oprofile-view-05|11.3]]. All statistics found by OProfile are shown in an OProfile viewer, see the chapter on [[#Analyzing results|analyzing results]] for more details.
+
ESbox and PluThon runs your application on the Maemo device and the result is shown in the OProfile view, figure [[#fig:eclipse_performance_profiling_oprofile-view-05|11.3]]. All statistics found by OProfile are shown in an OProfile viewer, see chapter [[#Analyzing results]] for more details.
-
<div id="figure-eclipse_performance_profiling_oprofile-view-05">
+
{| summary="OProfile View"
-
[[Image:oprofile-05.png|frame|center|alt=Screenshot of OProfile viewer|Figure 11.3: OProfile View]]
+
|+ align="BOTTOM" |'''Figure 11.3:''' OProfile View
-
</div>
+
|-
 +
|
 +
[[Image:oprofile-05.png|Image oprofile-05]]
 +
|}
{{ambox
{{ambox
Line 62: Line 71:
: Shows the name of binary image.
: Shows the name of binary image.
; '''Symbol name'''
; '''Symbol name'''
-
: Shows the symbol name. If the symbol name cannot be retrieved, the label (<code>no symbols</code>) is shown instead.
+
: Shows the symbol name. If the symbol name cannot be retrived, the label (<span><font face="monospace">no symbols</font></span>) is shown instead.
-
On the following figure [[#figure-eclipse_performance_profiling_oprofile-view-08|11.4]], there is an example of OProfile chapter from a Maemo C project:
+
On the following figure [[#fig:eclipse_performance_profiling_oprofile-view-08|11.4]], there is an example of OProfile chapter from a Maemo C project:
-
<div id="figure-eclipse_performance_profiling_oprofile-view-08">
+
{| summary="OProfile View"
-
[[Image:oprofile-08.png|frame|center|alt=Screenshot of OProfile view|Figure 11.4: OProfile View]]
+
|+ align="BOTTOM" |'''Figure 11.4:''' OProfile View
-
</div>
+
|-
 +
|
 +
[[Image:oprofile-08.png|Image oprofile-08]]
 +
|}
-
In this example, we used a very simple GTK application, which only contains a simple label. On the third line (the selected line), information about library <code>ld-2.5.so</code> is shown in the table. For example, in about 12.030 samples (column '''Cum. Samples'''), the library was used on 10.879 samples (4.59%). Its symbol name is known as <code>/lib/ld-2.5.so</code> (column '''Symbol Name'''). This library does provides source file, so no information can be shown on '''Line Info''' columm.
+
In this example, we used a very simple GTK application, which only contains a simple label. On the third line (the selected line), information about library <span><font face="monospace">ld-2.5.so</font></span> is shown in the table. For example, in about 12.030 samples (columm '''Cum. Samples'''), the library was used on 10.879 samples (4.59%). Its symbol name is known as <span><font face="monospace">/lib/ld-2.5.so</font></span> (columm '''Symbol Name'''). This library does provides source file, so no information can be shown on '''Line Info''' columm.
== References ==
== References ==

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: