summaryrefslogtreecommitdiffstats
path: root/Documentation/trace
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@intel.com>2018-02-17 00:39:36 -0500
committerJonathan Corbet <corbet@lwn.net>2018-03-07 12:23:01 -0500
commitb3fdd1f92c1a12b2feda08fcad8ef29a40759bd2 (patch)
tree4126fce9f61558d92ae716831af510d1bf98929e /Documentation/trace
parentfcdeddc9fdf934f1e9c05a2fef3ac78222767411 (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')
-rw-r--r--Documentation/trace/ftrace-uses.rst23
-rw-r--r--Documentation/trace/index.rst1
2 files changed, 13 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
22The ftrace context 22The ftrace context
23================== 23==================
24.. warning::
24 25
25WARNING: 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
26kernel 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
28going 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.
29This 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
30can be called outside the protective scope of RCU. 31 can be called outside the protective scope of RCU.
31 32
32The ftrace infrastructure has some protections agains recursions and RCU 33The ftrace infrastructure has some protections agains recursions and RCU
33but one must still be very careful how they use the callbacks. 34but one must still be very careful how they use the callbacks.
@@ -54,15 +55,15 @@ an ftrace_ops with ftrace:
54 55
55Both .flags and .private are optional. Only .func is required. 56Both .flags and .private are optional. Only .func is required.
56 57
57To enable tracing call:: 58To enable tracing call:
58 59
59.. c:function:: register_ftrace_function(&ops); 60.. c:function:: register_ftrace_function(&ops);
60 61
61To disable tracing call:: 62To disable tracing call:
62 63
63.. c:function:: unregister_ftrace_function(&ops); 64.. c:function:: unregister_ftrace_function(&ops);
64 65
65The above is defined by including the header:: 66The 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
201See Filter Commands in :file:`Documentation/trace/ftrace.txt`. 202See Filter Commands in :file:`Documentation/trace/ftrace.txt`.
202 203
203To just trace the schedule function:: 204To 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
211with new functions defined by @buf, have @reset be non-zero. 212with new functions defined by @buf, have @reset be non-zero.
212 213
213To remove all the filtered functions and trace all functions:: 214To remove all the filtered functions and trace all functions:
214 215
215.. code-block:: c 216.. code-block:: c
216 217
diff --git a/Documentation/trace/index.rst b/Documentation/trace/index.rst
index c8000babe508..aa2baad9edf3 100644
--- a/Documentation/trace/index.rst
+++ b/Documentation/trace/index.rst
@@ -6,3 +6,4 @@ Linux Tracing Technologies
6 :maxdepth: 2 6 :maxdepth: 2
7 7
8 ftrace-design 8 ftrace-design
9 ftrace-uses