tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
bcc: fix aarch64 test
Jörg Thalheim
4 years ago
ecb6200c
313619a3
+51
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
bcc
absolute-ausyscall.patch
default.nix
+43
pkgs/os-specific/linux/bcc/absolute-ausyscall.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
From 01e793163231c5085afced37471df32b94a313f5 Mon Sep 17 00:00:00 2001
2
+
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
3
+
Date: Thu, 30 Dec 2021 06:34:41 +0100
4
+
Subject: [PATCH] absolute ausyscall
5
+
MIME-Version: 1.0
6
+
Content-Type: text/plain; charset=UTF-8
7
+
Content-Transfer-Encoding: 8bit
8
+
9
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
10
+
---
11
+
libbpf-tools/syscall_helpers.c | 2 +-
12
+
src/python/bcc/syscall.py | 2 +-
13
+
2 files changed, 2 insertions(+), 2 deletions(-)
14
+
15
+
diff --git a/libbpf-tools/syscall_helpers.c b/libbpf-tools/syscall_helpers.c
16
+
index e114a08f..62adea78 100644
17
+
--- a/libbpf-tools/syscall_helpers.c
18
+
+++ b/libbpf-tools/syscall_helpers.c
19
+
@@ -47,7 +47,7 @@ void init_syscall_names(void)
20
+
int err;
21
+
FILE *f;
22
+
23
+
- f = popen("ausyscall --dump 2>/dev/null", "r");
24
+
+ f = popen("@ausyscall@ --dump 2>/dev/null", "r");
25
+
if (!f) {
26
+
warn("popen: ausyscall --dump: %s\n", strerror(errno));
27
+
return;
28
+
diff --git a/src/python/bcc/syscall.py b/src/python/bcc/syscall.py
29
+
index 1346b4e8..e7e29a11 100644
30
+
--- a/src/python/bcc/syscall.py
31
+
+++ b/src/python/bcc/syscall.py
32
+
@@ -376,7 +376,7 @@ def _parse_syscall(line):
33
+
try:
34
+
# Skip the first line, which is a header. The rest of the lines are simply
35
+
# SYSCALL_NUM\tSYSCALL_NAME pairs.
36
+
- out = subprocess.check_output(['ausyscall', '--dump'], stderr=subprocess.STDOUT)
37
+
+ out = subprocess.check_output(['@ausyscall@', '--dump'], stderr=subprocess.STDOUT)
38
+
# remove the first line of expected output
39
+
out = out.split(b'\n',1)[1]
40
+
syscalls = dict(map(_parse_syscall, out.strip().split(b'\n')))
41
+
--
42
+
2.34.0
43
+
+8
pkgs/os-specific/linux/bcc/default.nix
···
2
, makeWrapper, cmake, llvmPackages
3
, flex, bison, elfutils, python, luajit, netperf, iperf, libelf
4
, bash, libbpf, nixosTests
0
5
}:
6
7
python.pkgs.buildPythonApplication rec {
···
41
"-DCMAKE_USE_LIBBPF_PACKAGE=ON"
42
];
43
0
0
0
0
44
postPatch = ''
45
substituteAll ${./libbcc-path.patch} ./libbcc-path.patch
46
patch -p1 < libbcc-path.patch
0
0
0
47
'';
48
49
postInstall = ''
···
2
, makeWrapper, cmake, llvmPackages
3
, flex, bison, elfutils, python, luajit, netperf, iperf, libelf
4
, bash, libbpf, nixosTests
5
+
, audit
6
}:
7
8
python.pkgs.buildPythonApplication rec {
···
42
"-DCMAKE_USE_LIBBPF_PACKAGE=ON"
43
];
44
45
+
# to replace this executable path:
46
+
# https://github.com/iovisor/bcc/blob/master/src/python/bcc/syscall.py#L384
47
+
ausyscall = "${audit}/bin/ausyscall";
48
+
49
postPatch = ''
50
substituteAll ${./libbcc-path.patch} ./libbcc-path.patch
51
patch -p1 < libbcc-path.patch
52
+
53
+
substituteAll ${./absolute-ausyscall.patch} ./absolute-ausyscall.patch
54
+
patch -p1 < absolute-ausyscall.patch
55
'';
56
57
postInstall = ''