# kmem-trace ```text usage: kmem-trace [-h] [-s] [-b] [-v] [-c COMMAND] [--all] ``` Trace kernel memory (SLUB and buddy) allocations and frees. This command will execute `next` in the debugger, and print out all (de)allocations that happen until the command finishes. As such this makes most sense to call when the PC is on a function call instruction. Only (de)allocations triggered by the current function are considered (rather than other threads etc). If neither `-s` nor `-b` are passed, both allocators are traced. ### Optional arguments |Short|Long|Help| | :--- | :--- | :--- | |-h|--help|show this help message and exit| |-s|--trace-slab|do only slab allocator tracing| |-b|--trace-buddy|do only buddy allocator tracing| |-v|--verbose|print backtraces| |-c|--command|trace during the execution of this command (default: 'next')| ||--all|display ALL memory allocations/frees regardless if they are triggered by the current function.| ### Notes The `--all` flag may be helpful if you also want to trace frees scheduled with rcu or if the traced command steps out of the current function. You may also find `-c finish` and `-c continue` useful.