* Is there a tool which can generate a small and simple source tree after config?
@ 2011-10-23 16:29 jiangtao.jit
2011-10-23 17:05 ` Aiolia Lea
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jiangtao.jit @ 2011-10-23 16:29 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Is there a tool which can generate a small and simple source tree after config?
2011-10-23 16:29 Is there a tool which can generate a small and simple source tree after config? jiangtao.jit
@ 2011-10-23 17:05 ` Aiolia Lea
2011-10-25 2:15 ` Mulyadi Santosa
2011-10-25 7:34 ` Javier Martinez Canillas
2 siblings, 0 replies; 4+ messages in thread
From: Aiolia Lea @ 2011-10-23 17:05 UTC (permalink / raw)
To: kernelnewbies
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 at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Best Regards!
Aiolia Lea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111023/71772272/attachment.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Is there a tool which can generate a small and simple source tree after config?
2011-10-23 16:29 Is there a tool which can generate a small and simple source tree after config? jiangtao.jit
2011-10-23 17:05 ` Aiolia Lea
@ 2011-10-25 2:15 ` Mulyadi Santosa
2011-10-25 7:34 ` Javier Martinez Canillas
2 siblings, 0 replies; 4+ messages in thread
From: Mulyadi Santosa @ 2011-10-25 2:15 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Is there a tool which can generate a small and simple source tree after config?
2011-10-23 16:29 Is there a tool which can generate a small and simple source tree after config? jiangtao.jit
2011-10-23 17:05 ` Aiolia Lea
2011-10-25 2:15 ` Mulyadi Santosa
@ 2011-10-25 7:34 ` Javier Martinez Canillas
2 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2011-10-25 7:34 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-25 7:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 16:29 Is there a tool which can generate a small and simple source tree after config? jiangtao.jit
2011-10-23 17:05 ` Aiolia Lea
2011-10-25 2:15 ` Mulyadi Santosa
2011-10-25 7:34 ` Javier Martinez Canillas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.