All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [PATCH 15/15] ftrace/s390: mcount offset calculation
Date: Wed, 18 May 2011 12:08:24 -0400	[thread overview]
Message-ID: <20110518160909.877357918@goodmis.org> (raw)
In-Reply-To: 20110518160809.724215604@goodmis.org

[-- Attachment #1: 0015-ftrace-s390-mcount-offset-calculation.patch --]
[-- Type: text/plain, Size: 2553 bytes --]

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Do the mcount offset adjustment in the recordmcount.pl/recordmcount.[ch]
at compile time and not in ftrace_call_adjust at run time.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/s390/include/asm/ftrace.h |    4 +---
 scripts/recordmcount.c         |    8 ++++++--
 scripts/recordmcount.pl        |    2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
index 3c29be4..b7931fa 100644
--- a/arch/s390/include/asm/ftrace.h
+++ b/arch/s390/include/asm/ftrace.h
@@ -11,15 +11,13 @@ struct dyn_arch_ftrace { };
 
 #ifdef CONFIG_64BIT
 #define MCOUNT_INSN_SIZE  12
-#define MCOUNT_OFFSET	   8
 #else
 #define MCOUNT_INSN_SIZE  20
-#define MCOUNT_OFFSET	   4
 #endif
 
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
-	return addr - MCOUNT_OFFSET;
+	return addr;
 }
 
 #endif /* __ASSEMBLY__ */
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 7648a5d..ee52cb8 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -368,8 +368,10 @@ do_file(char const *const fname)
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (w2(ehdr->e_machine) == EM_S390)
+		if (w2(ehdr->e_machine) == EM_S390) {
 			reltype = R_390_32;
+			mcount_adjust_32 = -4;
+		}
 		if (w2(ehdr->e_machine) == EM_MIPS) {
 			reltype = R_MIPS_32;
 			is_fake_mcount32 = MIPS32_is_fake_mcount;
@@ -384,8 +386,10 @@ do_file(char const *const fname)
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (w2(ghdr->e_machine) == EM_S390)
+		if (w2(ghdr->e_machine) == EM_S390) {
 			reltype = R_390_64;
+			mcount_adjust_64 = -8;
+		}
 		if (w2(ghdr->e_machine) == EM_MIPS) {
 			reltype = R_MIPS_64;
 			Elf64_r_sym = MIPS64_r_sym;
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 414e7f5..858966a 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -243,12 +243,14 @@ if ($arch eq "x86_64") {
 
 } elsif ($arch eq "s390" && $bits == 32) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
+    $mcount_adjust = -4;
     $alignment = 4;
     $ld .= " -m elf_s390";
     $cc .= " -m31";
 
 } elsif ($arch eq "s390" && $bits == 64) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
+    $mcount_adjust = -8;
     $alignment = 8;
     $type = ".quad";
     $ld .= " -m elf64_s390";
-- 
1.7.4.4



  parent reply	other threads:[~2011-05-18 16:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 16:08 [PATCH 00/15] [GIT PULL] ftrace/recordmcount: cleanups and updates for recordmcount processing Steven Rostedt
2011-05-18 16:08 ` [PATCH 01/15] ftrace/kbuild: Add recordmcount files to force full build Steven Rostedt
2011-05-18 16:08 ` [PATCH 02/15] ftrace/trivial: Clean up recordmcount.c to use Linux style Steven Rostedt
2011-05-18 16:08 ` [PATCH 03/15] ftrace/trivial: Clean up record mcount to use Linux switch style Steven Rostedt
2011-05-18 16:08 ` [PATCH 04/15] ftrace: Add .kprobe.text section to whitelist for recordmcount.c Steven Rostedt
2011-05-18 16:08 ` [PATCH 05/15] ftrace/recordmcount: Modify only executable sections Steven Rostedt
2011-05-18 16:08 ` [PATCH 06/15] ftrace/recordmcount: Make ignored mcount calls into nops at compile Steven Rostedt
2011-05-18 16:08 ` [PATCH 07/15] ftrace/recordmcount: Add warning logic to warn on mcount not Steven Rostedt
2011-05-18 16:08 ` [PATCH 08/15] kbuild/recordmcount: Add RECORDMCOUNT_WARN to warn about mcount Steven Rostedt
2011-05-18 16:08 ` [PATCH 09/15] ftrace: Avoid recording mcount on .init sections directly Steven Rostedt
2011-05-18 16:08 ` [PATCH 10/15] ftrace/x86: Do not trace .discard.text section Steven Rostedt
2011-05-18 16:08 ` [PATCH 11/15] ftrace/recordmcount: Remove duplicate code to find mcount symbol Steven Rostedt
2011-05-18 16:08 ` [PATCH 12/15] ftrace/recordmcount: Add helper function get_sym_str_and_relp() Steven Rostedt
2011-05-18 16:08 ` [PATCH 13/15] ftrace/recordmcount: mcount address adjustment Steven Rostedt
2011-05-18 16:08 ` [PATCH 14/15] ftrace/x86: mcount offset calculation Steven Rostedt
2011-05-18 16:08 ` Steven Rostedt [this message]
2011-05-18 16:28 ` [PATCH 00/15] [GIT PULL] ftrace/recordmcount: cleanups and updates for recordmcount processing Steven Rostedt
2011-05-18 18:13   ` Ingo Molnar
2011-05-18 18:52     ` Steven Rostedt
2011-05-18 18:02 ` Ingo Molnar

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=20110518160909.877357918@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=schwidefsky@de.ibm.com \
    /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 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.