From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Marek <mmarek@suse.cz>,
linux-kbuild@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>
Subject: [RFC] better fix? (was: Re: [PATCH][GIT PULL] ftrace: Remove recursion between recordmcount and scripts/mod/empty)
Date: Mon, 18 Oct 2010 15:13:26 -0400 [thread overview]
Message-ID: <1287429206.16971.325.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1287427989.16971.304.camel@gandalf.stny.rr.com>
On Mon, 2010-10-18 at 14:53 -0400, Steven Rostedt wrote:
Just calling attention to this...
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 4db60b2..9f2d5b4 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -210,7 +210,11 @@ endif
>
> ifdef CONFIG_FTRACE_MCOUNT_RECORD
> ifdef BUILD_C_RECORDMCOUNT
> -cmd_record_mcount = $(objtree)/scripts/recordmcount "$(@)";
> +# Due to recursion, we must skip the empty.o file
> +# TBD: Find a better way to do this.
> +cmd_record_mcount = if [ $(@) != "scripts/mod/empty.o" ]; then \
> + $(objtree)/scripts/recordmcount "$(@)"; \
> + fi;
> else
> cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
> "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
>
This is pretty much a hack, would adding a patch like the following be a
better idea?
-- Steve
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 9f2d5b4..86e360a 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -210,11 +210,7 @@ endif
ifdef CONFIG_FTRACE_MCOUNT_RECORD
ifdef BUILD_C_RECORDMCOUNT
-# Due to recursion, we must skip the empty.o file
-# TBD: Find a better way to do this.
-cmd_record_mcount = if [ $(@) != "scripts/mod/empty.o" ]; then \
- $(objtree)/scripts/recordmcount "$(@)"; \
- fi;
+cmd_record_mcount = $(objtree)/scripts/recordmcount "$(@)";
else
cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
@@ -236,11 +232,26 @@ define rule_cc_o_c
mv -f $(dot-target).tmp $(dot-target).cmd
endef
+define rule_cc_o_c_notrace
+ $(call echo-cmd,checksrc) $(cmd_checksrc) \
+ $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
+ $(cmd_modversions) \
+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
+ $(dot-target).tmp; \
+ rm -f $(depfile); \
+ mv -f $(dot-target).tmp $(dot-target).cmd
+endef
+
# Built-in and composite module parts
$(obj)/%.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
+# Due to recursion, recordmcount must not be called on empty.o
+$(objtree)/scripts/mod/empty.o: $(srctree)/scripts/mod/empty.c
+ $(call cmd,force_checksrc)
+ $(call if_changed_rule,cc_o_c_notrace)
+
# Single-part modules are special since we need to mark them in $(MODVERDIR)
$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
next prev parent reply other threads:[~2010-10-18 19:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-18 18:53 [PATCH][GIT PULL] ftrace: Remove recursion between recordmcount and scripts/mod/empty Steven Rostedt
2010-10-18 19:13 ` Steven Rostedt [this message]
2010-10-18 19:35 ` [RFC] better fix? (was: Re: [PATCH][GIT PULL] ftrace: Remove recursion between recordmcount and scripts/mod/empty) Sam Ravnborg
2010-10-18 21:03 ` Steven Rostedt
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=1287429206.16971.325.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mmarek@suse.cz \
--cc=sam@ravnborg.org \
/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
all inboxes | Powered by JetHome®