From patchwork Mon Oct 18 19:13:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 262711 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9IJDT15024024 for ; Mon, 18 Oct 2010 19:13:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755005Ab0JRTN3 (ORCPT ); Mon, 18 Oct 2010 15:13:29 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:37186 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754457Ab0JRTN2 (ORCPT ); Mon, 18 Oct 2010 15:13:28 -0400 X-Authority-Analysis: v=1.1 cv=exbvkCqEOBXDkHq+8n3wanotOBQtbe7qbIajSD+JluU= c=1 sm=0 a=fFCn7IPotaMA:10 a=Q9fys5e9bTEA:10 a=OPBmh+XkhLl+Enan7BmTLg==:17 a=_gq4xgUj1IwQ4OyMcisA:9 a=GhLQg2cMMuwhWetzGWxsG_m-44sA:4 a=PUjeQqilurYA:10 a=OPBmh+XkhLl+Enan7BmTLg==:117 X-Cloudmark-Score: 0 X-Originating-IP: 67.242.120.143 Received: from [67.242.120.143] ([67.242.120.143:36693] helo=[192.168.23.10]) by hrndva-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 0C/6C-07458-65C9CBC4; Mon, 18 Oct 2010 19:13:27 +0000 Subject: [RFC] better fix? (was: Re: [PATCH][GIT PULL] ftrace: Remove recursion between recordmcount and scripts/mod/empty) From: Steven Rostedt To: LKML Cc: Ingo Molnar , Frederic Weisbecker , Andrew Morton , Michal Marek , linux-kbuild@vger.kernel.org, Sam Ravnborg In-Reply-To: <1287427989.16971.304.camel@gandalf.stny.rr.com> References: <1287427989.16971.304.camel@gandalf.stny.rr.com> Date: Mon, 18 Oct 2010 15:13:26 -0400 Message-ID: <1287429206.16971.325.camel@gandalf.stny.rr.com> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 18 Oct 2010 19:13:30 +0000 (UTC) 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