Is there a tool which can generate a small and simple source tree after config?
Hi: While reading the kernel code 1. the huge amount of files make me scared there are too many alike functions in different files sometimes I can't figure out which one was really compiled 2. too many macros in the definition of a struct or functions declaration confused me a lot I tried to follow the generated file autoconf.h to guess the final face but it's really a difficult thing Is there a tool which can generate a small and simple source tree after config? not pre-processor just generate a small source tree contains the files and dirs which really will be compiled and no macros like CONFIG_SMP etc. according to the configuration or some other way to understand the architecture of the final working source tree? Thanks. -- 2011-10-23 jiangtao.jit
hum, how about doxygen? On Sun, Oct 23, 2011 at 6:29 PM, jiangtao.jit <jiangtao.jit@gmail.com>wrote:
Hi:
While reading the kernel code 1. the huge amount of files make me scared there are too many alike functions in different files sometimes I can't figure out which one was really compiled 2. too many macros in the definition of a struct or functions declaration confused me a lot I tried to follow the generated file autoconf.h to guess the final face but it's really a difficult thing
Is there a tool which can generate a small and simple source tree after config? not pre-processor just generate a small source tree contains the files and dirs which really will be compiled and no macros like CONFIG_SMP etc. according to the configuration
or some other way to understand the architecture of the final working source tree?
Thanks.
-- 2011-10-23 jiangtao.jit
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Best Regards! Aiolia Lea
Hi :) On Sun, Oct 23, 2011 at 23:29, jiangtao.jit <jiangtao.jit@gmail.com> wrote:
Is there a tool which can generate a small and simple source tree after config? not pre-processor just generate a small source tree contains the files and dirs which really will be compiled and no macros like CONFIG_SMP etc. according to the configuration
or some other way to understand the architecture of the final working source tree?
I feel the same way too, even 'til now :) The way I do it is maybe counter intuitive for you. I compile the kernel image with frame pointer enabled and debug info (check kernel hacking section in "make config" during kernel compilation). Then, together with a disk image, I run this kernel in Qemu virtual machine. While running, I hook gdb to this Qemu instance. Finally, I put breakpoints, watchpoints, check backtraces etc I needed to understand the flow. Maybe that'll work for you too. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Sun, Oct 23, 2011 at 6:29 PM, jiangtao.jit <jiangtao.jit@gmail.com> wrote:
Hi:
Hi jiangtao,
While reading the kernel code 1. the huge amount of files make me scared there are too many alike functions in different files sometimes I can't figure out which one was really compiled 2. too many macros in the definition of a struct or functions declaration confused me a lot I tried to follow the generated file autoconf.h to guess the final face but it's really a difficult thing
Is there a tool which can generate a small and simple source tree after config? not pre-processor
Not that I'm aware of.
just generate a small source tree contains the files and dirs which really will be compiled and no macros like CONFIG_SMP etc. according to the configuration
or some other way to understand the architecture of the final working source tree?
The Linux kernel is a very complex beast yet it is highly modularized. I recommend you to focus on the specific subsystem that you need to work and don't worry about the rest. To know if a specific file is included in your kernel I usually do this (it works for me but I'm not sure if is the right way to do it): For example if I want to know if the driver to support nand memories on ARM OMAP platforms is included in my kernel. 1- Find the file that implements the driver (drivers/mtd/nand/omap2.c) 2- See which Kconfig symbol determines its compilation: $ fgrep omap2 drivers/mtd/nand/Makefile obj-$(CONFIG_MTD_NAND_OMAP2) += omap2.o 3- Look if that symbol is included in my config file: $ fgrep MTD_NAND_OMAP2 .config CONFIG_MTD_NAND_OMAP2=y Then I know that my kernels includes that file. Hope it helps, -- Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain
participants (4)
-
Aiolia Lea -
Javier Martinez Canillas -
jiangtao.jit -
Mulyadi Santosa