# Downstream Dependency Map ***Analyze downstream kernel's modules and their dependencies*** ``` Usage: downstream_dependency_map [downstream_compile_commands.json] [downstream kernel directory] [relative build directory name (must be in the high source tree)] [mainline kernel directory] [option] ... Example: downstream_dependency_map downstream_kernel/build/compile_commands.json downstream_kernel/ build/ mainline_kernel/ -pd Options: --path-absolute, -a : Use absolute path to the source directory --print-dependencies, -pd : Print dependencies tree --print-includes, -pi : Print includes --dependencies-json, -dj [output.json] : Export dependencies tree to a .json file --dependencies-dot, -dd [output.dot] : Export dependencies tree to a .dot file --includes-json, -ij [output.json] : Export includes to a .json file --includes-dot, -id [output.dot] : Export includes to a .dot file ``` How to make it work: 1. Compile your downstream kernel with Clang, generate "compile_commands.json" from the build, I recommend using ``` bear -- [./build_script.sh] ``` 2. Download the mainline kernel of the exact same version 3. Use the utility to generate the dependencies and includes trees