mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 18:08:36 +00:00
These three declared @section("sometag1"), which is not a section name libbpf
can map to a program type:
libbpf: failed to guess program type from ELF section 'sometag1'
so they were rejected before the kernel verifier ever saw them. They generate
IR and compile fine; only the section was wrong. Switch to
tracepoint/syscalls/sys_enter_execve, matching the other tracepoint tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
18 lines
282 B
Python
18 lines
282 B
Python
from pythonbpf import compile, bpf, section, bpfglobal
|
|
from ctypes import c_void_p, c_int64
|
|
|
|
|
|
@bpf
|
|
@section("tracepoint/syscalls/sys_enter_execve")
|
|
def sometag(ctx: c_void_p) -> c_int64:
|
|
return c_int64(1 - 1)
|
|
|
|
|
|
@bpf
|
|
@bpfglobal
|
|
def LICENSE() -> str:
|
|
return "GPL"
|
|
|
|
|
|
compile()
|