mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Add ringbuf type hinting.
This commit is contained in:
25
tests/failing_tests/ringbuf.py
Normal file
25
tests/failing_tests/ringbuf.py
Normal file
@ -0,0 +1,25 @@
|
||||
from pythonbpf import bpf, map, bpfglobal, section
|
||||
from pythonbpf.maps import RingBuf
|
||||
from ctypes import c_int32, c_void_p
|
||||
|
||||
|
||||
# Define a map
|
||||
@bpf
|
||||
@map
|
||||
def mymap() -> RingBuf:
|
||||
return RingBuf(max_entries=(1 << 24))
|
||||
|
||||
|
||||
@bpf
|
||||
@section("tracepoint/syscalls/sys_enter_clone")
|
||||
def testing(ctx: c_void_p) -> c_int32:
|
||||
return c_int32(0)
|
||||
|
||||
|
||||
@bpf
|
||||
@bpfglobal
|
||||
def LICENSE() -> str:
|
||||
return "GPL"
|
||||
|
||||
|
||||
compile()
|
||||
Reference in New Issue
Block a user