Some C code in the ftrace-users.rst document is missing RST C block
annotation, which has to be added.
Link: https://lore.kernel.org/r/20201116173502.392a769c@canb.auug.org.au
Acked-by: Jonathan Corbet <corbet@lwn.net>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
recursion protection must be used. There are two helper functions that
can help in this regard. If you start your code with:
+.. code-block:: c
+
int bit;
bit = ftrace_test_recursion_trylock(ip, parent_ip);
and end it with:
+.. code-block:: c
+
ftrace_test_recursion_unlock(bit);
The code in between will be safe to use, even if it ends up calling a
that data or critical section will not be protected as expected. In this
case add:
+.. code-block:: c
+
if (!rcu_is_watching())
return;