AttributeError: 'PerfEventArray' object has no attribute 'event' Error
juntaran@ubuntu:~/workspace/kernel/bcc/tools$ sudo ./execsnoop.py
PCOMM PID PPID RET ARGS
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "/usr/lib/python2.7/dist-packages/bcc/table.py", line 572, in raw_cb_
callback(cpu, data, size)
File "./execsnoop.py", line 198, in print_event
event = b["events"].event(data)
AttributeError: 'PerfEventArray' object has no attribute 'event'
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "/usr/lib/python2.7/dist-packages/bcc/table.py", line 572, in raw_cb_
callback(cpu, data, size)
File "./execsnoop.py", line 198, in print_event
event = b["events"].event(data)
AttributeError: 'PerfEventArray' object has no attribute 'event'
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "/usr/lib/python2.7/dist-packages/bcc/table.py", line 572, in raw_cb_
callback(cpu, data, size)
File "./execsnoop.py", line 198, in print_event
event = b["events"].event(data)
AttributeError: 'PerfEventArray' object has no attribute 'event'
sudo ./execsnoop.py except execsnoop and some other python script have same error
How i fix:
git reset --hard 75a1f3d051138dbc00a67d17ddad938c83f13f00
in commit 51d62d36bd072530a238ac147a61b631fdc44659
commit 51d62d36bd072530a238ac147a61b631fdc44659
Author: Xiaozhou Liu <[email protected]>
Date: Fri Feb 15 13:03:05 2019 +0800
tools: remove redundant Python event data structure definitions (#2204)
Simplify code following #2198 (https://github.com/iovisor/bcc/pull/2198).
Some tools are not touched: mountsnoop.py, trace.py, lib/*.py, old/*.py.
maybe 51d62d36bd072530a238ac147a61b631fdc44659 this commit caused it
@boat0
I guess your versions of installed libbcc and tools do not match.
I guess your versions of installed libbcc and tools do not match.
they are same version
@Juntaran So you installed bcc from sources? If you installed bcc from packages and are running execsnoop.py from this repository, then they probably don't have the same version. Install bcc from sources or run the execsnoop executable provided with the package.
I see the problem: the libbcc installed is 0.6 while the tools you are actually using is 0.8+. Most likely you ran the tools from a git repo which is recently updated.
@Juntaran So you installed bcc from sources? If you installed bcc from packages and are running
execsnoop.pyfrom this repository, then they probably don't have the same version. Install bcc from sources or run theexecsnoopexecutable provided with the package.
Hi
thanks for the reply, i use Ubuntu 18.10 and install as https://github.com/iovisor/bcc/blob/master/INSTALL.md
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
I'll try install from source thank you again
@Juntaran So you installed bcc from sources? If you installed bcc from packages and are running
execsnoop.pyfrom this repository, then they probably don't have the same version. Install bcc from sources or run theexecsnoopexecutable provided with the package.Hi thanks for the reply, i use Ubuntu 18.10 and install as https://github.com/iovisor/bcc/blob/master/INSTALL.md
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)I'll try install from source thank you again
after install from source, the world is peace and everything is ok : ) 👍