0

I am trying to do some performance tests, I found out that most overhead is insde the kernel (kernel.kallsyms).

So I need kernel with debuging symbols and extracted vmlinuz in order to run perf report with -k option..

I installed debugging kernel package from ddebs but I am not sure how to boot the kernel. I run update-grub2 but the kernel didnt appeared in the list..

I checked the package and found out that the kernel is installed inside /usr/lib/debug - there are its libraries (libc etc) and kernel modules..

Now I am not able to find some way of loading the kernel at boot time.

I guess I need to be runnig kernel with debugging symbols in order perf to work properly with -k option - otherwise the memory addresses wouldnt be mapped properly - right?

I run the perf -k to kernel without running the same one, but I am not sure if this is correct..

0

Ok actualy its fine running the perf against debug kernel when only normal kernel is loaded.

Btw the kernel was installed with this tutorial for systemtap: https://wiki.ubuntu.com/Kernel/Systemtap

I noticed few things - the debug kernel is already extracted - the name is vmlinux not vmlinuz and its big..

the second thing when I load it into gdb I see the exactly same number and the time of build is same as my loaded non-debug kernel:

uname -a
Linux delo 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

and the gdb (based on this:

(gdb) print init_uts_ns.name
$1 = {sysname = "Linux", '\000' <repeats 59 times>, nodename = "(none)", '\000' <repeats 58 times>, 
release = "3.13.0-55-generic", '\000' <repeats 47 times>, version = 
"#94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015", '\000' <repeats 21 times>, 
machine = "x86_64", '\000' <repeats 58 times>, domainname = "(none)", '\000' <repeats 58 times>}

I mean the part #94... is the same.

When I run the recorded perf with :

perf report -g -k /usr/lib/debug/boot/vmlinux-3.13.0-55-generic

it actualy works fine - I see the kernel symbols translated to real functions(-g is just for calltrace):

- 3,18%  app  [kernel.kallsyms]  [k] copy_user_enhanced_fast_string
 - copy_user_enhanced_fast_string
  - 98,98% system_call 
     -syscall 
       68,60% 0xbeef0100
       31,40% 0xbeee0100 
  + 0,54% generic_file_aio_read 

someone told me that when the kernel booted and kernel used by perf wouldnt align then I would definitely see it - the functions to kernel samples wouldnt make sense (just some random data instead of real name).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.