.. | .. |
---|
55 | 55 | |
---|
56 | 56 | Both .flags and .private are optional. Only .func is required. |
---|
57 | 57 | |
---|
58 | | -To enable tracing call: |
---|
| 58 | +To enable tracing call:: |
---|
59 | 59 | |
---|
60 | | -.. c:function:: register_ftrace_function(&ops); |
---|
| 60 | + register_ftrace_function(&ops); |
---|
61 | 61 | |
---|
62 | | -To disable tracing call: |
---|
| 62 | +To disable tracing call:: |
---|
63 | 63 | |
---|
64 | | -.. c:function:: unregister_ftrace_function(&ops); |
---|
| 64 | + unregister_ftrace_function(&ops); |
---|
65 | 65 | |
---|
66 | | -The above is defined by including the header: |
---|
| 66 | +The above is defined by including the header:: |
---|
67 | 67 | |
---|
68 | | -.. c:function:: #include <linux/ftrace.h> |
---|
| 68 | + #include <linux/ftrace.h> |
---|
69 | 69 | |
---|
70 | 70 | The registered callback will start being called some time after the |
---|
71 | 71 | register_ftrace_function() is called and before it returns. The exact time |
---|
.. | .. |
---|
146 | 146 | itself or any nested functions that those functions call. |
---|
147 | 147 | |
---|
148 | 148 | 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), |
---|
150 | 150 | but this is not guaranteed. |
---|
151 | 151 | |
---|
152 | 152 | FTRACE_OPS_FL_IPMODIFY |
---|
.. | .. |
---|
170 | 170 | a callback may be executed and RCU synchronization will not protect |
---|
171 | 171 | it. |
---|
172 | 172 | |
---|
| 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 | + |
---|
173 | 181 | |
---|
174 | 182 | Filtering which functions to trace |
---|
175 | 183 | ================================== |
---|