Add OProfile, a system-wide profiler for Linux.

svn path=/nixpkgs/trunk/; revision=11984
This commit is contained in:
Ludovic Courtès 2008-06-04 21:23:30 +00:00
parent 12ca68d114
commit e24afc19ad
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,41 @@
{ stdenv, fetchurl, binutils, popt
, makeWrapper, gawk, which, gnugrep }:
stdenv.mkDerivation rec {
name = "oprofile-0.9.3";
src = fetchurl {
url = "mirror://sourceforge/oprofile/${name}.tar.gz";
sha256 = "1jxj8h11rwaviy5dz2ra7q41qfgdl1psc4470327pk5bblbap1jg";
};
patches = [ ./opcontrol.patch ];
# FIXME: Add optional Qt support.
buildInputs = [ binutils popt makeWrapper gawk which gnugrep ];
configureFlags = "--with-kernel-support";
postInstall = ''
wrapProgram "$out/bin/opcontrol" \
--prefix PATH : "${gawk}/bin:${which}/bin:${gnugrep}/bin"
'';
meta = {
description = "Oprofile, a system-wide profiler for Linux";
longDescription = ''
OProfile is a system-wide profiler for Linux systems, capable of
profiling all running code at low overhead. It consists of a
kernel driver and a daemon for collecting sample data, and
several post-profiling tools for turning data into information.
OProfile leverages the hardware performance counters of the CPU
to enable profiling of a wide variety of interesting statistics,
which can also be used for basic time-spent profiling. All code
is profiled: hardware and software interrupt handlers, kernel
modules, the kernel, shared libraries, and applications.
'';
license = "GPLv2";
homepage = http://oprofile.sourceforge.net/;
};
}

View File

@ -0,0 +1,16 @@
--- oprofile-0.9.3/utils/opcontrol 2007-07-16 20:22:17.000000000 +0200
+++ oprofile-0.9.3/utils/opcontrol 2008-06-04 23:05:20.000000000 +0200
@@ -1647,12 +1647,10 @@ check_version()
# determine the location of opcontrol and related programs
if test -z "$OPDIR"; then
- BINDIR="/usr/bin"
- OPCONTROL=`$BINDIR/which $0`
- OPDIR=`$BINDIR/dirname $OPCONTROL`
+ OPCONTROL=`which $0`
+ OPDIR=`dirname $OPCONTROL`
fi
-PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
check_options_early $@

View File

@ -2183,6 +2183,11 @@ let pkgs = rec {
inherit fetchurl stdenv;
};
oprofile = import ../development/tools/profiling/oprofile {
inherit fetchurl stdenv binutils popt;
inherit makeWrapper gawk which gnugrep;
};
patchelf = useFromStdenv "patchelf"
(import ../development/tools/misc/patchelf {
inherit fetchurl stdenv;