git.iko.soy/typeable/nixpkgs
on master help sign in
linuxPackages.bcc: 0.8.0 -> 0.9.0

Requires a minor tweak to the deadlock detector patch (the file was renamed in the upstream repo). bcc now also wants a copy of libbpf, which it doesn't have in the source release tarball. Clone a copy from GiHub that's synchronized with the release, and put it in place. Tested on Linux 5.1 (with bpftrace as well). Signed-off-by: Austin Seipp <aseipp@pobox.com>

commit0a4cd28f84ed85eec38b0fc53f2b2079a13da2f2 authorAustin Seipp <aseipp@pobox.com> dateMon 6 May 2019, 01:12 (8 years ago) parent181e971
2 files changed+33−17
pkgs/os-specific/linux/bcc/default.nix+31−15 pkgs/os-specific/linux/bcc/fix-deadlock-detector-import.patch+2−2
pkgs/os-specific/linux/bcc/default.nix+31−15
@@ -4,20 +4,33 @@
44}:
55
66python.pkgs.buildPythonApplication rec {
7− version = "0.8.0";
7+ version = "0.9.0";
88 name = "bcc-${version}";
99
10− src = fetchFromGitHub {
11− owner = "iovisor";
12− repo = "bcc";
13− rev = "v${version}";
14− sha256 = "15vvybllmh9hdj801v3psd671c0qq2a1xdv73kabb9r4fzgaknxk";
15− };
10+ srcs = [
11+ (fetchFromGitHub {
12+ owner = "iovisor";
13+ repo = "bcc";
14+ rev = "v${version}";
15+ sha256 = "0gi12bsjaw1d77rx11wkdg4szcydwy55z6mkx558nfvdym0qj7yw";
16+ name = "bcc";
17+ })
1618
19+ # note: keep this in sync with the version that was used at the time of the
20+ # tagged release!
21+ (fetchFromGitHub {
22+ owner = "libbpf";
23+ repo = "libbpf";
24+ rev = "5beb8a2ebffd1045e3edb9b522d6ff5bb477c541";
25+ sha256 = "19n6baqj0mbaphzxkpn09m5a7cbij7fxap8ckk488nxqdz7nbsal";
26+ name = "libbpf";
27+ })
28+ ];
29+ sourceRoot = "bcc";
1730 format = "other";
1831
19− buildInputs = [
20− llvmPackages.llvm llvmPackages.clang-unwrapped kernel
32+ buildInputs = with llvmPackages; [
33+ llvm clang-unwrapped kernel
2134 elfutils luajit netperf iperf
2235 systemtap.stapBuild flex
2336 ];
@@ -28,6 +41,7 @@ python.pkgs.buildPythonApplication rec {
2841 ./fix-deadlock-detector-import.patch
2942 ];
3043
44+ propagatedBuildInputs = [ python.pkgs.netaddr ];
3145 nativeBuildInputs = [ makeWrapper cmake flex bison ]
3246 # libelf is incompatible with elfutils-libelf
3347 ++ stdenv.lib.filter (x: x != libelf) kernel.moduleBuildDependencies;
@@ -44,9 +58,11 @@ python.pkgs.buildPythonApplication rec {
4458 patch -p1 < libbcc-path.patch
4559 '';
4660
47− propagatedBuildInputs = [
48− python.pkgs.netaddr
49− ];
61+ preConfigure = ''
62+ chmod -R u+w ../libbpf/
63+ rmdir src/cc/libbpf
64+ (cd src/cc && ln -svf ../../../libbpf/ libbpf)
65+ '';
5066
5167 postInstall = ''
5268 mkdir -p $out/bin $out/share
@@ -71,8 +87,8 @@ python.pkgs.buildPythonApplication rec {
7187
7288 meta = with stdenv.lib; {
7389 description = "Dynamic Tracing Tools for Linux";
74− homepage = https://iovisor.github.io/bcc/;
75− license = licenses.asl20;
76− maintainers = with maintainers; [ ragge mic92 ];
90+ homepage = https://iovisor.github.io/bcc/;
91+ license = licenses.asl20;
92+ maintainers = with maintainers; [ ragge mic92 thoughtpolice ];
7793 };
7894}
pkgs/os-specific/linux/bcc/fix-deadlock-detector-import.patch+2−2
@@ -1,5 +1,5 @@
1−--- source.org/tools/deadlock_detector.py 1980-01-02 00:00:00.000000000 +0000
2−+++ source/tools/deadlock_detector.py 2018-05-29 13:57:11.807126673 +0100
1+--- source.org/tools/deadlock.py 1980-01-02 00:00:00.000000000 +0000
2++++ source/tools/deadlock.py 2018-05-29 13:57:11.807126673 +0100
33@@ -44,9 +44,8 @@
44 #
55 # 01-Feb-2017 Kenny Yu Created this.