mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Define arch in C example
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
#define __TARGET_ARCH_arm64
|
||||||
|
|
||||||
#include "vmlinux.h"
|
#include "vmlinux.h"
|
||||||
#include <bpf/bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
#include <bpf/bpf_tracing.h>
|
#include <bpf/bpf_tracing.h>
|
||||||
@ -20,13 +22,4 @@ int BPF_KPROBE(trace_start, struct request *req)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optionally, attach also to blk_mq_start_request
|
|
||||||
SEC("kprobe/blk_mq_start_request")
|
|
||||||
int BPF_KPROBE(trace_start_mq, struct request *req)
|
|
||||||
{
|
|
||||||
u64 ts = bpf_ktime_get_ns();
|
|
||||||
bpf_map_update_elem(&start, &req, &ts, BPF_ANY);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
char LICENSE[] SEC("license") = "GPL";
|
char LICENSE[] SEC("license") = "GPL";
|
||||||
|
|||||||
Reference in New Issue
Block a user