diff options
author | Ludovic Courtès <ludo@gnu.org> | 2008-06-04 21:23:30 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-06-04 21:23:30 +0000 |
commit | e24afc19adf7d0888941ff25625f68bc971271ad (patch) | |
tree | 2a86fc289b967c5a0f73f719185e6a61087702f1 /pkgs/development/tools/profiling | |
parent | 12ca68d11447fc5e9d3163caf822b6e98b3a65af (diff) | |
download | nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.tar nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.tar.gz nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.tar.bz2 nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.tar.lz nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.tar.xz nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.tar.zst nixlib-e24afc19adf7d0888941ff25625f68bc971271ad.zip |
Add OProfile, a system-wide profiler for Linux.
svn path=/nixpkgs/trunk/; revision=11984
Diffstat (limited to 'pkgs/development/tools/profiling')
-rw-r--r-- | pkgs/development/tools/profiling/oprofile/default.nix | 41 | ||||
-rw-r--r-- | pkgs/development/tools/profiling/oprofile/opcontrol.patch | 16 |
2 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/development/tools/profiling/oprofile/default.nix b/pkgs/development/tools/profiling/oprofile/default.nix new file mode 100644 index 000000000000..ca44470598ff --- /dev/null +++ b/pkgs/development/tools/profiling/oprofile/default.nix @@ -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/; + }; +} \ No newline at end of file diff --git a/pkgs/development/tools/profiling/oprofile/opcontrol.patch b/pkgs/development/tools/profiling/oprofile/opcontrol.patch new file mode 100644 index 000000000000..fa072c738ffe --- /dev/null +++ b/pkgs/development/tools/profiling/oprofile/opcontrol.patch @@ -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 $@ |