From: Michael Ellerman <mpe@ellerman.id.au>
To: rostedt@goodmis.org
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, naveen.n.rao@linux.vnet.ibm.com
Subject: [RFC PATCH 1/2] ftrace: Allow arches to opt-out of static ftrace
Date: Sat, 17 Mar 2018 00:46:32 +1100 [thread overview]
Message-ID: <20180316134633.10584-1-mpe@ellerman.id.au> (raw)
There is a small but non-zero amount of code required by arches to
suppory non-dynamic (static) ftrace, and more importantly there is the
added work of testing both configurations.
There are also almost no down sides to dynamic ftrace once it's well
tested, other than a small increase in code/data size.
So give arches the option to opt-out of supporting static ftrace.
This is implemented as a DYNAMIC_FTRACE_CHOICE option, which controls
whether DYNAMIC_FTRACE is presented as a user-selectable option or if
it is just enabled based on its dependencies being enabled (because
it's already default y).
Then the CHOICE option depends on an arch *not* selecting
HAVE_DYNAMIC_FTRACE_ONLY. This would be more natural in reverse, as a
HAVE_STATIC_FTRACE option, but that would require updating every arch.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
Documentation/trace/ftrace-design.txt | 12 ++++++++++++
kernel/trace/Kconfig | 9 ++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt
index a273dd0bbaaa..50c1d252f01d 100644
--- a/Documentation/trace/ftrace-design.txt
+++ b/Documentation/trace/ftrace-design.txt
@@ -391,3 +391,15 @@ Quick notes:
ftrace_graph_call location with a call to ftrace_graph_caller()
- ftrace_disable_ftrace_graph_caller() will runtime patch the
ftrace_graph_call location with nops
+
+HAVE_DYNAMIC_FTRACE_ONLY
+------------------------
+
+An arch can select this option to indicate that it only supports dynamic ftrace,
+and not non-dynamic (static) ftrace.
+
+Once dynamic ftrace is well tested it is superior to static ftrace in basically
+all respects other than code/data size.
+
+Selection this option allows an arch to only support dyanmic, removing a small
+amount of code complexity required to support both static and dynamic.
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 0b249e2f0c3c..1998e30d2ea2 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -29,6 +29,9 @@ config HAVE_DYNAMIC_FTRACE
help
See Documentation/trace/ftrace-design.txt
+config HAVE_DYNAMIC_FTRACE_ONLY
+ bool
+
config HAVE_DYNAMIC_FTRACE_WITH_REGS
bool
@@ -488,8 +491,12 @@ config BPF_EVENTS
config PROBE_EVENTS
def_bool n
+config DYNAMIC_FTRACE_CHOICE
+ def_bool y
+ depends on !HAVE_DYNAMIC_FTRACE_ONLY
+
config DYNAMIC_FTRACE
- bool "enable/disable function tracing dynamically"
+ bool "enable/disable function tracing dynamically" if DYNAMIC_FTRACE_CHOICE
depends on FUNCTION_TRACER
depends on HAVE_DYNAMIC_FTRACE
default y
--
2.14.1
next reply other threads:[~2018-03-16 13:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-16 13:46 Michael Ellerman [this message]
2018-03-16 13:46 ` [RFC PATCH 2/2] powerpc: Only support DYNAMIC_FTRACE not static Michael Ellerman
2018-03-16 14:42 ` Steven Rostedt
2018-03-19 1:08 ` Michael Ellerman
2018-03-16 14:40 ` [RFC PATCH 1/2] ftrace: Allow arches to opt-out of static ftrace Steven Rostedt
2018-03-19 1:02 ` Michael Ellerman
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=20180316134633.10584-1-mpe@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=rostedt@goodmis.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®