mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
change c-file test structure
This commit is contained in:
15
tests/c-form/requests.bpf.c
Normal file
15
tests/c-form/requests.bpf.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include "vmlinux.h"
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
|
||||
char LICENSE[] SEC("license") = "GPL";
|
||||
|
||||
SEC("kprobe/blk_mq_start_request")
|
||||
int example(struct pt_regs *ctx)
|
||||
{
|
||||
struct request *req = (struct request *)(ctx->di);
|
||||
u32 data_len = req->__data_len;
|
||||
bpf_printk("data length %u\n", data_len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user