mirror of https://github.com/aya-rs/aya
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
466 B
C
20 lines
466 B
C
#include <vmlinux.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
struct
|
|
{
|
|
__uint(type, BPF_MAP_TYPE_RINGBUF);
|
|
__uint(max_entries, 256 * 1024 /* 256 KB */);
|
|
} rb SEC(".maps");
|
|
|
|
// This probe writes a zero to rb every time the sched_switch tracepoint is hit.
|
|
SEC("tracepoint/sched/sched_switch")
|
|
int sched_switch(struct switch_args* ctx)
|
|
{
|
|
unsigned long long e = 0;
|
|
bpf_ringbuf_output(&rb, &e, sizeof(e), 0);
|
|
return 0;
|
|
}
|