From bdff718c5beac36c46f9d1e458ef25a50aef752c Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Tue, 1 Apr 2014 01:10:28 -0500 Subject: [PATCH] kernel: add lockdep expression Lockdep is the kernel's locking validation/debugging tool and has seen heavy pro-active usage and development. In Linux 3.14, it's now available directly to userspace for the same purpose. It comes with a convenient utility to LD_PRELOAD a shared library for validation, or a user-space API to link to directly. Signed-off-by: Austin Seipp --- pkgs/os-specific/linux/kernel/lockdep.nix | 25 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/os-specific/linux/kernel/lockdep.nix diff --git a/pkgs/os-specific/linux/kernel/lockdep.nix b/pkgs/os-specific/linux/kernel/lockdep.nix new file mode 100644 index 00000000000..4b1805fc39e --- /dev/null +++ b/pkgs/os-specific/linux/kernel/lockdep.nix @@ -0,0 +1,25 @@ +{ stdenv, kernel }: + +assert stdenv.lib.versionAtLeast kernel.version "3.14"; +stdenv.mkDerivation { + name = "lockdep-linux-${kernel.version}"; + inherit (kernel) src patches; + + preConfigure = "cd tools/lib/lockdep"; + installPhase = '' + mkdir -p $out/bin $out/lib $out/include + + cp -R include/liblockdep $out/include + make install DESTDIR=$out prefix="" + + substituteInPlace $out/bin/lockdep --replace "./liblockdep.so" "$out/lib/liblockdep.so" + ''; + + meta = { + description = "User-space locking validation via the kernel"; + homepage = "https://kernel.org/"; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 573b7042705..b0405bbd656 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7031,6 +7031,8 @@ let perf = callPackage ../os-specific/linux/kernel/perf.nix { }; + lockdep = callPackage ../os-specific/linux/kernel/lockdep.nix { }; + psmouse_alps = callPackage ../os-specific/linux/psmouse-alps { }; spl = callPackage ../os-specific/linux/spl/default.nix { };