diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-05-10 04:10:43 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-05-16 15:05:06 -0400 |
commit | f29638868280534ed7e2fdd93b31557232597940 (patch) | |
tree | df11bf6f18442c29b5c76566560e8874c040d9d4 | |
parent | 521ccb5c4aece609311bfa7157910a8f0c942af5 (diff) |
ftrace/s390: mcount offset calculation
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>
-rw-r--r-- | arch/s390/include/asm/ftrace.h | 4 | ||||
-rw-r--r-- | scripts/recordmcount.c | 8 | ||||
-rwxr-xr-x | 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 3c29be4836ed..b7931faaef6d 100644 --- a/arch/s390/include/asm/ftrace.h +++ b/arch/s390/include/asm/ftrace.h | |||
@@ -11,15 +11,13 @@ struct dyn_arch_ftrace { }; | |||
11 | 11 | ||
12 | #ifdef CONFIG_64BIT | 12 | #ifdef CONFIG_64BIT |
13 | #define MCOUNT_INSN_SIZE 12 | 13 | #define MCOUNT_INSN_SIZE 12 |
14 | #define MCOUNT_OFFSET 8 | ||
15 | #else | 14 | #else |
16 | #define MCOUNT_INSN_SIZE 20 | 15 | #define MCOUNT_INSN_SIZE 20 |
17 | #define MCOUNT_OFFSET 4 | ||
18 | #endif | 16 | #endif |
19 | 17 | ||
20 | static inline unsigned long ftrace_call_adjust(unsigned long addr) | 18 | static inline unsigned long ftrace_call_adjust(unsigned long addr) |
21 | { | 19 | { |
22 | return addr - MCOUNT_OFFSET; | 20 | return addr; |
23 | } | 21 | } |
24 | 22 | ||
25 | #endif /* __ASSEMBLY__ */ | 23 | #endif /* __ASSEMBLY__ */ |
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 7648a5d11154..ee52cb8e17ad 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c | |||
@@ -368,8 +368,10 @@ do_file(char const *const fname) | |||
368 | "unrecognized ET_REL file: %s\n", fname); | 368 | "unrecognized ET_REL file: %s\n", fname); |
369 | fail_file(); | 369 | fail_file(); |
370 | } | 370 | } |
371 | if (w2(ehdr->e_machine) == EM_S390) | 371 | if (w2(ehdr->e_machine) == EM_S390) { |
372 | reltype = R_390_32; | 372 | reltype = R_390_32; |
373 | mcount_adjust_32 = -4; | ||
374 | } | ||
373 | if (w2(ehdr->e_machine) == EM_MIPS) { | 375 | if (w2(ehdr->e_machine) == EM_MIPS) { |
374 | reltype = R_MIPS_32; | 376 | reltype = R_MIPS_32; |
375 | is_fake_mcount32 = MIPS32_is_fake_mcount; | 377 | is_fake_mcount32 = MIPS32_is_fake_mcount; |
@@ -384,8 +386,10 @@ do_file(char const *const fname) | |||
384 | "unrecognized ET_REL file: %s\n", fname); | 386 | "unrecognized ET_REL file: %s\n", fname); |
385 | fail_file(); | 387 | fail_file(); |
386 | } | 388 | } |
387 | if (w2(ghdr->e_machine) == EM_S390) | 389 | if (w2(ghdr->e_machine) == EM_S390) { |
388 | reltype = R_390_64; | 390 | reltype = R_390_64; |
391 | mcount_adjust_64 = -8; | ||
392 | } | ||
389 | if (w2(ghdr->e_machine) == EM_MIPS) { | 393 | if (w2(ghdr->e_machine) == EM_MIPS) { |
390 | reltype = R_MIPS_64; | 394 | reltype = R_MIPS_64; |
391 | Elf64_r_sym = MIPS64_r_sym; | 395 | Elf64_r_sym = MIPS64_r_sym; |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 414e7f5e42ec..858966ab019c 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -243,12 +243,14 @@ if ($arch eq "x86_64") { | |||
243 | 243 | ||
244 | } elsif ($arch eq "s390" && $bits == 32) { | 244 | } elsif ($arch eq "s390" && $bits == 32) { |
245 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$"; | 245 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$"; |
246 | $mcount_adjust = -4; | ||
246 | $alignment = 4; | 247 | $alignment = 4; |
247 | $ld .= " -m elf_s390"; | 248 | $ld .= " -m elf_s390"; |
248 | $cc .= " -m31"; | 249 | $cc .= " -m31"; |
249 | 250 | ||
250 | } elsif ($arch eq "s390" && $bits == 64) { | 251 | } elsif ($arch eq "s390" && $bits == 64) { |
251 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; | 252 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; |
253 | $mcount_adjust = -8; | ||
252 | $alignment = 8; | 254 | $alignment = 8; |
253 | $type = ".quad"; | 255 | $type = ".quad"; |
254 | $ld .= " -m elf64_s390"; | 256 | $ld .= " -m elf64_s390"; |