From 474ea2b7eef0beb5b4c01eb1943091926a6ec910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 12 Sep 2008 20:00:00 +0000 Subject: [PATCH] Add Exmap, a Linux-specific tool to examine process memory usage. svn path=/nixpkgs/trunk/; revision=12857 --- pkgs/os-specific/linux/exmap/default.nix | 56 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +++ 2 files changed, 61 insertions(+) create mode 100644 pkgs/os-specific/linux/exmap/default.nix diff --git a/pkgs/os-specific/linux/exmap/default.nix b/pkgs/os-specific/linux/exmap/default.nix new file mode 100644 index 000000000000..da5e00e33772 --- /dev/null +++ b/pkgs/os-specific/linux/exmap/default.nix @@ -0,0 +1,56 @@ +{ fetchurl, stdenv, kernel, pkgconfig, gtkmm, boost, pcre }: + +stdenv.mkDerivation rec { + name = "exmap-0.10"; + + src = fetchurl { + url = "http://www.berthels.co.uk/exmap/download/${name}.tgz"; + sha256 = "0z00dhl6bdmaz7p9wlvnj0izf0zlrlkv34fz449kxyislpzzxmgn"; + }; + + patchPhase = '' + substituteInPlace "kernel/Makefile" \ + --replace '/lib/modules/$(shell uname -r)/build' \ + ${kernel}/lib/modules/*/build + + # The `proc_root' variable (the root of `/proc') is no longer exported + # since 2.6.26. Fortunately, one can pass `NULL' instead of `&proc_root'. + # See http://lkml.org/lkml/2008/3/30/57 . + substituteInPlace "kernel/exmap.c" \ + --replace "&proc_root" "NULL" + + substituteInPlace "src/Makefile" --replace "-Werror" "" + ''; + + buildInputs = [ kernel pkgconfig gtkmm boost pcre ]; + + buildPhase = "make build"; + + # XXX: The tests can only be run one the `exmap' module is loaded. + doCheck = false; + #checkPhase = "make test" + + installPhase = '' + ensureDir "$out/share/${name}" + cp kernel/*.ko "$out/share/${name}" + + ensureDir "$out/bin" + cp src/{gexmap,exmtool,elftool,showproc} "$out/bin" + ''; + + meta = { + description = "Exmap, a tool showing the physical memory usage of processes"; + + longDescription = '' + Exmap is a utility which takes a snapshot of how the physical + memory and swap space are currently used by all the processes on + your system. It examines which page of memory are shared between + which processes, so that it can share the cost of the pages + fairly when calculating usage totals. + ''; + + homepage = http://www.berthels.co.uk/exmap/; + + license = "GPLv2+"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b427499dadc..bb2885101008 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5229,6 +5229,11 @@ let inherit fetchurl stdenv kernel; }; + exmap = import ../os-specific/linux/exmap { + inherit fetchurl stdenv kernel boost pcre pkgconfig; + inherit (gtkLibs) gtkmm; + }; + iwlwifi = import ../os-specific/linux/iwlwifi { inherit fetchurl stdenv kernel; };