Oprofile setup: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
 
m (Fix line break.)
 
(15 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{translations}}
== Setting Up OProfile to Run on OLPC Laptop ==


== Setting Up OProfile to Run on OLPC Laptop ==


It is possible to get oprofile in timer mode working on the olpc
It is possible to get '''OProfile''' in timer mode working on the olpc
machine. Performance monitoring hardware on Geode process is not
machine. Performance monitoring hardware on Geode process is not
supported. The jffs2 file system does NOT support the mechanism
supported.
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.


== Host machine Steps ==
== OLPC Machine Steps ==


* 1) Install <tt>binutils</tt> and <tt>oprofile</tt>:
1) Download the appropriate kernel srpm from:


yum install binutils oprofile
http://dev.laptop.org/~dilinger/stable/
''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.
2) Install srpm on src machine:


<pre>
<pre>
mkdir /var/lib/oprofile
rpm -Uvh kernel-2.6.21-20070312.1.olpc.3eca75102a57502.src.rpm
mount -t ramfs none /var/lib/oprofile
</pre>
</pre>


Or
2a) Edit SOURCES/kernel-olpc-custom.config changing CONFIG_OPROFILE to:


<pre>
<pre>
mkdir /media/usbflash
CONFIG_OPROFILE=m
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
</pre>
</pre>


* 3) As <tt>[[root]]</tt> configure OProfile to collect data:
3) Start the build in the SPECS directory rebuild the kernel with
command similar to:


opcontrol --setup --vmlinux=/root/vmlinux --separate=library
<pre>
rpmbuild -ba --define "dist olpc1p" --define "olpc 1" \
--define "head 3eca75102a57502" --target=i586 \
./olpc-2.6.spec >& olpc_kernel.problems &
</pre>


If you do not care about kernel data, you can skip installing vmlinux
4) Copy over kernel i586 rpm to olpc machine.
and configure with:


opcontrol --setup --no-vmlinux --separate=library
5) Copy BUILD/kernel-2.6.21/linux-2.6.21.i586/vmlinux to the olpc machine.
This is only needed if one wants data on where samples are taken in the kernel.


* 4) As <tt>[[root]]</tt> start oprofile running with:


opcontrol --start
== OLPC Machine Steps ==


* 5) Do desired experiment to collect data
After completing the steps to get a oprofile working kernel on the
olpc machine:


* 6) As <tt>[[root]]</tt> shutdown '''OProfile''' with:
1) Install binutils on olpc machine:


opcontrol --shutdown
<pre>
yum install binutils
</pre>


* 7) Look at the data with the "<tt>opreport</tt>" command.
2) Install oprofile on olpc machine:


* 8) Unmount filesystem storing '''OProfile''' samples if needed.
<pre>
yum install oprofile
</pre>
3) Install the new oprofile enabled kernel:


== Discussions about Oprofile @ devel ==
<pre>
* http://lists.laptop.org/pipermail/devel/2007-November/007527.html
rpm -Uvh kernel-2.6.21-20070318.olpc1p.3eca75102a57502.i586.rpm
* http://lists.laptop.org/pipermail/devel/2008-January/009441.html
</pre>


4) Reboot the olpc machine. When it reboots it will be running the
oprofile enabled kernel

5) As root configure OProfile to collect data:

<pre>
opcontrol --setup --vmlinux=/root/vmlinux --separate=library
</pre>

If you do not care about kernel data, you can skip installing vmlinux
and configure with:

<pre>
opcontrol --setup --no-vmlinux --separate=library
</pre>

6) As root start oprofile running with:

<pre>
opcontrol --start
</pre>

7) Do desired experiment to collect data

8) As root shutdown OProfile with:

<pre>
opcontrol --shutdown
</pre>


[[Category:Developers]]
9) Look at the data with the "opreport" command.
[[Category:OS]]
[[Category:Software development]]

Latest revision as of 14:06, 11 March 2008

  english | spanish HowTo [ID# 115934]  +/-  


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.

Discussions about Oprofile @ devel