diff mbox

[RFC,2/2] ftrace/kbuild: Add recordmcount files to force full build

Message ID 20110517133646.GP13293@sepie.suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Marek May 17, 2011, 1:36 p.m. UTC
On Mon, May 16, 2011 at 10:10:29PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
> 
> Modifications to recordmcount must be performed on all object
> files to stay consistent with what the kernel code may expect.
> Add the recordmcount files to the force-deps to make sure
> any change to them causes a full recompile.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  scripts/Makefile.build |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 0ff5a58..057d6e9 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -252,6 +252,7 @@ sub_cmd_record_mcount =					\
>  	if [ $(@) != "scripts/mod/empty.o" ]; then	\
>  		$(objtree)/scripts/recordmcount "$(@)";	\
>  	fi;
> +force-deps += $(srctree)/scripts/recordmcount.c $(srctree)/scripts/recordmcount.h
>  else
>  sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
>  	"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
> @@ -259,6 +260,7 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH
>  	"$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \
>  	"$(LD)" "$(NM)" "$(RM)" "$(MV)" \
>  	"$(if $(part-of-module),1,0)" "$(@)";
> +force-deps += $(srctree)/scripts/recordmcount.pl
>  endif
>  cmd_record_mcount = 						\
>  	if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then	\

We could add recordmcount.c as a dependency in scripts/Makefile.build
directly, without playing with fixdep, like this (untested):


Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Steven Rostedt May 17, 2011, 1:47 p.m. UTC | #1
On Tue, 2011-05-17 at 15:36 +0200, Michal Marek wrote:

> We could add recordmcount.c as a dependency in scripts/Makefile.build
> directly, without playing with fixdep, like this (untested):

I actually tried this first, and it didn't seem to work. I'll go ahead
and give it another try (maybe I did something wrong). But I do prefer
this over my fixdep change.

Thanks, I'll let you know the outcome.

-- Steve

> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index f133641..bc2c8d3 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -268,6 +268,7 @@ sub_cmd_record_mcount =					\
>  	if [ $(@) != "scripts/mod/empty.o" ]; then	\
>  		$(objtree)/scripts/recordmcount "$(@)";	\
>  	fi;
> +recordmcount_source := $(srctree)/scripts/recordmcount.c
>  else
>  sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
>  	"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
> @@ -275,6 +276,7 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH
>  	"$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \
>  	"$(LD)" "$(NM)" "$(RM)" "$(MV)" \
>  	"$(if $(part-of-module),1,0)" "$(@)";
> +recordmcount_source := $(srctree)/scripts/recordmcount.pl
>  endif
>  cmd_record_mcount = 						\
>  	if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then	\
> @@ -295,13 +297,13 @@ define rule_cc_o_c
>  endef
>  
>  # Built-in and composite module parts
> -$(obj)/%.o: $(src)/%.c FORCE
> +$(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
>  	$(call cmd,force_checksrc)
>  	$(call if_changed_rule,cc_o_c)
>  
>  # Single-part modules are special since we need to mark them in $(MODVERDIR)
>  
> -$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
> +$(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
>  	$(call cmd,force_checksrc)
>  	$(call if_changed_rule,cc_o_c)
>  	@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
> 
> Michal


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steven Rostedt May 17, 2011, 2:20 p.m. UTC | #2
On Tue, 2011-05-17 at 09:47 -0400, Steven Rostedt wrote:
> On Tue, 2011-05-17 at 15:36 +0200, Michal Marek wrote:
> 
> > We could add recordmcount.c as a dependency in scripts/Makefile.build
> > directly, without playing with fixdep, like this (untested):
> 
> I actually tried this first, and it didn't seem to work. I'll go ahead
> and give it another try (maybe I did something wrong). But I do prefer
> this over my fixdep change.
> 
> Thanks, I'll let you know the outcome.

Awesome! This worked. I wonder what screw up I did to keep mine from
working? Anyway, I made a single change to your patch:

-recordmcount_source := $(srctree)/scripts/recordmcount.c
+recordmcount_source := $(srctree)/scripts/recordmcount.c \
+                   $(srctree)/scripts/recordmcount.h


Could you send me your Signed-off-by, and I'll add this to the beginning
of my patch queue.

Thanks!

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steven Rostedt May 17, 2011, 2:21 p.m. UTC | #3
On Tue, 2011-05-17 at 10:20 -0400, Steven Rostedt wrote:

> Awesome! This worked. I wonder what screw up I did to keep mine from
> working? 

Bah! I forgot to add the $() around the variable that I used.

/me is embarrassed.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek May 17, 2011, 2:42 p.m. UTC | #4
On 17.5.2011 16:20, Steven Rostedt wrote:
> On Tue, 2011-05-17 at 09:47 -0400, Steven Rostedt wrote:
>> On Tue, 2011-05-17 at 15:36 +0200, Michal Marek wrote:
>>
>>> We could add recordmcount.c as a dependency in scripts/Makefile.build
>>> directly, without playing with fixdep, like this (untested):
>>
>> I actually tried this first, and it didn't seem to work. I'll go ahead
>> and give it another try (maybe I did something wrong). But I do prefer
>> this over my fixdep change.
>>
>> Thanks, I'll let you know the outcome.
>
> Awesome! This worked.

Great.


> I wonder what screw up I did to keep mine from
> working? Anyway, I made a single change to your patch:
>
> -recordmcount_source := $(srctree)/scripts/recordmcount.c
> +recordmcount_source := $(srctree)/scripts/recordmcount.c \
> +                   $(srctree)/scripts/recordmcount.h
>
>
> Could you send me your Signed-off-by, and I'll add this to the beginning
> of my patch queue.

Signed-off-by: Michal Marek <mmarek@suse.cz>

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f133641..bc2c8d3 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -268,6 +268,7 @@  sub_cmd_record_mcount =					\
 	if [ $(@) != "scripts/mod/empty.o" ]; then	\
 		$(objtree)/scripts/recordmcount "$(@)";	\
 	fi;
+recordmcount_source := $(srctree)/scripts/recordmcount.c
 else
 sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
 	"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
@@ -275,6 +276,7 @@  sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH
 	"$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \
 	"$(LD)" "$(NM)" "$(RM)" "$(MV)" \
 	"$(if $(part-of-module),1,0)" "$(@)";
+recordmcount_source := $(srctree)/scripts/recordmcount.pl
 endif
 cmd_record_mcount = 						\
 	if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then	\
@@ -295,13 +297,13 @@  define rule_cc_o_c
 endef
 
 # Built-in and composite module parts
-$(obj)/%.o: $(src)/%.c FORCE
+$(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Single-part modules are special since we need to mark them in $(MODVERDIR)
 
-$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
+$(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 	@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)