Skip to content

Instantly share code, notes, and snippets.

@raffysommy
Created August 6, 2018 18:49
Embed
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>
BPF_PERF_OUTPUT(events);
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:
time.sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment