oprofile needs (not stripped) vmlinux but is not available and not easy to create (10.04 LTS)

Asked by Arjan

Hello,

Running ubuntu 10.04 LTS and want to profile the system.
using oprofile for that, but needs an uncompressed image of the kernel

now it is possible to create an uncompressed image yourself
described for example on:
http://www.codeguru.com/forum/archive/index.php/t-415186.html
with od and dd/zcat/gunzip but that doesn't help as the result is a stripped uncompressed image, and oprofile complains like:

root@laptop:~# file /boot/vmlinux-`uname -r`
/boot/vmlinux-2.6.32-22-generic: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
root@arfi-laptop:~# opcontrol --vmlinux=/boot/vmlinux-`uname -r`
root@laptop:~# opcontrol --start
The specified file /boot/vmlinux-2.6.32-22-generic does not seem to be valid
Make sure you are using the non-compressed image file (e.g. vmlinux not vmlinuz)
root@laptop:~#

In a related post http://ubuntuforums.org/showthread.php?t=568320
is mentioned that there was a "linux-image-debug-???" once, but it seems not to be included in 10.04 LTS.

so that leaved then only completely recompiling the kernel, and rebooting as an last resort option (which i don't like for several reasons)

I'm not sure to call it a bug, or perhaps i overlooked something, but i do think a "linux-image-debug-???" with the matching uncompressed and not stripped image of the running kernel should be provided

Regards,

Arjan Filius

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu oprofile Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Roy Stogner (roy-stogners) said :
#2

For future google searchers' benefit, here's what worked for me, to generate a valid vmlinux and get oprofile working:

sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package
sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
mkdir ~/src
cd ~/src
apt-get source linux-image-$(uname -r)
cd linux-*/
make oldconfig
make vmlinux
sudo opcontrol --vmlinux=vmlinux
sudo opcontrol --start

However, researching this was a hassle; I agree that it would be much more convenient to have a linux-image-debug package which was recommended by the oprofile package.