Where is vmlinux on my Ubuntu installation?

I'm trying to work with starting up oprofile, and I'm running into a problem at this step:

opcontrol --vmlinux=/path/to/vmlinux

Ubuntu has no package called vmlinux, and when I do a locate vmlinux, I get a lot of files:

/usr/src/linux-headers-2.6.28-14/arch/h8300/boot/compressed/vmlinux.lds
/usr/src/linux-headers-2.6.28-14/arch/m68k/kernel/vmlinux-std.lds
/usr/src/linux-headers-2.6.28-14/arch/m68k/kernel/vmlinux-sun3.lds
/usr/src/linux-headers-2.6.28-14/arch/mn10300/boot/compressed/vmlinux.lds
/usr/src/linux-headers-2.6.28-14/arch/sh/boot/compressed/vmlinux_64.lds
/usr/src/linux-headers-2.6.28-14/arch/x86/boot/compressed/vmlinux_32.lds
/usr/src/linux-headers-2.6.28-14/arch/x86/boot/compressed/vmlinux_64.lds
/usr/src/linux-headers-2.6.28-14/include/asm-generic/vmlinux.lds.h
/usr/src/linux-headers-2.6.28-15/arch/h8300/boot/compressed/vmlinux.lds
/usr/src/linux-headers-2.6.28-15/arch/m68k/kernel/vmlinux-std.lds
/usr/src/linux-headers-2.6.28-15/arch/m68k/kernel/vmlinux-sun3.lds
/usr/src/linux-headers-2.6.28-15/arch/mn10300/boot/compressed/vmlinux.lds
/usr/src/linux-headers-2.6.28-15/arch/sh/boot/compressed/vmlinux_64.lds
/usr/src/linux-headers-2.6.28-15/arch/x86/boot/compressed/vmlinux_32.lds
/usr/src/linux-headers-2.6.28-15/arch/x86/boot/compressed/vmlinux_64.lds
/usr/src/linux-headers-2.6.28-15/include/asm-generic/vmlinux.lds.h
/usr/src/linux-headers-2.6.28-16/arch/h8300/boot/compressed/vmlinux.lds
/usr/src/linux-headers-2.6.28-16/arch/m68k/kernel/vmlinux-std.lds
/usr/src/linux-headers-2.6.28-16/arch/m68k/kernel/vmlinux-sun3.lds
/usr/src/linux-headers-2.6.28-16/arch/mn10300/boot/compressed/vmlinux.lds
/usr/src/linux-headers-2.6.28-16/arch/sh/boot/compressed/vmlinux_64.lds
/usr/src/linux-headers-2.6.28-16/arch/x86/boot/compressed/vmlinux_32.lds
/usr/src/linux-headers-2.6.28-16/arch/x86/boot/compressed/vmlinux_64.lds
/usr/src/linux-headers-2.6.28-16/include/asm-generic/vmlinux.lds.h

Which one of these is the one I'm looking for?


Solution 1:

It should be in your /boot directory - mu Ubuntu actually has compressed versions along the lines of vmlinuz-2.6.28-16-generic.

Whether oprofile can work with those is not a question I can answer.

Solution 2:

The easiest(and non-hacky) way to obtain vmlinux under Ubuntu is to add ddebs repository:

echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-security main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | \
sudo tee -a /etc/apt/sources.list.d/ddebs.list

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01

and install kernel debug symbols:

sudo apt-get update
sudo apt-get install linux-image-$(uname -r)-dbgsym

vmlinux then can be found here:

/usr/lib/debug/boot/vmlinux-$(uname -r)