about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/perf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/kernel/perf/default.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/perf/default.nix29
1 files changed, 21 insertions, 8 deletions
diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix
index 851a4c8d5d7b6..17f1fc2da464a 100644
--- a/pkgs/os-specific/linux/kernel/perf/default.nix
+++ b/pkgs/os-specific/linux/kernel/perf/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchurl
+, fetchpatch
 , kernel
 , elfutils
 , python3
@@ -60,6 +61,23 @@ stdenv.mkDerivation {
 
   inherit (kernel) src;
 
+  # Fix 6.10.0 holding pkg-config completely wrong.
+  # Patches from perf-tools-next, should be in 6.11 or hopefully backported.
+  patches = lib.optionals (lib.versionAtLeast kernel.version "6.10") [
+    (fetchpatch {
+      url = "https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/patch/?id=0f0e1f44569061e3dc590cd0b8cb74d8fd53706b";
+      hash = "sha256-9u/zhbsDgwOr4T4k9td/WJYRuSHIfbtfS+oNx8nbOlM=";
+    })
+    (fetchpatch {
+      url = "https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/patch/?id=366e17409f1f17ad872259ce4a4f8a92beb4c4ee";
+      hash = "sha256-NZK1u40qvMwWcgkgJPGpEax2eMo9xHrCQxSYYOK0rbo=";
+    })
+    (fetchpatch {
+      url = "https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/patch/?id=1d302f626c2a23e4fd05bb810eff300e8f2174fd";
+      hash = "sha256-KhCmof8LkyTcBBpfMEtolL3m3kmC5rukKzQvufVKCdI=";
+    })
+  ];
+
   postPatch = ''
     # Linux scripts
     patchShebangs scripts
@@ -128,17 +146,12 @@ stdenv.mkDerivation {
   ++ lib.optional (lib.versionAtLeast kernel.version "5.8") libpfm
   ++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3.pkgs.setuptools;
 
-  env.NIX_CFLAGS_COMPILE = toString ([
+  env.NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=cpp"
     "-Wno-error=bool-compare"
     "-Wno-error=deprecated-declarations"
     "-Wno-error=stringop-truncation"
-  ] ++ lib.optionals (stdenv.cc.isGNU && lib.versions.major stdenv.cc.version == "13") [
-    # Workaround gcc bug that causes enev simplest `perf top` runs to
-    # crash: https://gcc.gnu.org/PR111009.
-    # Can be removed once gcc-13 is updated past 13.2.0.
-    "-O1"
-  ]);
+  ];
 
   doCheck = false; # requires "sparse"
 
@@ -164,7 +177,7 @@ stdenv.mkDerivation {
     homepage = "https://perf.wiki.kernel.org/";
     description = "Linux tools to profile with performance counters";
     mainProgram = "perf";
-    maintainers = with maintainers; [ viric ];
+    maintainers = with maintainers; [ tobim ];
     platforms = platforms.linux;
     broken = kernel.kernelOlder "5";
   };