Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176115
b: refs/heads/master
c: 4f911b0
h: refs/heads/master
i:
  176113: 57bd133
  176111: 7394440
v: v3
  • Loading branch information
Michal Simek committed Dec 14, 2009
1 parent 3f55be7 commit e09db57
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0d3e66522e8f6119f002cf31e5d92d7ae73b409
refs/heads/master: 4f911b0daf0f7028a4fe792b701a48d10da36d84
28 changes: 28 additions & 0 deletions trunk/arch/microblaze/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,32 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
return ret;
}

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
unsigned int old_jump; /* saving place for jump instruction */

int ftrace_enable_ftrace_graph_caller(void)
{
unsigned int ret;
unsigned long ip = (unsigned long)(&ftrace_call_graph);

old_jump = *(unsigned int *)ip; /* save jump over instruction */
ret = ftrace_modify_code(ip, MICROBLAZE_NOP);
flush_icache();

pr_debug("%s: Replace instruction: 0x%x\n", __func__, old_jump);
return ret;
}

int ftrace_disable_ftrace_graph_caller(void)
{
unsigned int ret;
unsigned long ip = (unsigned long)(&ftrace_call_graph);

ret = ftrace_modify_code(ip, old_jump);
flush_icache();

pr_debug("%s\n", __func__);
return ret;
}
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
#endif /* CONFIG_DYNAMIC_FTRACE */
6 changes: 6 additions & 0 deletions trunk/arch/microblaze/kernel/mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ ENTRY(ftrace_caller)
nop;
/* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#ifndef CONFIG_DYNAMIC_FTRACE
lwi r5, r0, ftrace_graph_return;
addik r6, r0, ftrace_stub; /* asm implementation */
cmpu r5, r5, r6; /* ftrace_graph_return != ftrace_stub */
Expand All @@ -108,6 +109,11 @@ ENTRY(ftrace_caller)
cmpu r5, r5, r6; /* ftrace_graph_entry != ftrace_graph_entry_stub */
beqid r5, end_graph_tracer;
nop;
#else /* CONFIG_DYNAMIC_FTRACE */
NOALIGN_ENTRY(ftrace_call_graph)
/* MS: jump over graph function - replaced from C code */
bri end_graph_tracer
#endif /* CONFIG_DYNAMIC_FTRACE */
addik r5, r1, 120; /* MS: load parent addr */
addik r6, r15, 0; /* MS: load current function addr */
bralid r15, prepare_ftrace_return;
Expand Down

0 comments on commit e09db57

Please sign in to comment.