bdff718c5b
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 <aseipp@pobox.com>
25 lines
739 B
Nix
25 lines
739 B
Nix
{ 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 ];
|
|
};
|
|
}
|