Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12241

How I can include the /kernel/sched/* into a BPF program?

$
0
0

I am trying to make a custom bpf program with bpftrace in Linux, according to the book BPF Performance Tools. I tried to include some files from the path linux/kernel/sched/sched.h. How can I include them? (not only the /include folder but also from the linux/kernel/* folder in Linux?)

I'm trying to incorporate #include /kernel/sched/sched.h in order to use "struct rq".

The example of my program is:

#!/usr/local/bin/bpftrace#include <kernel/sched/sched.h>kprobe:load_balance{     $rq = (struct rq *)arg1;     printf("-------------------\n");     printf("\n");     printf("load_balance: %s pid: %d\n", comm, pid);     printf("-------------------\n");}

Viewing all articles
Browse latest Browse all 12241

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>