Oprofile setup: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
 
m (categorization & cosmetics)
Line 1: Line 1:
== 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
Line 14: Line 13:
2) Install srpm on src machine:
2) Install srpm on src machine:


rpm -Uvh kernel-2.6.21-20070312.1.olpc.3eca75102a57502.src.rpm
<pre>
rpm -Uvh kernel-2.6.21-20070312.1.olpc.3eca75102a57502.src.rpm
</pre>


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


CONFIG_OPROFILE=m
<pre>
CONFIG_OPROFILE=m
</pre>


3) Start the build in the SPECS directory rebuild the kernel with
3) Start the build in the SPECS directory rebuild the kernel with
command similar to:
command similar to:


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


4) Copy over kernel i586 rpm to olpc machine.
4) Copy over kernel i586 rpm to olpc machine.


5) Copy BUILD/kernel-2.6.21/linux-2.6.21.i586/vmlinux to the olpc machine.
5) Copy <tt>BUILD/kernel-2.6.21/linux-2.6.21.i586/vmlinux</tt> to the olpc machine.
This is only needed if one wants data on where samples are taken in the kernel.
This is only needed if one wants data on where samples are taken in the kernel.



== OLPC Machine Steps ==
== OLPC Machine Steps ==
Line 44: Line 36:
olpc machine:
olpc machine:


1) Install binutils on olpc machine:
1) Install <tt>binutils</tt> on olpc machine:


yum install binutils
<pre>
yum install binutils
</pre>


2) Install oprofile on olpc machine:
2) Install oprofile on olpc machine:


yum install oprofile
<pre>

yum install oprofile
</pre>
3) Install the new oprofile enabled kernel:
3) Install the new oprofile enabled kernel:


rpm -Uvh kernel-2.6.21-20070318.olpc1p.3eca75102a57502.i586.rpm
<pre>
rpm -Uvh kernel-2.6.21-20070318.olpc1p.3eca75102a57502.i586.rpm
</pre>


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


5) As root configure OProfile to collect data:
5) As <tt>root</tt> configure OProfile to collect data:


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


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


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


6) As root start oprofile running with:
6) As <tt>root</tt> start oprofile running with:


opcontrol --start
<pre>
opcontrol --start
</pre>


7) Do desired experiment to collect data
7) Do desired experiment to collect data
Line 87: Line 68:
8) As root shutdown OProfile with:
8) As root shutdown OProfile with:


opcontrol --shutdown
<pre>

opcontrol --shutdown
9) Look at the data with the "<tt>opreport</tt>" command.
</pre>


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

Revision as of 00:18, 20 March 2007

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.

Host machine Steps

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 SOURCES/kernel-olpc-custom.config changing CONFIG_OPROFILE 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 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.

OLPC Machine Steps

After completing the steps to get a oprofile working kernel on the olpc machine:

1) Install binutils on olpc machine:

yum install binutils

2) Install oprofile on olpc machine:

yum install oprofile

3) Install the new oprofile enabled kernel:

rpm -Uvh kernel-2.6.21-20070318.olpc1p.3eca75102a57502.i586.rpm

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

5) 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

6) As root start oprofile running with:

opcontrol --start

7) Do desired experiment to collect data

8) As root shutdown OProfile with:

opcontrol --shutdown

9) Look at the data with the "opreport" command.