nixpkgs/pkgs/development/tools/profiling/oprofile/default.nix

57 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, binutils, popt, makeWrapper, gawk, which, gnugrep, zlib
, pkgconfig
, withGUI ? false , qt4 ? null}:
# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
assert withGUI -> qt4 != null;
stdenv.mkDerivation rec {
2013-12-14 16:28:33 +01:00
name = "oprofile-0.9.9";
src = fetchurl {
url = "mirror://sourceforge/oprofile/${name}.tar.gz";
2013-12-14 16:28:33 +01:00
sha256 = "15vm24jhw4xfd55pfw1rlpzfsh4bl1vyjsajs78bi9xbv8038lhy";
};
patchPhase = ''
sed -i "utils/opcontrol" \
-e "s|OPCONTROL=.*$|OPCONTROL=\"$out/bin/opcontrol\"|g ;
s|OPDIR=.*$|OPDIR=\"$out/bin\"|g ;
s|^PATH=.*$||g"
'';
buildInputs = [ binutils zlib popt makeWrapper gawk which gnugrep pkgconfig ]
++ stdenv.lib.optionals withGUI [ qt4 ];
2013-02-23 23:49:48 +01:00
configureFlags = [
"--disable-shared" # needed because only the static libbfd is available
]
++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";
postInstall = ''
wrapProgram "$out/bin/opcontrol" \
--prefix PATH : "$out/bin:${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/;
platforms = stdenv.lib.platforms.linux;
2013-08-16 23:44:33 +02:00
maintainers = [ ];
};
}