diff --git a/pythonbpf/type_deducer.py b/pythonbpf/type_deducer.py index a6834a9..74abc0d 100644 --- a/pythonbpf/type_deducer.py +++ b/pythonbpf/type_deducer.py @@ -16,6 +16,7 @@ mapping = { "c_long": ir.IntType(64), "c_ulong": ir.IntType(64), "c_longlong": ir.IntType(64), + "c_uint": ir.IntType(32), # Not so sure about this one "str": ir.PointerType(ir.IntType(8)), } diff --git a/tests/c-form/requests2.bpf.c b/tests/c-form/requests2.bpf.c new file mode 100644 index 0000000..c0cbf9f --- /dev/null +++ b/tests/c-form/requests2.bpf.c @@ -0,0 +1,18 @@ +#include "vmlinux.h" +#include +#include +#include + +char LICENSE[] SEC("license") = "GPL"; + +SEC("kprobe/blk_mq_start_request") +int example(struct pt_regs *ctx) +{ + u64 a = ctx->r15; + struct request *req = (struct request *)(ctx->di); + unsigned int something_ns = req->timeout; + unsigned int data_len = req->__data_len; + bpf_printk("data length %lld %ld %ld\n", data_len, something_ns, a); + + return 0; +}