summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/common-config.nix
diff options
context:
space:
mode:
authorroblabla <unfiltered@roblab.la>2021-06-22 17:55:14 +0200
committerroblabla <unfiltered@roblab.la>2021-08-18 10:40:35 +0200
commit34150f86c0a6b9d452bab09157896c3b85b103d1 (patch)
treef4a6f934644e4293df24c8fd3fe6ca72077d044d /pkgs/os-specific/linux/kernel/common-config.nix
parentcf887eb36fb74d8d440ffdf4a8f35dd8e866826b (diff)
downloadnixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.tar
nixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.tar.gz
nixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.tar.bz2
nixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.tar.lz
nixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.tar.xz
nixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.tar.zst
nixpkgs-34150f86c0a6b9d452bab09157896c3b85b103d1.zip
linux-kernel: Enable BTF
BTF is a new, lightweight debug information format tailored specifically
for the needs of eBPF, allowing eBPF programs to be portable across
various kernel versions, configurations and distributions. This is used
by bpftrace and lots of new eBPF-based tooling to avoid a dependency
on LLVM on the host.

BTF debug information is enabled on all major distributions: Fedora 31+,
RHEL 8.2+, Ubuntu 20.10, Debian 11 and ArchLinux all have enabled it.

Enabling BTF debug information requires adding two new dependencies to
the kernel build: Python3 and pahole. Those will be used to generate the
BTF debugging information.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/common-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index 1ce4a21e242..38bb2c4ebd0 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -35,7 +35,12 @@ let
   options = {
 
     debug = {
-      DEBUG_INFO                = if (features.debug or false) then yes else no;
+      # Necessary for BTF
+      DEBUG_INFO                = mkMerge [
+        (whenOlder "5.2" (if (features.debug or false) then yes else no))
+        (whenAtLeast "5.2" yes)
+      ];
+      DEBUG_INFO_BTF            = whenAtLeast "5.2" yes;
       DEBUG_KERNEL              = yes;
       DEBUG_DEVRES              = no;
       DYNAMIC_DEBUG             = yes;