diff options
author | Michal Simek <monstr@monstr.eu> | 2009-12-10 08:15:44 -0500 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-12-14 02:44:01 -0500 |
commit | 7d241ff0567b9503d79ee775c40927d09b509f83 (patch) | |
tree | 8de1af72c5643416ee427edc7e9ff2170e0d73db /arch/microblaze/kernel/mcount.S | |
parent | 6d9e60ce30a1be35491c74df00aaa25d869f8a02 (diff) |
microblaze: ftrace: Add dynamic trace support
With dynamic function tracer, by default, _mcount is defined as an
"empty" function, it returns directly without any more action. When
enabling it in user-space, it will jump to a real tracing
function(ftrace_caller), and do the real job for us.
Differ from the static function tracer, dynamic function tracer provides
two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
tracing of some indicated kernel functions(set_ftrace_filter).
In the kernel version, there is only one "_mcount" string for every
kernel function, so, we just need to match this one in mcount_regex of
scripts/recordmcount.pl.
For more information please look at code and Documentation/trace folder.
Steven ACK that scripts/recordmcount.pl part.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/mcount.S')
-rw-r--r-- | arch/microblaze/kernel/mcount.S | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/mcount.S b/arch/microblaze/kernel/mcount.S index 97eef3eea944..30aaf8fb55b2 100644 --- a/arch/microblaze/kernel/mcount.S +++ b/arch/microblaze/kernel/mcount.S | |||
@@ -83,6 +83,12 @@ ENTRY(ftrace_stub) | |||
83 | nop; | 83 | nop; |
84 | 84 | ||
85 | ENTRY(_mcount) | 85 | ENTRY(_mcount) |
86 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
87 | ENTRY(ftrace_caller) | ||
88 | /* MS: It is just barrier which is removed from C code */ | ||
89 | rtsd r15, 8 | ||
90 | nop | ||
91 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
86 | SAVE_REGS | 92 | SAVE_REGS |
87 | swi r15, r1, 0; | 93 | swi r15, r1, 0; |
88 | /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST begin of checking */ | 94 | /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST begin of checking */ |
@@ -90,12 +96,19 @@ ENTRY(_mcount) | |||
90 | bneid r5, end; | 96 | bneid r5, end; |
91 | nop; | 97 | nop; |
92 | /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */ | 98 | /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */ |
99 | #ifndef CONFIG_DYNAMIC_FTRACE | ||
93 | /* MS: test function trace if is taken or not */ | 100 | /* MS: test function trace if is taken or not */ |
94 | lwi r20, r0, ftrace_trace_function; | 101 | lwi r20, r0, ftrace_trace_function; |
95 | addik r6, r0, ftrace_stub; | 102 | addik r6, r0, ftrace_stub; |
96 | cmpu r5, r20, r6; /* ftrace_trace_function != ftrace_stub */ | 103 | cmpu r5, r20, r6; /* ftrace_trace_function != ftrace_stub */ |
97 | beqid r5, end; /* MS: not taken -> jump over */ | 104 | beqid r5, end; /* MS: not taken -> jump over */ |
98 | nop; | 105 | nop; |
106 | #else /* CONFIG_DYNAMIC_FTRACE */ | ||
107 | NOALIGN_ENTRY(ftrace_call) | ||
108 | /* instruction for setup imm FUNC_part1, addik r20, r0, FUNC_part2 */ | ||
109 | nop | ||
110 | nop | ||
111 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
99 | /* static normal trace */ | 112 | /* static normal trace */ |
100 | lwi r6, r1, 120; /* MS: load parent addr */ | 113 | lwi r6, r1, 120; /* MS: load parent addr */ |
101 | addik r5, r15, 0; /* MS: load current function addr */ | 114 | addik r5, r15, 0; /* MS: load current function addr */ |