From ff704a010208b6f0c2282ba7f5885a7c5cd2aca3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 7 Jun 2008 14:02:17 +0000 Subject: Add Sysprof, a system-wide profiler for Linux. svn path=/nixpkgs/trunk/; revision=12008 --- .../tools/profiling/sysprof/configure.patch | 17 ++++++++ .../tools/profiling/sysprof/default.nix | 47 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/tools/profiling/sysprof/configure.patch create mode 100644 pkgs/development/tools/profiling/sysprof/default.nix (limited to 'pkgs/development/tools/profiling') diff --git a/pkgs/development/tools/profiling/sysprof/configure.patch b/pkgs/development/tools/profiling/sysprof/configure.patch new file mode 100644 index 000000000000..212840ee4064 --- /dev/null +++ b/pkgs/development/tools/profiling/sysprof/configure.patch @@ -0,0 +1,17 @@ +--- sysprof-1.0.10/configure 2008-04-28 01:41:25.000000000 +0200 ++++ sysprof-1.0.10/configure 2008-06-07 15:40:07.000000000 +0200 +@@ -3342,14 +3342,6 @@ if test $kernel_module = "yes"; then + echo \* + exit 1 + fi +- +- if ! test -f /lib/modules/`uname -r`/build/Makefile ; then +- echo \* +- echo \* Sysprof requires the kernel source code to be installed. +- echo \* On a Fedora Core system the relevant package is kernel-devel +- echo \* +- exit 1 +- fi + fi + + # Pkgconfig dependencies diff --git a/pkgs/development/tools/profiling/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix new file mode 100644 index 000000000000..397a6033d626 --- /dev/null +++ b/pkgs/development/tools/profiling/sysprof/default.nix @@ -0,0 +1,47 @@ +{ fetchurl, stdenv, kernel, binutils +, pkgconfig, gtk, glib, pango, libglade }: + +stdenv.mkDerivation rec { + name = "sysprof-1.0.10"; + + src = fetchurl { + url = "http://www.daimi.au.dk/~sandmann/sysprof/${name}.tar.gz"; + sha256 = "1cdjnymd9nz72vcw6j0bbhb2ka19rjqd3scgx810a4m3qcai7irs"; + }; + + buildInputs = [ binutils pkgconfig gtk glib pango libglade ]; + + patches = [ ./configure.patch ]; + + preConfigure = '' + kernelVersion=$(cd "${kernel}/lib/modules" && echo *) + echo "assuming Linux kernel version \`$kernelVersion'" + + sed -i "module/Makefile" \ + -e"s|^[[:blank:]]*KDIR[[:blank:]]*:=.*$|KDIR := ${kernel}/lib/modules/$kernelVersion/build|g ; + s|\$(KMAKE) modules_install|install sysprof-module.ko $out/share/sysprof/module|g ; + s|\\[ -e /sbin/depmod.*$|true|g" + + # XXX: We won't run `depmod' after installing the module. + ''; + + configureFlags = "--enable-kernel-module"; + + preInstall = '' + mkdir -p "$out/share/sysprof/module" + ''; + + meta = { + homepage = http://www.daimi.au.dk/~sandmann/sysprof/; + description = "Sysprof, a system-wide profiler for Linux"; + license = "GPLv2+"; + + longDescription = '' + Sysprof is a sampling CPU profiler for Linux that uses a kernel + module to profile the entire system, not just a single + application. Sysprof handles shared libraries and applications + do not need to be recompiled. In fact they don't even have to + be restarted. + ''; + }; +} \ No newline at end of file -- cgit 1.4.1