cpudist on i586: error: no member named 'ds' in 'pt_regs'
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
`cpudist` run fails on i586 (linux 5.10.10 in qemu-system-i386 v5.2.0):
```
builder@i586:~/RPM/BUILD/bcc-0.18.0# /usr/src/tmp/bcc-buildroot/usr/share/bcc/tools/cpudist 1 1
In file included from /virtual/main.c:1:
In file included from include/uapi/linux/ptrace.h:143:
arch/x86/include/asm/ptrace.h:240:16: error: no member named 'ds' in 'pt_regs'
offset == offsetof(struct pt_regs, ds) ||
^ ~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~~~
include/linux/compiler_types.h:135:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
In file included from /virtual/main.c:1:
In file included from include/uapi/linux/ptrace.h:143:
arch/x86/include/asm/ptrace.h:241:16: error: no member named 'es' in 'pt_regs'
offset == offsetof(struct pt_regs, es) ||
^ ~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~~~
include/linux/compiler_types.h:135:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
In file included from /virtual/main.c:1:
In file included from include/uapi/linux/ptrace.h:143:
arch/x86/include/asm/ptrace.h:242:16: error: no member named 'fs' in 'pt_regs'
offset == offsetof(struct pt_regs, fs) ||
^ ~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~~~
include/linux/compiler_types.h:135:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
In file included from /virtual/main.c:1:
In file included from include/uapi/linux/ptrace.h:143:
arch/x86/include/asm/ptrace.h:243:16: error: no member named 'gs' in 'pt_regs'
offset == offsetof(struct pt_regs, gs)) {
^ ~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~~~
include/linux/compiler_types.h:135:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
4 errors generated.
Traceback (most recent call last):
File "/usr/src/tmp/bcc-buildroot/usr/share/bcc/tools/cpudist", line 161, in
b = BPF(text=bpf_text, cflags=["-DMAX_PID=%d" % max_pid])
File "/usr/src/tmp/bcc-buildroot/usr/lib/python3/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
```
Same run succeeds on x86_64.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce cpudist in the reported i586 environment under qemu-system-i386, then inspect its BPF compilation path and the Linux x86 pt_regs definitions involved in the reported include errors. Done means cpudist compiles and runs on i586 while continuing to work on x86_64.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, python
- Domain
- observability-sre, operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100