Oprofile setup: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Remove paragraph about rebuilding kernel as we already have oprofile enabled in default kernels)
No edit summary
Line 33: Line 33:
</pre>
</pre>


* 4) As <tt>root</tt> configure OProfile to collect data:
* 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 42: Line 42:
opcontrol --setup --no-vmlinux --separate=library
opcontrol --setup --no-vmlinux --separate=library


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


opcontrol --start
opcontrol --start


* 6) Do desired experiment to collect data
* 5) Do desired experiment to collect data


* 7) As root shutdown '''OProfile''' with:
* 6) As root shutdown '''OProfile''' with:


opcontrol --shutdown
opcontrol --shutdown


* 8) Look at the data with the "<tt>opreport</tt>" command.
* 7) Look at the data with the "<tt>opreport</tt>" command.


* 9) Unmount filesystem storing '''OProfile''' samples if needed.
* 8) Unmount filesystem storing '''OProfile''' samples if needed.


[[Category:Developers]]
[[Category:Developers]]

Revision as of 21:30, 31 August 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. 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
  • 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.

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.