systemtap: clean up as per feedback
- shorter description - move systemtap into linuxPackages this is only necessary for the wrapper systemtap also has a dyninsn backend to instrument userspace apps we could experiment with other platforms, using this - get rid of stow build dependency - update version - minor cleanup steps
This commit is contained in:
parent
b019424e5d
commit
59ccacbcd3
|
@ -1,16 +1,17 @@
|
||||||
{ fetchurl, linuxPackages, makeWrapper, runCommand, fetchgit
|
{ fetchgit, pkgconfig, gettext, runCommand, makeWrapper
|
||||||
, elfutils, pkgconfig, gettext, stow, gnumake }:
|
, elfutils, kernel, gnumake }:
|
||||||
let
|
let
|
||||||
## fetchgit info
|
## fetchgit info
|
||||||
url = git://sourceware.org/git/systemtap.git;
|
url = git://sourceware.org/git/systemtap.git;
|
||||||
rev = "51b7cae3023adf137081059c7cc44a13f652ba4c";
|
rev = "a10bdceb7c9a7dc52c759288dd2e555afcc5184a";
|
||||||
sha256 = "18m3lf11r99f4yr1m172548lghc0i22zqbys1fwlwakbczz0a2lz";
|
sha256 = "1kllzfnh4ksis0673rma5psglahl6rvy0xs5v05qkqn6kl7irmg1";
|
||||||
|
version = "2016-09-16";
|
||||||
|
|
||||||
inherit (linuxPackages) kernel;
|
inherit (kernel) stdenv;
|
||||||
version = kernel.stdenv.lib.substring 0 6 rev;
|
inherit (stdenv) lib;
|
||||||
|
|
||||||
## stap binaries
|
## stap binaries
|
||||||
stapBuild = kernel.stdenv.mkDerivation {
|
stapBuild = stdenv.mkDerivation {
|
||||||
name = "systemtap-${version}";
|
name = "systemtap-${version}";
|
||||||
src = fetchgit { inherit url rev sha256; };
|
src = fetchgit { inherit url rev sha256; };
|
||||||
buildInputs = [ elfutils pkgconfig gettext ];
|
buildInputs = [ elfutils pkgconfig gettext ];
|
||||||
|
@ -18,39 +19,34 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
## a kernel build dir as expected by systemtap
|
## a kernel build dir as expected by systemtap
|
||||||
kernelBuildDir = runCommand "kbuild-${kernel.version}-merged" {
|
kernelBuildDir = runCommand "kbuild-${kernel.version}-merged" { } ''
|
||||||
buildInputs = [ stow ];
|
|
||||||
} ''
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
stowFrom () {
|
for f in \
|
||||||
D="$(dirname $1)"
|
${kernel}/System.map \
|
||||||
P="$(basename $1)"
|
${kernel.dev}/vmlinux \
|
||||||
shift
|
${kernel.dev}/lib/modules/${kernel.modDirVersion}/build/{*,.*}
|
||||||
stow -d $D -t $out -v "$@" -S $P
|
do
|
||||||
}
|
ln -s $(readlink -f $f) $out
|
||||||
stowFrom ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build --ignore=source
|
done
|
||||||
ln -s ${kernel.dev}/vmlinux $out/vmlinux
|
|
||||||
ln -s ${kernel}/System.map $out/System.map
|
|
||||||
ln -s ${kernel.dev}/lib/modules/${kernel.modDirVersion}/source $out/source
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in runCommand "systemtap-${kernel.version}-${version}" {
|
in runCommand "systemtap-${kernel.version}-${version}" {
|
||||||
inherit stapBuild kernelBuildDir;
|
inherit stapBuild kernelBuildDir;
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = [ makeWrapper ];
|
||||||
meta = with kernel.stdenv.lib; {
|
meta = {
|
||||||
homepage = https://sourceware.org/systemtap/;
|
homepage = https://sourceware.org/systemtap/;
|
||||||
repositories.git = git://sourceware.org/git/systemtap.git;
|
repositories.git = url;
|
||||||
description = "SystemTap provides a simple command line interface and scripting language for writing instrumentation for a live running kernel plus user-space applications.";
|
description = "Provides a scripting language for instrumentation on a live kernel plus user-space";
|
||||||
license = licenses.gpl2;
|
license = lib.licenses.gpl2;
|
||||||
platforms = platforms.linux;
|
platforms = lib.platforms.linux;
|
||||||
};
|
};
|
||||||
} ''
|
} ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
for bin in $stapBuild/bin/*; do # hello emacs */
|
for bin in $stapBuild/bin/*; do # hello emacs */
|
||||||
ln -s $bin $out/bin/$(basename $bin)
|
ln -s $bin $out/bin
|
||||||
done
|
done
|
||||||
rm $out/bin/stap
|
rm $out/bin/stap
|
||||||
makeWrapper $stapBuild/bin/stap $out/bin/stap \
|
makeWrapper $stapBuild/bin/stap $out/bin/stap \
|
||||||
--add-flags "-r $kernelBuildDir" \
|
--add-flags "-r $kernelBuildDir" \
|
||||||
--prefix PATH : ${kernel.stdenv.cc.cc}/bin:${elfutils}/bin:${gnumake}/bin
|
--prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc elfutils gnumake ]}
|
||||||
''
|
''
|
||||||
|
|
|
@ -11397,6 +11397,8 @@ in
|
||||||
|
|
||||||
sysdig = callPackage ../os-specific/linux/sysdig {};
|
sysdig = callPackage ../os-specific/linux/sysdig {};
|
||||||
|
|
||||||
|
systemtap = callPackage ../development/tools/profiling/systemtap { };
|
||||||
|
|
||||||
tp_smapi = callPackage ../os-specific/linux/tp_smapi { };
|
tp_smapi = callPackage ../os-specific/linux/tp_smapi { };
|
||||||
|
|
||||||
v86d = callPackage ../os-specific/linux/v86d { };
|
v86d = callPackage ../os-specific/linux/v86d { };
|
||||||
|
@ -14963,8 +14965,6 @@ in
|
||||||
# linux only by now
|
# linux only by now
|
||||||
synergy = callPackage ../applications/misc/synergy { };
|
synergy = callPackage ../applications/misc/synergy { };
|
||||||
|
|
||||||
systemtap = callPackage ../development/tools/profiling/systemtap { };
|
|
||||||
|
|
||||||
tabbed = callPackage ../applications/window-managers/tabbed {
|
tabbed = callPackage ../applications/window-managers/tabbed {
|
||||||
# if you prefer a custom config, write the config.h in tabbed.config.h
|
# if you prefer a custom config, write the config.h in tabbed.config.h
|
||||||
# and enable
|
# and enable
|
||||||
|
|
Loading…
Reference in a new issue