Oprofile setup: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Fix line break.) |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{translations}} |
|||
== Setting Up OProfile to Run on OLPC Laptop == |
== Setting Up OProfile to Run on OLPC Laptop == |
||
Line 7: | Line 9: | ||
ramfs filesystem or USB flash drive formatted as ext3 or VFAT |
ramfs filesystem or USB flash drive formatted as ext3 or VFAT |
||
to store the OProfile data. |
to store the OProfile data. |
||
== Host machine Steps == |
|||
* 0) Kernel 2.6.21-20070328.1.olpc.0ae2b813bbd8293 and new has oprofile enabled, you can skip to step 5b. |
|||
* 1) Download the appropriate kernel srpm from: |
|||
http://dev.laptop.org/~dilinger/stable/ |
|||
* 2) Install srpm on src machine: |
|||
rpm -Uvh kernel-2.6.21-20070312.1.olpc.3eca75102a57502.src.rpm |
|||
2a) Edit <tt>SOURCES/kernel-olpc-custom.config</tt> changing <tt>CONFIG_OPROFILE</tt> to: |
|||
CONFIG_OPROFILE=m |
|||
* 3) Start the build in the SPECS directory rebuild the kernel with |
|||
command similar to: |
|||
rpmbuild -ba --define "dist olpc1p" --define "olpc 1" \ |
|||
--define "head 3eca75102a57502" --target=i586 \ |
|||
./olpc-2.6.spec >& olpc_kernel.problems & |
|||
* 4) Copy over kernel i586 rpm to olpc machine. |
|||
* 5) Copy <tt>vmlinux</tt> to the olpc machine. This is only needed if one wants data on where samples are taken in the kernel. |
|||
** a) If building kernel RPM on host machine copy, <tt>BUILD/kernel-2.6.21/linux-2.6.21.i586/vmlinux</tt> to the olpc machine. |
|||
** b) If installing newer kernel RPM that enables OProfile, install the kernel-debuginfo RPM for the OLP kernel on the host machine. copy <tt>/usr/lib/debug/lib/modules/</tt>''release''<tt>/vmlinux</tt> to the olpc machine. |
|||
== OLPC Machine Steps == |
== OLPC Machine Steps == |
||
⚫ | |||
After completing the steps to get a oprofile working kernel on the |
|||
olpc machine. If kernel 2.6.21-20070328.1.olpc.0ae2b813bbd8293 or newer is being used skip to step 1: |
|||
⚫ | |||
* 0) If kernel 2.6.21-20070328.1.olpc.0ae2b813bbd8293 or newer is being used skip to step 1. |
|||
''Or'' |
|||
Install the new oprofile enabled kernel and reboot machine: |
|||
init 3; |
|||
⚫ | |||
* 2) If running from an image in the internal jffs2 file system, you will need to mount another file system to store the samples. Below are examples of the commands to set that up. You will need to modify for local conditions. |
|||
rpm -Uvh kernel-2.6.21-20070318.olpc1p.3eca75102a57502.i586.rpm |
|||
⚫ | |||
⚫ | |||
* 2) Install oprofile on olpc machine: |
|||
⚫ | |||
* 3) If running from an image in the internal jffs2 file system, |
|||
you will need to mount another file system to store the samples. |
|||
Below are examples of the commands to set that up. You will need |
|||
to modify for local conditions. |
|||
<pre> |
<pre> |
||
mkdir /var/lib/oprofile |
|||
mount -t ramfs none /var/lib/oprofile |
mount -t ramfs none /var/lib/oprofile |
||
</pre> |
</pre> |
||
Line 74: | Line 36: | ||
</pre> |
</pre> |
||
* |
* 3) As <tt>[[root]]</tt> configure OProfile to collect data: |
||
opcontrol --setup --vmlinux=/root/vmlinux --separate=library |
opcontrol --setup --vmlinux=/root/vmlinux --separate=library |
||
Line 83: | Line 45: | ||
opcontrol --setup --no-vmlinux --separate=library |
opcontrol --setup --no-vmlinux --separate=library |
||
* |
* 4) As <tt>[[root]]</tt> start oprofile running with: |
||
opcontrol --start |
opcontrol --start |
||
* |
* 5) Do desired experiment to collect data |
||
* |
* 6) As <tt>[[root]]</tt> shutdown '''OProfile''' with: |
||
opcontrol --shutdown |
opcontrol --shutdown |
||
* |
* 7) Look at the data with the "<tt>opreport</tt>" command. |
||
⚫ | |||
== Discussions about Oprofile @ devel == |
|||
* http://lists.laptop.org/pipermail/devel/2007-November/007527.html |
|||
* http://lists.laptop.org/pipermail/devel/2008-January/009441.html |
|||
⚫ | |||
[[Category:Developers]] |
[[Category:Developers]] |
Latest revision as of 14:06, 11 March 2008
Setting Up OProfile to Run on OLPC Laptop
It is possible to get OProfile in timer mode working on the olpc machine. Performance monitoring hardware on Geode process is not supported. The jffs2 file system does NOT support the mechanism that OProfile uses. You will need another file system such as ramfs filesystem or USB flash drive formatted as ext3 or VFAT to store the OProfile data.
OLPC Machine Steps
- 1) Install binutils and oprofile:
yum install binutils oprofile
Or
init 3; yum -yt install binutils oprofile
- 2) If running from an image in the internal jffs2 file system, you will need to mount another file system to store the samples. Below are examples of the commands to set that up. You will need to modify for local conditions.
mkdir /var/lib/oprofile mount -t ramfs none /var/lib/oprofile
Or
mkdir /media/usbflash mount -t ext3 /dev/sda1 /media/usbflash rm -rf /var/lib/oprofile/samples/current mkdir /media/usbflash/samples ln -s /media/usbflash/samples /var/lib/oprofile/samples/current
- 3) As root configure OProfile to collect data:
opcontrol --setup --vmlinux=/root/vmlinux --separate=library
If you do not care about kernel data, you can skip installing vmlinux and configure with:
opcontrol --setup --no-vmlinux --separate=library
- 4) As root start oprofile running with:
opcontrol --start
- 5) Do desired experiment to collect data
- 6) As root shutdown OProfile with:
opcontrol --shutdown
- 7) Look at the data with the "opreport" command.
- 8) Unmount filesystem storing OProfile samples if needed.