Skip to content

Commit dbb5efe

Browse files
committed
Enhance eBPF C code generation by adding support for kprobe context includes and removing unused Linux headers in kprobe code generation.
1 parent 416d325 commit dbb5efe

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/context/kprobe_codegen.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ let generate_kprobe_includes () = [
5656
"#define __TARGET_ARCH_x86";
5757
"#endif";
5858
"";
59-
"#include <linux/types.h>";
6059
"#include <bpf/bpf_tracing.h>";
61-
"#include <linux/ptrace.h>";
6260
]
6361

6462
(** Generate field access for kprobe context *)

src/ebpf_c_codegen.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ let generate_includes ctx ?(program_types=[]) () =
11231123
let context_includes = List.fold_left (fun acc prog_type ->
11241124
let context_type = match prog_type with
11251125
| Ast.Tc -> Some "tc"
1126+
| Ast.Kprobe -> Some "kprobe"
11261127
| _ -> None
11271128
in
11281129
match context_type with

0 commit comments

Comments
 (0)