diff options
author | Shaohua Li <shaohua.li@intel.com> | 2009-01-08 22:29:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-14 06:11:26 -0500 |
commit | d3e75ff14bc1453c4762428395aac9953a023efc (patch) | |
tree | b25ec02c30da77257ab02b232b932308260e83ba /arch/ia64/kernel/entry.S | |
parent | 418071eb6adbfd3980b2f57f7df8e03921e3f1d7 (diff) |
ftrace, ia64: IA64 static ftrace support
IA64 ftrace suppport. In IA64, below code will be added in each function
if -pg is enabled.
alloc r40=ar.pfs,12,8,0
mov r43=r0;;
mov r42=b0
mov r41=r1
nop.i 0x0
br.call.sptk.many b0 = _mcount;;
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/ia64/kernel/entry.S')
-rw-r--r-- | arch/ia64/kernel/entry.S | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index d435f4a7a96c..c2f7d798e2a5 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/processor.h> | 47 | #include <asm/processor.h> |
48 | #include <asm/thread_info.h> | 48 | #include <asm/thread_info.h> |
49 | #include <asm/unistd.h> | 49 | #include <asm/unistd.h> |
50 | #include <asm/ftrace.h> | ||
50 | 51 | ||
51 | #include "minstate.h" | 52 | #include "minstate.h" |
52 | 53 | ||
@@ -1404,6 +1405,54 @@ GLOBAL_ENTRY(unw_init_running) | |||
1404 | br.ret.sptk.many rp | 1405 | br.ret.sptk.many rp |
1405 | END(unw_init_running) | 1406 | END(unw_init_running) |
1406 | 1407 | ||
1408 | #ifdef CONFIG_FUNCTION_TRACER | ||
1409 | GLOBAL_ENTRY(_mcount) | ||
1410 | movl r2 = ftrace_stub | ||
1411 | movl r3 = ftrace_trace_function;; | ||
1412 | ld8 r3 = [r3];; | ||
1413 | ld8 r3 = [r3];; | ||
1414 | cmp.eq p7,p0 = r2, r3 | ||
1415 | (p7) br.sptk.many ftrace_stub | ||
1416 | ;; | ||
1417 | |||
1418 | alloc loc0 = ar.pfs, 4, 4, 2, 0 | ||
1419 | ;; | ||
1420 | mov loc1 = b0 | ||
1421 | mov out0 = b0 | ||
1422 | mov loc2 = r8 | ||
1423 | mov loc3 = r15 | ||
1424 | ;; | ||
1425 | adds out0 = -MCOUNT_INSN_SIZE, out0 | ||
1426 | mov out1 = in2 | ||
1427 | mov b6 = r3 | ||
1428 | |||
1429 | br.call.sptk.many b0 = b6 | ||
1430 | ;; | ||
1431 | mov ar.pfs = loc0 | ||
1432 | mov b0 = loc1 | ||
1433 | mov r8 = loc2 | ||
1434 | mov r15 = loc3 | ||
1435 | br ftrace_stub | ||
1436 | ;; | ||
1437 | END(_mcount) | ||
1438 | |||
1439 | GLOBAL_ENTRY(ftrace_stub) | ||
1440 | mov r3 = b0 | ||
1441 | movl r2 = _mcount_ret_helper | ||
1442 | ;; | ||
1443 | mov b6 = r2 | ||
1444 | mov b7 = r3 | ||
1445 | br.ret.sptk.many b6 | ||
1446 | |||
1447 | _mcount_ret_helper: | ||
1448 | mov b0 = r42 | ||
1449 | mov r1 = r41 | ||
1450 | mov ar.pfs = r40 | ||
1451 | br b7 | ||
1452 | END(ftrace_stub) | ||
1453 | |||
1454 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
1455 | |||
1407 | .rodata | 1456 | .rodata |
1408 | .align 8 | 1457 | .align 8 |
1409 | .globl sys_call_table | 1458 | .globl sys_call_table |