iovisor / iovisor/bcc

Python 3 incompatibilities/niggles

Open
#532 7 comments 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

I noticed a few scripts have issues with Python 3. E.g., funccount doesn't work:

```
$ sudo /usr/share/bcc/tools/funccount vfs_*
Traceback (most recent call last):
File "/usr/share/bcc/tools/funccount", line 93, in
addr = b.ksymname(fn)
File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 664, in ksymname
return BPF._ksym_cache.resolve_name(name)
File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 79, in resolve_name
if lib.bcc_symcache_resolve_name(self.cache, name, ct.pointer(addr)) < 0:
ctypes.ArgumentError: argument 2: : wrong type
```

and biosnoop (and others) print char strings as bytes:

```
$ sudo /usr/share/bcc/tools/biosnoop
TIME(s) COMM PID DISK T SECTOR BYTES LAT(ms)
0.000000000 b'jbd2/sda1-8' 173 b'sda' W 4598320 602112 1.38
0.001985000 b'jbd2/sda1-8' 173 b'sda' W 4599496 4096 0.11
0.302378000 b'?' 0 b'' R -1 8 0.23
```

This is not an exhaustive list — we just need to go through them all and fix any issues.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.