Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gadgets: Fix timestamp handling in old kernels #2290

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

mauriciovasquezbernal
Copy link
Member

Also use FixBpfKtimeGetBootNs() in the run command to fix eBPF programs before loading them.

Test

Use a kernel that doesn't have BPF_FUNC_ktime_get_boot_ns: < 5.8 torvalds/linux@71d1921

Before

$ sudo -E ./ig run ghcr.io/inspektor-gadget/gadget/trace_exec:latest
INFO[0000] Experimental features enabled                
RUNTIME.CONTAINERNAME                       PID                     PPID                   COMM             UID                    GID                    RET…
Error: running gadget: running gadget: install tracer: loading eBPF objects: create BPF collection: program ig_execve_e: load program: invalid argument: invalid func unknown#125 (110 line(s) omitted)

After

$ sudo -E ./ig run ghcr.io/inspektor-gadget/gadget/trace_exec:latest
INFO[0000] Experimental features enabled                
RUNTIME.CONTAINERNAME                       PID                     PPID                   COMM             UID                    GID                    RET…

Copy link
Member

@burak-ok burak-ok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the only commit you want to merge is the last one. LGTM

Base automatically changed from francis/ringbuf to main December 14, 2023 11:45
Also use FixBpfKtimeGetBootNs() in the run command to fix eBPF programs
before loading them.

Signed-off-by: Mauricio Vásquez <mauriciov@microsoft.com>
@mauriciovasquezbernal mauriciovasquezbernal merged commit 13912fd into main Dec 14, 2023
48 of 50 checks passed
@mauriciovasquezbernal mauriciovasquezbernal deleted the mauricio/fix-timestmap-old-kernels branch December 14, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants