J. Eastlack

How to setup Oprofile for iMX53 (ARM Cortex-A8) -blog archive

Discussion created by J. Eastlack Employee on Aug 12, 2011

In timer mode

  1. Setting up the kernel with LTIB
    $ ./ltib -p kernel -c -f       //Configures the kernel package only and forces a kernel rebuild
  2. Select the kernel modules when GUI based editor appears
    General Setup ---> Select [*] Profiling Support
    General Setup ---> Select <*> OProfile system profiling
    Kernel Hacking ---> Select [*] Kernel Debugging
    <Exit> and Save will start the build

Note: do not select performance counters and monitoring support for time mode. i.e.:

General Setup ---> Kernel Performance Events And Counters  ---> [ ] Kernel performance events and counters
  1. Find the new kernel
    // The new kernel image (uImage) is put in ../ltib/rootfs/boot/
  2. Copy the new kernel image to SD card
    $ sudo dd if=uImage of=/dev/sdx bs=512 seek=2048 &sync
  3. Copy the vmlinux image to the /boot directory of the target rootfs
    $ sudo mount -l /dev/sdx1 /media/sdcard
    $ sudo cp vmlinux

On i.MX53 target

  1. Change the name of vmlinux to vmlinux-'uname -r'
    $ cd /boot
    $ sudo cp vmlinux vmlinux
    -'uname -r'
    $ cd
  2. Install oprofile (on ubuntu)
    $ sudo apt-get install oprofile
  3. Run oprofile
    $ sudo opcontrol --init
    $ sudo opcontrol
    --vmlinux=/boot/vmlinux-'uname -r'
    $ sudo opcontrol
    $ sudo opcontrol
    // do stuff
    $ sudo opcontrol
    $ sudo opcontrol
  4. Run opreport
    $ sudo opreport --symbols