Created
August 6, 2018 18:49
-
-
Save raffysommy/587f61c14d3e157f86da1aadd07442b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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