iovisor / iovisor/bcc

Error running samples

Open
#3,329 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Below is the output.

sudo /usr/share/bcc/tools/execsnoop
In file included from :2:
/virtual/include/bcc/bpf.h:67:2: error: unknown type name '__u8'
__u8 code; /* opcode */
^
/virtual/include/bcc/bpf.h:68:2: error: unknown type name '__u8'
__u8 dst_reg:4; /* dest register */
^
/virtual/include/bcc/bpf.h:69:2: error: unknown type name '__u8'
__u8 src_reg:4; /* source register */
^
/virtual/include/bcc/bpf.h:70:2: error: unknown type name '__s16'
__s16 off; /* signed offset */
^
/virtual/include/bcc/bpf.h:71:2: error: unknown type name '__s32'
__s32 imm; /* signed immediate constant */
^
/virtual/include/bcc/bpf.h:76:2: error: unknown type name '__u32'
__u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */
^
/virtual/include/bcc/bpf.h:77:2: error: unknown type name '__u8'
__u8 data[0]; /* Arbitrary size */
^
/virtual/include/bcc/bpf.h:81:2: error: unknown type name '__u64'
__u64 cgroup_inode_id; /* cgroup inode id */
^
/virtual/include/bcc/bpf.h:82:2: error: unknown type name '__u32'
__u32 attach_type; /* program attach type */
^
/virtual/include/bcc/bpf.h:87:3: error: unknown type name '__u32'
__u32 map_fd;
^
/virtual/include/bcc/bpf.h:435:2: error: unknown type name '__s32'
__s32 status;
^
/virtual/include/bcc/bpf.h:438:3: error: unknown type name '__u64'
__u64 offset;
^
/virtual/include/bcc/bpf.h:439:3: error: unknown type name '__u64'
__u64 ip;
^
/virtual/include/bcc/bpf.h:447:3: error: unknown type name '__u32'
__u32 map_type; /* one of enum bpf_map_type */
^
/virtual/include/bcc/bpf.h:448:3: error: unknown type name '__u32'
__u32 key_size; /* size of key in bytes */
^
/virtual/include/bcc/bpf.h:449:3: error: unknown type name '__u32'
__u32 value_size; /* size of value in bytes */
^
/virtual/include/bcc/bpf.h:450:3: error: unknown type name '__u32'
__u32 max_entries; /* max number of entries in a map */
^
/virtual/include/bcc/bpf.h:451:3: error: unknown type name '__u32'
__u32 map_flags; /* BPF_MAP_CREATE related
^
/virtual/include/bcc/bpf.h:454:3: error: unknown type name '__u32'
__u32 inner_map_fd; /* fd pointing to the inner map */
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Traceback (most recent call last):
File "/usr/share/bcc/tools/execsnoop", line 227, in
b = BPF(text=bpf_text)
File "/usr/lib/python2.7/site-packages/bcc/__init__.py", line 364, in __init__
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing sudo /usr/share/bcc/tools/execsnoop and inspect the traceback in /usr/lib/python2.7/site-packages/bcc/__init__.py. Then examine the reported declarations in /virtual/include/bcc/bpf.h and gather the system and kernel details needed to understand why the integer types are unavailable. Done means execsnoop compiles and runs without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.