Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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>
  • Loading branch information...
commit f29638868280534ed7e2fdd93b31557232597940 1 parent 521ccb5
Martin Schwidefsky authored rostedt committed
4 arch/s390/include/asm/ftrace.h
@@ -11,15 +11,13 @@ struct dyn_arch_ftrace { };
11 11
12 12 #ifdef CONFIG_64BIT
13 13 #define MCOUNT_INSN_SIZE 12
14   -#define MCOUNT_OFFSET 8
15 14 #else
16 15 #define MCOUNT_INSN_SIZE 20
17   -#define MCOUNT_OFFSET 4
18 16 #endif
19 17
20 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 23 #endif /* __ASSEMBLY__ */
8 scripts/recordmcount.c
@@ -368,8 +368,10 @@ do_file(char const *const fname)
368 368 "unrecognized ET_REL file: %s\n", fname);
369 369 fail_file();
370 370 }
371   - if (w2(ehdr->e_machine) == EM_S390)
  371 + if (w2(ehdr->e_machine) == EM_S390) {
372 372 reltype = R_390_32;
  373 + mcount_adjust_32 = -4;
  374 + }
373 375 if (w2(ehdr->e_machine) == EM_MIPS) {
374 376 reltype = R_MIPS_32;
375 377 is_fake_mcount32 = MIPS32_is_fake_mcount;
@@ -384,8 +386,10 @@ do_file(char const *const fname)
384 386 "unrecognized ET_REL file: %s\n", fname);
385 387 fail_file();
386 388 }
387   - if (w2(ghdr->e_machine) == EM_S390)
  389 + if (w2(ghdr->e_machine) == EM_S390) {
388 390 reltype = R_390_64;
  391 + mcount_adjust_64 = -8;
  392 + }
389 393 if (w2(ghdr->e_machine) == EM_MIPS) {
390 394 reltype = R_MIPS_64;
391 395 Elf64_r_sym = MIPS64_r_sym;
2  scripts/recordmcount.pl
@@ -243,12 +243,14 @@ sub check_objcopy
243 243
244 244 } elsif ($arch eq "s390" && $bits == 32) {
245 245 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
  246 + $mcount_adjust = -4;
246 247 $alignment = 4;
247 248 $ld .= " -m elf_s390";
248 249 $cc .= " -m31";
249 250
250 251 } elsif ($arch eq "s390" && $bits == 64) {
251 252 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
  253 + $mcount_adjust = -8;
252 254 $alignment = 8;
253 255 $type = ".quad";
254 256 $ld .= " -m elf64_s390";

0 comments on commit f296388

Please sign in to comment.
Something went wrong with that request. Please try again.