public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers
       [not found] <20110421022825.535486725@goodmis.org>
@ 2011-04-21  2:28 ` Steven Rostedt
  2011-04-21  2:40   ` Steven Rostedt
  2011-04-21 20:40   ` Michal Marek
  0 siblings, 2 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-04-21  2:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, H. Peter Anvin,
	Michal Marek, linux-kbuild

[-- Attachment #1: 0007-kbuild-recordmcount-Add-RECORDMCOUNT_WARN-to-warn-ab.patch --]
[-- Type: text/plain, Size: 2013 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

When mcount is called in a section that ftrace will not modify it into
a nop, we want to warn about this. But not warn about this always. Now
if the user builds the kernel with the option RECORDMCOUNT_WARN=1 then
the build will warn about mcount callers that are ignored and will just
waste execution time.

Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 Makefile               |    1 +
 scripts/Makefile.build |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 8392b64..4e484cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1268,6 +1268,7 @@ help:
 	@echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse by default)'
 	@echo  '  make C=2   [targets] Force check of all c source with $$CHECK'
 	@echo  '  make W=1   [targets] Enable extra gcc checks'
+	@echo  '  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
 	@echo  ''
 	@echo  'Execute "make" or "make all" to build all targets marked with [*] '
 	@echo  'For further info see the ./README file'
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d5f925a..fdca952 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -244,13 +244,16 @@ endif
 
 ifdef CONFIG_FTRACE_MCOUNT_RECORD
 ifdef BUILD_C_RECORDMCOUNT
+ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
+  RECORDMCOUNT_FLAGS = -w
+endif
 # Due to recursion, we must skip empty.o.
 # The empty.o file is created in the make process in order to determine
 #  the target endianness and word size. It is made before all other C
 #  files, including recordmcount.
 sub_cmd_record_mcount =					\
 	if [ $(@) != "scripts/mod/empty.o" ]; then	\
-		$(objtree)/scripts/recordmcount "$(@)";	\
+		$(objtree)/scripts/recordmcount $(RECORDMCOUNT_FLAGS) "$(@)";	\
 	fi;
 else
 sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
-- 
1.7.2.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers
  2011-04-21  2:28 ` [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers Steven Rostedt
@ 2011-04-21  2:40   ` Steven Rostedt
  2011-04-21 20:40   ` Michal Marek
  1 sibling, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-04-21  2:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, H. Peter Anvin,
	Michal Marek, linux-kbuild

On Wed, 2011-04-20 at 22:28 -0400, Steven Rostedt wrote:
> plain text document attachment
> (0007-kbuild-recordmcount-Add-RECORDMCOUNT_WARN-to-warn-ab.patch)
> From: Steven Rostedt <srostedt@redhat.com>
> 
> When mcount is called in a section that ftrace will not modify it into
> a nop, we want to warn about this. But not warn about this always. Now
> if the user builds the kernel with the option RECORDMCOUNT_WARN=1 then
> the build will warn about mcount callers that are ignored and will just
> waste execution time.
> 
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: linux-kbuild@vger.kernel.org
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Michal,

Can I get an Acked-by from you for this patch. Or comments if it doesn't
suit you?

Thanks,

-- Stvee



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers
  2011-04-21  2:28 ` [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers Steven Rostedt
  2011-04-21  2:40   ` Steven Rostedt
@ 2011-04-21 20:40   ` Michal Marek
  2011-04-26 19:08     ` Steven Rostedt
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Marek @ 2011-04-21 20:40 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, Ingo Molnar, Andrew Morton, Frederic Weisbecker,
	H. Peter Anvin, linux-kbuild

On 21.4.2011 04:28, Steven Rostedt wrote:
> +ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
> +  RECORDMCOUNT_FLAGS = -w
> +endif

RECORDMCOUNT_WARN is IMO unlikely to be used with some other meaning in
the environment, so I think you can drop the origin check. Nevertheless

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

Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers
  2011-04-21 20:40   ` Michal Marek
@ 2011-04-26 19:08     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-04-26 19:08 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kernel, Ingo Molnar, Andrew Morton, Frederic Weisbecker,
	H. Peter Anvin, linux-kbuild

On Thu, 2011-04-21 at 22:40 +0200, Michal Marek wrote:
> On 21.4.2011 04:28, Steven Rostedt wrote:
> > +ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
> > +  RECORDMCOUNT_FLAGS = -w
> > +endif
> 
> RECORDMCOUNT_WARN is IMO unlikely to be used with some other meaning in
> the environment, so I think you can drop the origin check. Nevertheless

You haven't seen my environment variables ;)

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

 Thanks!

-- Steve



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-26 19:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110421022825.535486725@goodmis.org>
2011-04-21  2:28 ` [RFC][PATCH 07/11] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount callers Steven Rostedt
2011-04-21  2:40   ` Steven Rostedt
2011-04-21 20:40   ` Michal Marek
2011-04-26 19:08     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox