iovisor / iovisor/bcc

error: incomplete definition of type 'struct tracepoint__raw_syscalls__sys_exit'

Open
#3,526 11 comments 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

```
# /usr/share/bcc/tools/syscount
/virtual/main.c:29:1: warning: declaration of 'struct tracepoint__raw_syscalls__sys_exit' will not be visible outside of this function [-Wvisibility]
TRACEPOINT_PROBE(raw_syscalls, sys_exit) {
^
/virtual/include/bcc/helpers.h:1263:46: note: expanded from macro 'TRACEPOINT_PROBE'
int tracepoint__##category##__##event(struct tracepoint__##category##__##event *args)
^
:142:1: note: expanded from here
tracepoint__raw_syscalls__sys_exit
^
/virtual/main.c:50:19: error: incomplete definition of type 'struct tracepoint__raw_syscalls__sys_exit'
u32 key = args->id;
~~~~^
/virtual/main.c:29:1: note: forward declaration of 'struct tracepoint__raw_syscalls__sys_exit'
TRACEPOINT_PROBE(raw_syscalls, sys_exit) {
^
/virtual/include/bcc/helpers.h:1263:46: note: expanded from macro 'TRACEPOINT_PROBE'
int tracepoint__##category##__##event(struct tracepoint__##category##__##event *args)
^
:142:1: note: expanded from here
tracepoint__raw_syscalls__sys_exit
^
1 warning and 1 error generated.
Traceback (most recent call last):
File "/usr/share/bcc/tools/syscount", line 165, in
bpf = BPF(text=text)
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 452, in __init__
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module

# cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_exit/format
name: sys_exit
ID: 21
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;

field:long id; offset:8; size:8; signed:1;
field:long ret; offset:16; size:8; signed:1;

print fmt: "NR %ld = %ld", REC->id, REC->ret
```

Any comment is appreciated, thank you.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with /usr/share/bcc/tools/syscount and the generated BPF source around /virtual/main.c:29 and line 50, then compare it with bcc/helpers.h and the raw_syscalls/sys_exit format shown in the report. Reproduce the compilation failure and identify the compatibility issue causing the tracepoint argument type to remain incomplete. Done means syscount compiles and reads the sys_exit id and ret fields correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, python
Domain
observability-sre, 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.