diff options
author | Changbin Du <changbin.du@intel.com> | 2018-02-17 00:39:36 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2018-03-07 12:23:01 -0500 |
commit | b3fdd1f92c1a12b2feda08fcad8ef29a40759bd2 (patch) | |
tree | 4126fce9f61558d92ae716831af510d1bf98929e /Documentation/trace/ftrace-uses.rst | |
parent | fcdeddc9fdf934f1e9c05a2fef3ac78222767411 (diff) |
trace doc: add ftrace-uses.rst to doc tree
Add ftrace-uses.rst into Sphinx TOC tree. Few format issues are fixed.
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/trace/ftrace-uses.rst')
-rw-r--r-- | Documentation/trace/ftrace-uses.rst | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Documentation/trace/ftrace-uses.rst b/Documentation/trace/ftrace-uses.rst index 3aed560a12ee..998a60a93015 100644 --- a/Documentation/trace/ftrace-uses.rst +++ b/Documentation/trace/ftrace-uses.rst | |||
@@ -21,13 +21,14 @@ how to use ftrace to implement your own function callbacks. | |||
21 | 21 | ||
22 | The ftrace context | 22 | The ftrace context |
23 | ================== | 23 | ================== |
24 | .. warning:: | ||
24 | 25 | ||
25 | WARNING: The ability to add a callback to almost any function within the | 26 | The ability to add a callback to almost any function within the |
26 | kernel comes with risks. A callback can be called from any context | 27 | kernel comes with risks. A callback can be called from any context |
27 | (normal, softirq, irq, and NMI). Callbacks can also be called just before | 28 | (normal, softirq, irq, and NMI). Callbacks can also be called just before |
28 | going to idle, during CPU bring up and takedown, or going to user space. | 29 | going to idle, during CPU bring up and takedown, or going to user space. |
29 | This requires extra care to what can be done inside a callback. A callback | 30 | This requires extra care to what can be done inside a callback. A callback |
30 | can be called outside the protective scope of RCU. | 31 | can be called outside the protective scope of RCU. |
31 | 32 | ||
32 | The ftrace infrastructure has some protections agains recursions and RCU | 33 | The ftrace infrastructure has some protections agains recursions and RCU |
33 | but one must still be very careful how they use the callbacks. | 34 | but one must still be very careful how they use the callbacks. |
@@ -54,15 +55,15 @@ an ftrace_ops with ftrace: | |||
54 | 55 | ||
55 | Both .flags and .private are optional. Only .func is required. | 56 | Both .flags and .private are optional. Only .func is required. |
56 | 57 | ||
57 | To enable tracing call:: | 58 | To enable tracing call: |
58 | 59 | ||
59 | .. c:function:: register_ftrace_function(&ops); | 60 | .. c:function:: register_ftrace_function(&ops); |
60 | 61 | ||
61 | To disable tracing call:: | 62 | To disable tracing call: |
62 | 63 | ||
63 | .. c:function:: unregister_ftrace_function(&ops); | 64 | .. c:function:: unregister_ftrace_function(&ops); |
64 | 65 | ||
65 | The above is defined by including the header:: | 66 | The above is defined by including the header: |
66 | 67 | ||
67 | .. c:function:: #include <linux/ftrace.h> | 68 | .. c:function:: #include <linux/ftrace.h> |
68 | 69 | ||
@@ -200,7 +201,7 @@ match a specific pattern. | |||
200 | 201 | ||
201 | See Filter Commands in :file:`Documentation/trace/ftrace.txt`. | 202 | See Filter Commands in :file:`Documentation/trace/ftrace.txt`. |
202 | 203 | ||
203 | To just trace the schedule function:: | 204 | To just trace the schedule function: |
204 | 205 | ||
205 | .. code-block:: c | 206 | .. code-block:: c |
206 | 207 | ||
@@ -210,7 +211,7 @@ To add more functions, call the ftrace_set_filter() more than once with the | |||
210 | @reset parameter set to zero. To remove the current filter set and replace it | 211 | @reset parameter set to zero. To remove the current filter set and replace it |
211 | with new functions defined by @buf, have @reset be non-zero. | 212 | with new functions defined by @buf, have @reset be non-zero. |
212 | 213 | ||
213 | To remove all the filtered functions and trace all functions:: | 214 | To remove all the filtered functions and trace all functions: |
214 | 215 | ||
215 | .. code-block:: c | 216 | .. code-block:: c |
216 | 217 | ||