3.4.3. OProfileUI - A GUI for OProfile

Yocto also supports a graphical UI for controlling and viewing OProfile traces, called OProfileUI. To use it, you first need to clone the oprofileui git repo, then configure, build, and install it:

     [trz@empanada tmp]$ git clone git://git.yoctoproject.org/oprofileui
     [trz@empanada tmp]$ cd oprofileui
     [trz@empanada oprofileui]$ ./autogen.sh
     [trz@empanada oprofileui]$ sudo make install
            

OprofileUI replaces the 'opreport' functionality with a GUI, and normally doesn't require the user to use 'opcontrol' either. If you want to profile the kernel, however, you need to either use the UI to specify a vmlinux or use 'opcontrol' to specify it on the target:

First, on the target, check if vmlinux file: is set:

     root@crownbay:~# opcontrol --status
            

If not:

     root@crownbay:~# opcontrol --shutdown
     root@crownbay:~# opcontrol --vmlinux=/boot/vmlinux-`uname -r`
     root@crownbay:~# opcontrol --start-daemon
            

Now, start the oprofile UI on the host system:

     [trz@empanada oprofileui]$ oprofile-viewer
            

To run a profile on the remote system, first connect to the remote system by pressing the 'Connect' button and supplying the IP address and port of the remote system (the default port is 4224).

The oprofile server should automatically be started already. If not, the connection will fail and you either typed in the wrong IP address and port (see below), or you need to start the server yourself:

     root@crownbay:~# oprofile-server
            

Or, to specify a specific port:

     root@crownbay:~# oprofile-server --port 8888
            

Once connected, press the 'Start' button and then run the wget workload on the remote system:

     root@crownbay:~# rm linux-2.6.19.2.tar.bz2; wget http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2; sync
     Connecting to downloads.yoctoproject.org (140.211.169.59:80)
     linux-2.6.19.2.tar.b 100% |*******************************| 41727k  0:00:00 ETA
            

Once the workload completes, press the 'Stop' button. At that point the OProfile viewer will download the profile files it's collected (this may take some time, especially if the kernel was profiled). While it downloads the files, you should see something like the following:

Once the profile files have been retrieved, you should see a list of the processes that were profiled:

If you select one of them, you should see all the symbols that were hit during the profile. Selecting one of them will show a list of callers and callees of the chosen function in two panes below the top pane. For example, here's what we see when we select __copy_to_user_ll():

As another example, we can look at the busybox process and see that the progress meter made a system call: