From 53a45825523566b8c9c5ff135e8ff75e05558d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 6 May 2016 18:07:55 +0200 Subject: [PATCH] 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 ''; --- pkgs/os-specific/linux/kernel/manual-config.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 5f2bc2d2c55b..8da8f20eae27 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -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