From: Steven Rostedt <rostedt@goodmis.org>
To: Sascha Hauer <sha@pengutronix.de>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Ingo Molnar <mingo@redhat.com>,
kernel@pengutronix.de
Subject: Re: Performance impact of CONFIG_FUNCTION_TRACER
Date: Tue, 5 Jul 2022 10:39:01 -0400 [thread overview]
Message-ID: <20220705103901.41a70cf0@rorschach.local.home> (raw)
In-Reply-To: <20220705105416.GE5208@pengutronix.de>
On Tue, 5 Jul 2022 12:54:16 +0200
Sascha Hauer <sha@pengutronix.de> wrote:
> Hi,
>
> I ran some lmbench subtests on a ARMv7 machine (NXP i.MX6q) with and
> without CONFIG_FUNCTION_TRACER enabled (with CONFIG_DYNAMIC_FTRACE
> enabled and no tracing active), see below. The Kconfig help text of this
> option reads as:
>
> > If it's runtime disabled (the bootup default), then the overhead of
> > the instructions is very small and not measurable even in
> > micro-benchmarks.
Well, this is true for x86 ;-)
>
> In my tests the overhead is small, but it surely exists and is
> measurable at least on ARMv7 machines. Is this expected? Should the help
> text be rephrased a little less optimistic?
You mean "(but may vary by architecture)"
As I believe due to using a link register for function calls, ARM
requires adding two 4 byte nops to every function where as x86 only
adds a single 5 byte nop.
Although nops are very fast (they should not be processed in the CPU's
pipe line, but I don't know if that's true for every arch). It also
affects instruction cache misses, as adding 8 bytes around the code
will cause more cache misses than when they do not exist.
Also, there's some configurations that use the old mcount that does add
some more code to handle the mcount case.
So if this is just to have us change the kconfig, I'm happy to do that.
-- Steve
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-07-05 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 10:54 Performance impact of CONFIG_FUNCTION_TRACER Sascha Hauer
2022-07-05 14:39 ` Steven Rostedt [this message]
2022-07-05 21:59 ` Sascha Hauer
2022-07-05 22:27 ` Steven Rostedt
2022-07-14 9:10 ` Sascha Hauer
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=20220705103901.41a70cf0@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sha@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).