Adding vmlinux to linux kernel 'dev' derivation.

It takes some extra 13MB (and in dev, not out), but allows perf to show kernel
symbols when profiling. I think it is worth it.

In my NixOS, I refer to it in the system derivation, for easy telling to perf
through /run/booted-system/vmlinux:

  system.extraSystemBuilderCmds = ''
    ln -s ${config.boot.kernelPackages.kernel.dev}/vmlinux $out/vmlinux
  '';
This commit is contained in:
Lluís Batlle i Rossell 2016-05-06 18:07:55 +02:00
parent 5a0cde6c19
commit 53a4582552

View File

@ -109,6 +109,7 @@ let
buildFlags = [
"KBUILD_BUILD_VERSION=1-NixOS"
platform.kernelTarget
"vmlinux" # for "perf" and things like that
] ++ optional isModular "modules";
installFlags = [
@ -122,7 +123,10 @@ let
if platform.kernelTarget == "zImage" then "zinstall" else
"install") ];
postInstall = (optionalString installsFirmware ''
postInstall = ''
mkdir -p $dev
cp $buildRoot/vmlinux $dev/
'' + (optionalString installsFirmware ''
mkdir -p $out/lib/firmware
'') + (if (platform ? kernelDTB && platform.kernelDTB) then ''
make $makeFlags "''${makeFlagsArray[@]}" dtbs