diff options
| author | Randy Dunlap <randy.dunlap@oracle.com> | 2009-12-18 18:17:12 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-12-20 00:18:25 -0500 |
| commit | 7e25f44cbf8d95a9748fdfd19c06145f19fd10e3 (patch) | |
| tree | 322b285cd945b9eabb9ffdcb69919c9041b7f114 | |
| parent | b41df645c829d961068aecd30909c2675acbaaea (diff) | |
Documentation: Update ftrace-design.txt
Correct grammos. Spell out words. Add missing words.
Consistent use of "mcount()" function name.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <4B2C0D78.6060707@oracle.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | Documentation/trace/ftrace-design.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt index 641a1ef2a7ff..239f14b2b55a 100644 --- a/Documentation/trace/ftrace-design.txt +++ b/Documentation/trace/ftrace-design.txt | |||
| @@ -53,14 +53,14 @@ size of the mcount call that is embedded in the function). | |||
| 53 | For example, if the function foo() calls bar(), when the bar() function calls | 53 | For example, if the function foo() calls bar(), when the bar() function calls |
| 54 | mcount(), the arguments mcount() will pass to the tracer are: | 54 | mcount(), the arguments mcount() will pass to the tracer are: |
| 55 | "frompc" - the address bar() will use to return to foo() | 55 | "frompc" - the address bar() will use to return to foo() |
| 56 | "selfpc" - the address bar() (with _mcount() size adjustment) | 56 | "selfpc" - the address bar() (with mcount() size adjustment) |
| 57 | 57 | ||
| 58 | Also keep in mind that this mcount function will be called *a lot*, so | 58 | Also keep in mind that this mcount function will be called *a lot*, so |
| 59 | optimizing for the default case of no tracer will help the smooth running of | 59 | optimizing for the default case of no tracer will help the smooth running of |
| 60 | your system when tracing is disabled. So the start of the mcount function is | 60 | your system when tracing is disabled. So the start of the mcount function is |
| 61 | typically the bare min with checking things before returning. That also means | 61 | typically the bare minimum with checking things before returning. That also |
| 62 | the code flow should usually kept linear (i.e. no branching in the nop case). | 62 | means the code flow should usually be kept linear (i.e. no branching in the nop |
| 63 | This is of course an optimization and not a hard requirement. | 63 | case). This is of course an optimization and not a hard requirement. |
| 64 | 64 | ||
| 65 | Here is some pseudo code that should help (these functions should actually be | 65 | Here is some pseudo code that should help (these functions should actually be |
| 66 | implemented in assembly): | 66 | implemented in assembly): |
| @@ -131,10 +131,10 @@ some functions to save (hijack) and restore the return address. | |||
| 131 | 131 | ||
| 132 | The mcount function should check the function pointers ftrace_graph_return | 132 | The mcount function should check the function pointers ftrace_graph_return |
| 133 | (compare to ftrace_stub) and ftrace_graph_entry (compare to | 133 | (compare to ftrace_stub) and ftrace_graph_entry (compare to |
| 134 | ftrace_graph_entry_stub). If either of those are not set to the relevant stub | 134 | ftrace_graph_entry_stub). If either of those is not set to the relevant stub |
| 135 | function, call the arch-specific function ftrace_graph_caller which in turn | 135 | function, call the arch-specific function ftrace_graph_caller which in turn |
| 136 | calls the arch-specific function prepare_ftrace_return. Neither of these | 136 | calls the arch-specific function prepare_ftrace_return. Neither of these |
| 137 | function names are strictly required, but you should use them anyways to stay | 137 | function names is strictly required, but you should use them anyway to stay |
| 138 | consistent across the architecture ports -- easier to compare & contrast | 138 | consistent across the architecture ports -- easier to compare & contrast |
| 139 | things. | 139 | things. |
| 140 | 140 | ||
| @@ -144,7 +144,7 @@ but the first argument should be a pointer to the "frompc". Typically this is | |||
| 144 | located on the stack. This allows the function to hijack the return address | 144 | located on the stack. This allows the function to hijack the return address |
| 145 | temporarily to have it point to the arch-specific function return_to_handler. | 145 | temporarily to have it point to the arch-specific function return_to_handler. |
| 146 | That function will simply call the common ftrace_return_to_handler function and | 146 | That function will simply call the common ftrace_return_to_handler function and |
| 147 | that will return the original return address with which, you can return to the | 147 | that will return the original return address with which you can return to the |
| 148 | original call site. | 148 | original call site. |
| 149 | 149 | ||
| 150 | Here is the updated mcount pseudo code: | 150 | Here is the updated mcount pseudo code: |
