LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <maasami.hiramatsu.pt@hitachi.com>
Cc: Vojtech Pavlik <vojtech@suse.cz>, Jiri Kosina <jkosina@suse.cz>,
	Jiri Slaby <jslaby@suse.cz>,
	Andreas Krebbel <krebbel@linux.vnet.ibm.com>,
	Dominik Vogt <vogt@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-kernel@vger.kernel.org,
	Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: [PATCH/RFC 0/3] ftrace: allow arch specific compile options
Date: Mon, 26 Jan 2015 13:54:51 +0100	[thread overview]
Message-ID: <1422276894-31302-1-git-send-email-heiko.carstens@de.ibm.com> (raw)

This patch set enables s390 to use gcc's s390 specific "--mhotpatch" compile
option if the kernel is instrumented for function tracing.

The normal -pg compile option adds 24 bytes to each function prologue.
Performance measurements have shown that, depending on the workload, we have
an impact of up to 2% - 10% additional cpu time spent as compared to a kernel
which is compiled without the -pg option.

In both cases function tracing is disabled. What we see is the overhead
caused by simply adding 24 additional bytes to each function, where the
first instruction is patched to skip the rest of the code block, which
besides other effects causes instruction cache pollution.

These patches change code generation on s390 to only add a single six byte
nop to each function trace enabled function. With this change the overhead
gets reduced close to zero.

I tried to minimize the common code changes, which resulted mainly in a
new CC_FTRACE_FLAGS makefile variable and a new "nohotpatch" define.
The rest is s390 specific. The patches are against linux-next as of today.

The gcc hotpatch feature patch, which changes the existing hotpatch mechanism
to allow to specify the number of halfwords before/after the beginning of a
function is not yet upstream, but should be soon.

Heiko Carstens (3):
  ftrace: allow architectures to specify ftrace compile options
  ftrace: introduce nohotpatch function attribute
  s390/ftrace: hotpatch support for function tracing

 Makefile                       |  6 +++++-
 arch/s390/Kconfig              |  1 -
 arch/s390/Makefile             | 10 ++++++++++
 arch/s390/include/asm/ftrace.h | 15 +++++++++++++++
 arch/s390/kernel/Makefile      |  4 ++--
 arch/s390/kernel/ftrace.c      | 15 ++++++++++++++-
 arch/s390/kernel/kprobes.c     |  3 ++-
 arch/s390/kernel/mcount.S      |  2 ++
 include/linux/compiler.h       |  8 +++++++-
 kernel/Makefile                |  4 ++--
 kernel/events/Makefile         |  2 +-
 kernel/locking/Makefile        |  8 ++++----
 kernel/sched/Makefile          |  2 +-
 kernel/trace/Makefile          |  4 ++--
 lib/Makefile                   |  2 +-
 scripts/Makefile.build         |  5 +++--
 scripts/recordmcount.pl        |  9 +++++++--
 17 files changed, 78 insertions(+), 22 deletions(-)

-- 
2.1.4


             reply	other threads:[~2015-01-26 12:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 12:54 Heiko Carstens [this message]
2015-01-26 12:54 ` [PATCH/RFC 1/3] ftrace: allow architectures to specify ftrace " Heiko Carstens
2015-01-26 12:54 ` [PATCH/RFC 2/3] ftrace: introduce nohotpatch function attribute Heiko Carstens
2015-01-26 14:37   ` Steven Rostedt
2015-01-26 15:03     ` Heiko Carstens
2015-01-26 15:22       ` Steven Rostedt
2015-01-26 15:26         ` Heiko Carstens
2015-01-27  6:19     ` Dominik Vogt
2015-01-27 14:42       ` Steven Rostedt
2015-01-28  5:36         ` Heiko Carstens
2015-01-28 11:57           ` Steven Rostedt
2015-01-28 12:18             ` Heiko Carstens
2015-01-28 12:38               ` Steven Rostedt
2015-01-26 12:54 ` [PATCH/RFC 3/3] s390/ftrace: hotpatch support for function tracing Heiko Carstens

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=1422276894-31302-1-git-send-email-heiko.carstens@de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=krebbel@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maasami.hiramatsu.pt@hitachi.com \
    --cc=rostedt@goodmis.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=vogt@linux.vnet.ibm.com \
    --cc=vojtech@suse.cz \
    --subject='Re: [PATCH/RFC 0/3] ftrace: allow arch specific compile options' \
    /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

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).