Skip to content

Commit a702e62

Browse files
committed
make debug printing toggable
1 parent ef1a7b7 commit a702e62

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ffmuc-ebpf-clat/src/clat.bpf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ char _license[] SEC("license") = "GPL";
2626
#define IP_OFFSET_MASK (0x1FFF)
2727
#define IP_MF (0x2000)
2828

29-
#define DEBUG_PRINT(x)
30-
// #define DEBUG_PRINT(x) bpf_printk(x)
29+
/* Prob. requires CONFIG_BPF_EVENTS and CONFIG_TRACING kernel options to be enabled */
30+
#ifdef ENABLE_DEBUG_PRINT
31+
#define DEBUG_PRINT(x) bpf_printk(x)
32+
#else
33+
#define DEBUG_PRINT(x)
34+
#endif
3135

3236
/* To make the eBPF validator happy, we need to check that the header is
3337
* entirely within the valid data region.

0 commit comments

Comments
 (0)