Skip to content

Instantly share code, notes, and snippets.

Created August 6, 2018 18:49
What would you like to do?
#!/usr/bin/env python
from bcc import BPF
import time
# define BPF program
prog = """
#include <linux/sched.h>
#include <linux/bpf.h>
int kprobe__htab_map_update_elem() {
bpf_trace_printk("trace \\n");
return 0;
# load BPF program
b = BPF(text=prog)
#b.attach_kprobe(event="htab_map_update_elem", fn_name="hello")
while 1:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment