Skip to content

Jool's Compilation Options

Alberto Leiva Popper edited this page Aug 28, 2023 · 7 revisions

Compilation flags

Production code should probably never enable these flags. They are intended for developer consumption.

Syntax

make CFLAGS_MODULE="[-DDEBUG] [-DJKMEMLEAK]"

Only the kernel modules care for CFLAGS_MODULE at present. (ie. it does nothing on userspace tools.)

-DDEBUG

Enable global debug logging, as well as instance debug logging by default.

"make debug" can be used instead of "make CFLAGS_MODULE=-DDEBUG", though don't count on it working in future releases.

-DJKMEMLEAK

Compiles into Jool a kmemleak ripoff. It keeps track of all allocated objects, so long as they are reserved and released via the malloc wrappers. Prints any leaks once the module is r-modprobed:

$ sudo modprobe -r jool
$ dmesg -t | tail
Memory leaks:
struct pktqueue_session: 71011
struct foo: 123
struct bar: 5454

Yes, this is an embarrassing half-assed replacement for the real thing, but it can come in handy when you don't have time to compile another kernel. (Distros don't like to ship with kmemleak.)

Just like the original, -DJKMEMLEAK is not free: It adds a tree add whenever something is allocated and a tree removal whenever something is destroyed.

Clone this wiki locally