Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118015
b: refs/heads/master
c: 8115f3f
h: refs/heads/master
i:
  118013: 514ba0e
  118011: 2f1e611
  118007: e1865e8
  117999: 662b54a
  117983: 7caff22
  117951: 3a62ebb
  117887: 4c4054b
  117759: 4a083c3
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 27, 2008
1 parent 5927992 commit c3f2c6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea31e72d753e5817a97de552f152d0cb55c7defc
refs/heads/master: 8115f3f0c939c5db0fe3c6c6c58911fd3a205b1e
16 changes: 5 additions & 11 deletions trunk/arch/x86/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include <asm/nops.h>


/* Long is fine, even if it is only 4 bytes ;-) */
static unsigned long *ftrace_nop;
static unsigned char ftrace_nop[MCOUNT_INSN_SIZE];

union ftrace_code_union {
char code[MCOUNT_INSN_SIZE];
Expand All @@ -40,7 +39,7 @@ static int ftrace_calc_offset(long ip, long addr)

unsigned char *ftrace_nop_replace(void)
{
return (char *)ftrace_nop;
return ftrace_nop;
}

unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
Expand Down Expand Up @@ -125,9 +124,6 @@ int __init ftrace_dyn_arch_init(void *data)
* TODO: check the cpuid to determine the best nop.
*/
asm volatile (
"jmp ftrace_test_jmp\n"
/* This code needs to stay around */
".section .text, \"ax\"\n"
"ftrace_test_jmp:"
"jmp ftrace_test_p6nop\n"
"nop\n"
Expand All @@ -138,8 +134,6 @@ int __init ftrace_dyn_arch_init(void *data)
"jmp 1f\n"
"ftrace_test_nop5:"
".byte 0x66,0x66,0x66,0x66,0x90\n"
"jmp 1f\n"
".previous\n"
"1:"
".section .fixup, \"ax\"\n"
"2: movl $1, %0\n"
Expand All @@ -154,15 +148,15 @@ int __init ftrace_dyn_arch_init(void *data)
switch (faulted) {
case 0:
pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n");
ftrace_nop = (unsigned long *)ftrace_test_p6nop;
memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE);
break;
case 1:
pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n");
ftrace_nop = (unsigned long *)ftrace_test_nop5;
memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE);
break;
case 2:
pr_info("ftrace: converting mcount calls to jmp . + 5\n");
ftrace_nop = (unsigned long *)ftrace_test_jmp;
memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE);
break;
}

Expand Down

0 comments on commit c3f2c6a

Please sign in to comment.