* [PATCH] Use -mcount-record for dynamic ftrace
@ 2015-04-13 0:54 Andi Kleen
2015-04-13 19:32 ` Steven Rostedt
0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2015-04-13 0:54 UTC (permalink / raw)
To: rostedt; +Cc: linux-kernel, linux-kbuild, mmarek, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
gcc 5 supports a new -mcount-record option to generate ftrace
tables directly. This avoids the need to run record_mcount
manually.
Use this option when available.
It also has a -mcount-nop option to generate the mcount calls
as nops. So far that is not implemented, but it could be used
to optimize patching at boot up.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
scripts/Makefile.build | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 01df30a..f258e9b 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -210,6 +210,11 @@ cmd_modversions = \
fi;
endif
+# gcc 5 supports generating the mcount tables directly
+ifneq ($(call cc-option,-mrecord-mcount,y),y)
+KBUILD_CFLAGS += -mrecord-mcount
+else
+# else do it all manually
ifdef CONFIG_FTRACE_MCOUNT_RECORD
ifdef BUILD_C_RECORDMCOUNT
ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
@@ -240,6 +245,7 @@ cmd_record_mcount = \
$(sub_cmd_record_mcount) \
fi;
endif
+endif
define rule_cc_o_c
$(call echo-cmd,checksrc) $(cmd_checksrc) \
--
2.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-13 0:54 [PATCH] Use -mcount-record for dynamic ftrace Andi Kleen
@ 2015-04-13 19:32 ` Steven Rostedt
2015-04-13 21:55 ` Andi Kleen
2015-04-14 6:19 ` Kalle Valo
0 siblings, 2 replies; 9+ messages in thread
From: Steven Rostedt @ 2015-04-13 19:32 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel, linux-kbuild, mmarek, Andi Kleen
On Sun, 12 Apr 2015 17:54:27 -0700
Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> gcc 5 supports a new -mcount-record option to generate ftrace
> tables directly. This avoids the need to run record_mcount
> manually.
>
> Use this option when available.
>
> It also has a -mcount-nop option to generate the mcount calls
> as nops. So far that is not implemented, but it could be used
> to optimize patching at boot up.
Interesting. But I can't accept this until I can test it. I don't have
the time to build gcc from scratch, and currently none of my boxes have
a gcc 5 install.
I wonder who's responsible for
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
If they can add a i386/x86_64 build for gcc5 I'll be happy to download
it and test this patch.
Thanks,
-- Steve
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> scripts/Makefile.build | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 01df30a..f258e9b 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -210,6 +210,11 @@ cmd_modversions = \
> fi;
> endif
>
> +# gcc 5 supports generating the mcount tables directly
> +ifneq ($(call cc-option,-mrecord-mcount,y),y)
> +KBUILD_CFLAGS += -mrecord-mcount
> +else
> +# else do it all manually
> ifdef CONFIG_FTRACE_MCOUNT_RECORD
> ifdef BUILD_C_RECORDMCOUNT
> ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
> @@ -240,6 +245,7 @@ cmd_record_mcount = \
> $(sub_cmd_record_mcount) \
> fi;
> endif
> +endif
>
> define rule_cc_o_c
> $(call echo-cmd,checksrc) $(cmd_checksrc) \
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-13 19:32 ` Steven Rostedt
@ 2015-04-13 21:55 ` Andi Kleen
2015-04-13 22:03 ` Steven Rostedt
2015-04-14 6:19 ` Kalle Valo
1 sibling, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2015-04-13 21:55 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Andi Kleen, linux-kernel, linux-kbuild, mmarek
> Interesting. But I can't accept this until I can test it. I don't have
AFAIK that's a unique policy. I don't think any other maintainer operates
this way.
> I wonder who's responsible for
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
>
> If they can add a i386/x86_64 build for gcc5 I'll be happy to download
> it and test this patch.
That doesn't make any sense.
-Andi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-13 21:55 ` Andi Kleen
@ 2015-04-13 22:03 ` Steven Rostedt
2015-04-13 22:54 ` Andi Kleen
0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2015-04-13 22:03 UTC (permalink / raw)
To: Andi Kleen; +Cc: Andi Kleen, linux-kernel, linux-kbuild, mmarek
On Mon, 13 Apr 2015 14:55:08 -0700
Andi Kleen <ak@linux.intel.com> wrote:
> > Interesting. But I can't accept this until I can test it. I don't have
>
> AFAIK that's a unique policy. I don't think any other maintainer operates
> this way.
Um, really? Other maintainers don't test patches that they maintain?
This isn't like hardware that I don't have. This could certainly affect
people if it breaks, and I will be responsible to fix it. I'm not going
to do that until I have a setup where I can test things that break.
>
> > I wonder who's responsible for
> > https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
> >
> > If they can add a i386/x86_64 build for gcc5 I'll be happy to download
> > it and test this patch.
>
> That doesn't make any sense.
>
What, adding gcc5 to the crosstools suite? Why not?
-- Steve
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-13 22:03 ` Steven Rostedt
@ 2015-04-13 22:54 ` Andi Kleen
2015-04-14 0:26 ` Steven Rostedt
0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2015-04-13 22:54 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Andi Kleen, Andi Kleen, linux-kernel, linux-kbuild, mmarek
> > > I wonder who's responsible for
> > > https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
> > >
> > > If they can add a i386/x86_64 build for gcc5 I'll be happy to download
> > > it and test this patch.
> >
> > That doesn't make any sense.
> >
>
> What, adding gcc5 to the crosstools suite? Why not?
Making patches dependent on someone else building compilers for you.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-13 22:54 ` Andi Kleen
@ 2015-04-14 0:26 ` Steven Rostedt
0 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2015-04-14 0:26 UTC (permalink / raw)
To: Andi Kleen; +Cc: Andi Kleen, linux-kernel, linux-kbuild, mmarek
On Tue, 14 Apr 2015 00:54:12 +0200
Andi Kleen <andi@firstfloor.org> wrote:
> > > > I wonder who's responsible for
> > > > https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
> > > >
> > > > If they can add a i386/x86_64 build for gcc5 I'll be happy to download
> > > > it and test this patch.
> > >
> > > That doesn't make any sense.
> > >
> >
> > What, adding gcc5 to the crosstools suite? Why not?
>
> Making patches dependent on someone else building compilers for you.
>
Well, until it's in the distro, I don't currently have time to build
the compiler. Thus, it will have to wait till one's already available,
or I get around to it.
-- Steve
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-13 19:32 ` Steven Rostedt
2015-04-13 21:55 ` Andi Kleen
@ 2015-04-14 6:19 ` Kalle Valo
2015-04-14 13:07 ` Steven Rostedt
1 sibling, 1 reply; 9+ messages in thread
From: Kalle Valo @ 2015-04-14 6:19 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Andi Kleen, linux-kernel, linux-kbuild, mmarek, Andi Kleen
Steven Rostedt <rostedt@goodmis.org> writes:
> I wonder who's responsible for
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
>
> If they can add a i386/x86_64 build for gcc5 I'll be happy to download
> it and test this patch.
Found this:
"For any questions don't hesitate to contact me at tony (at) bake your
noodle . com"
https://www.kernel.org/pub/tools/crosstool/
--
Kalle Valo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Use -mcount-record for dynamic ftrace
2015-04-14 6:19 ` Kalle Valo
@ 2015-04-14 13:07 ` Steven Rostedt
0 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2015-04-14 13:07 UTC (permalink / raw)
To: Kalle Valo; +Cc: Andi Kleen, linux-kernel, linux-kbuild, mmarek, Andi Kleen
On Tue, 14 Apr 2015 09:19:58 +0300
Kalle Valo <kvalo@adurom.com> wrote:
> Steven Rostedt <rostedt@goodmis.org> writes:
>
> > I wonder who's responsible for
> > https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/
> >
> > If they can add a i386/x86_64 build for gcc5 I'll be happy to download
> > it and test this patch.
>
> Found this:
>
> "For any questions don't hesitate to contact me at tony (at) bake your
> noodle . com"
>
> https://www.kernel.org/pub/tools/crosstool/
>
Thanks for the pointer.
-- Steve
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] Use -mcount-record for dynamic ftrace
@ 2016-11-02 2:27 Andi Kleen
0 siblings, 0 replies; 9+ messages in thread
From: Andi Kleen @ 2016-11-02 2:27 UTC (permalink / raw)
To: rostedt; +Cc: linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
gcc 5 supports a new -mcount-record option to generate ftrace
tables directly. This avoids the need to run record_mcount
manually.
Use this option when available.
It also has a -mcount-nop option to generate the mcount calls
as nops. So far that is not implemented, but it could be used
to optimize patching at boot up.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
scripts/Makefile.build | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index de46ab03f063..2d7467076411 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -212,6 +212,11 @@ cmd_modversions = \
endif
ifdef CONFIG_FTRACE_MCOUNT_RECORD
+# gcc 5 supports generating the mcount tables directly
+ifneq ($(call cc-option,-mrecord-mcount,y),y)
+ KBUILD_CFLAGS += -mrecord-mcount
+else
+# else do it all manually
ifdef BUILD_C_RECORDMCOUNT
ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
RECORDMCOUNT_FLAGS = -w
@@ -241,6 +246,7 @@ cmd_record_mcount = \
$(sub_cmd_record_mcount) \
fi;
endif
+endif
ifdef CONFIG_STACK_VALIDATION
ifneq ($(SKIP_STACK_VALIDATION),1)
--
2.5.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-11-02 2:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13 0:54 [PATCH] Use -mcount-record for dynamic ftrace Andi Kleen
2015-04-13 19:32 ` Steven Rostedt
2015-04-13 21:55 ` Andi Kleen
2015-04-13 22:03 ` Steven Rostedt
2015-04-13 22:54 ` Andi Kleen
2015-04-14 0:26 ` Steven Rostedt
2015-04-14 6:19 ` Kalle Valo
2015-04-14 13:07 ` Steven Rostedt
2016-11-02 2:27 Andi Kleen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.