forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/Documentation/trace/ftrace-uses.rst
....@@ -55,17 +55,17 @@
5555
5656 Both .flags and .private are optional. Only .func is required.
5757
58
-To enable tracing call:
58
+To enable tracing call::
5959
60
-.. c:function:: register_ftrace_function(&ops);
60
+ register_ftrace_function(&ops);
6161
62
-To disable tracing call:
62
+To disable tracing call::
6363
64
-.. c:function:: unregister_ftrace_function(&ops);
64
+ unregister_ftrace_function(&ops);
6565
66
-The above is defined by including the header:
66
+The above is defined by including the header::
6767
68
-.. c:function:: #include <linux/ftrace.h>
68
+ #include <linux/ftrace.h>
6969
7070 The registered callback will start being called some time after the
7171 register_ftrace_function() is called and before it returns. The exact time
....@@ -146,7 +146,7 @@
146146 itself or any nested functions that those functions call.
147147
148148 If this flag is set, it is possible that the callback will also
149
- be called with preemption enabled (when CONFIG_PREEMPT is set),
149
+ be called with preemption enabled (when CONFIG_PREEMPTION is set),
150150 but this is not guaranteed.
151151
152152 FTRACE_OPS_FL_IPMODIFY
....@@ -170,6 +170,14 @@
170170 a callback may be executed and RCU synchronization will not protect
171171 it.
172172
173
+FTRACE_OPS_FL_PERMANENT
174
+ If this is set on any ftrace ops, then the tracing cannot disabled by
175
+ writing 0 to the proc sysctl ftrace_enabled. Equally, a callback with
176
+ the flag set cannot be registered if ftrace_enabled is 0.
177
+
178
+ Livepatch uses it not to lose the function redirection, so the system
179
+ stays protected.
180
+
173181
174182 Filtering which functions to trace
175183 ==================================