this repo has no description
1open Libbpf
2
3let obj_path = "kprobe.bpf.o"
4let program_names = [ "do_unlinkat"; "do_unlinkat_exit" ]
5
6let () =
7 with_bpf_object_open_load_link ~obj_path ~program_names (fun _obj _links ->
8 (* Set signal handlers *)
9 let exitting = ref true in
10 let sig_handler = Sys.Signal_handle (fun _ -> exitting := false) in
11 Sys.(set_signal sigint sig_handler);
12 Sys.(set_signal sigterm sig_handler);
13
14 Printf.printf
15 "Successfully started! Please run `sudo cat \
16 /sys/kernel/debug/tracing/trace_pipe` to see output of the BPF \
17 programs.\n\
18 %!";
19
20 while !exitting do
21 Unix.sleepf 1.0;
22 Printf.eprintf ".%!"
23 done)