From: Sam Ravnborg <sam@ravnborg.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
masahiroy@kernel.org
Subject: Re: [GIT PULL 1/4] Kbuild updates for v4.21
Date: Sat, 5 Jan 2019 21:39:06 +0100 [thread overview]
Message-ID: <20190105203906.GA22423@ravnborg.org> (raw)
In-Reply-To: <CAHk-=whg49nn5q_2QVMGN0u4rQFBmRKywtqJUSk+5=rBzTk1kg@mail.gmail.com>
Hi Linus.
> But the reason for this email to you is simply to ask whether you
> use/have any tools for seeing these kinds of deep include chains.
Not exactly what you ask for - but we have make V=2
Example:
$ touch include/uapi/linux/elf-em.h
$ make V=2
CALL scripts/checksyscalls.sh - due to target missing
DESCEND objtool
CC init/main.o - due to: include/uapi/linux/elf-em.h
CHK include/generated/compile.h
CC init/version.o - due to: include/uapi/linux/elf-em.h
CC init/do_mounts.o - due to: include/uapi/linux/elf-em.h
CC init/do_mounts_initrd.o - due to: include/uapi/linux/elf-em.h
CC init/do_mounts_md.o - due to: include/uapi/linux/elf-em.h
...
With V=2 kbuild will try to tell you why a target is rebuild.
This can sometimes be useful.
Here kbuild will tell you: - due to: include/uapi/linux/elf-em.h
Which may be a good clue.
But you need to figure out yourself why a certain file
depends on include/uapi/linux/elf-em.h
One way is to look at the .cmd file for a target:
$ cat init/.do_mounts_md.o.cmd
...
include/linux/module.h \
$(wildcard include/config/modules/tree/lookup.h) \
$(wildcard include/config/module/sig.h) \
$(wildcard include/config/module/unload.h) \
$(wildcard include/config/constructors.h) \
$(wildcard include/config/function/error/injection.h) \
include/linux/kmod.h \
include/linux/umh.h \
include/linux/elf.h \
arch/x86/include/asm/elf.h \
arch/x86/include/asm/user.h \
arch/x86/include/asm/user_64.h \
arch/x86/include/asm/fsgsbase.h \
arch/x86/include/asm/msr-index.h \
arch/x86/include/asm/vdso.h \
$(wildcard include/config/x86/x32.h) \
include/uapi/linux/elf.h \
include/uapi/linux/elf-em.h \
...
In the above all the $(wildcard ...) is the CONFIG_ symbols
in the files that trigger a possible dependency on a file
representing the CONFIG_ symbol.
We can see that the target depends on elf-em.h and if we follow
it back we end up with module.h included from do_mounts_md.c
Sam
next prev parent reply other threads:[~2019-01-05 20:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 15:58 [GIT PULL 1/4] Kbuild updates for v4.21 Masahiro Yamada
2018-12-29 22:05 ` pr-tracker-bot
2019-01-05 18:35 ` Linus Torvalds
2019-01-05 20:39 ` Sam Ravnborg [this message]
2019-01-05 20:44 ` Linus Torvalds
2019-01-06 1:03 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190105203906.GA22423@ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox