Skip to content

Commit

Permalink
fix a bug related to syscall.py (iovisor#2217)
Browse files Browse the repository at this point in the history
Commit 218f748 refactored syscall number=>name
mapping into a separate file src/python/bcc/syscall.py.
The commit added a reference in python __init__.py,
and this will cause virtually all non x64 arch python
tools failure.

Commit bc0d472 attempted to fix the issue by
removing the failure in syscall.py but this is not
the correct fix for arm64 as the syscall numbers
won't match.

Removing the syscall.py reference in __init__.py
should be enough to restore the previous
working behavior.

Fixes: bc0d472 ("Fix BCC on arm64 by allowing missing ausyscall")
Fixes: 218f748 ("Wcohen/efficiency (iovisor#2063)")
Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
yonghong-song committed Feb 18, 2019
1 parent b26e26b commit cd9334c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/python/bcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from .libbcc import lib, bcc_symbol, bcc_symbol_option, bcc_stacktrace_build_id, _SYM_CB_TYPE
from .table import Table, PerfEventArray
from .perf import Perf
from .syscall import syscall_name
from .utils import get_online_cpus, printb, _assert_is_bytes, ArgString
from .version import __version__

Expand Down
5 changes: 4 additions & 1 deletion src/python/bcc/syscall.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ def _parse_syscall(line):
out = out.split(b'\n',1)[1]
syscalls = dict(map(_parse_syscall, out.strip().split(b'\n')))
except Exception as e:
pass
if platform.machine() == "x86_64":
pass
else:
raise Exception("ausyscall: command not found")

def syscall_name(syscall_num):
"""Return the syscall name for the particular syscall number."""
Expand Down
3 changes: 2 additions & 1 deletion tools/lib/ucalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from __future__ import print_function
import argparse
from time import sleep
from bcc import BPF, USDT, utils, syscall_name
from bcc import BPF, USDT, utils
from bcc.syscall import syscall_name

languages = ["java", "perl", "php", "python", "ruby", "tcl"]

Expand Down

0 comments on commit cd9334c

Please sign in to comment.