Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: tracing: Update fprobe documentation

Update fprobe.rst for
- the private entry_data argument
- the return value of the entry handler
- the nr_rethook_node field.

Link: https://lkml.kernel.org/r/167526701579.433354.3057889264263546659.stgit@mhiramat.roam.corp.google.com

Cc: Florent Revest <revest@chromium.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Masami Hiramatsu (Google) and committed by
Steven Rostedt (Google)
8be098a9 87de2163

+12 -4
+12 -4
Documentation/trace/fprobe.rst
··· 87 87 The fprobe entry/exit handler 88 88 ============================= 89 89 90 - The prototype of the entry/exit callback function is as follows: 90 + The prototype of the entry/exit callback function are as follows: 91 91 92 92 .. code-block:: c 93 93 94 - void callback_func(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs); 94 + int entry_callback(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs, void *entry_data); 95 95 96 - Note that both entry and exit callbacks have same ptototype. The @entry_ip is 97 - saved at function entry and passed to exit handler. 96 + void exit_callback(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs, void *entry_data); 97 + 98 + Note that the @entry_ip is saved at function entry and passed to exit handler. 99 + If the entry callback function returns !0, the corresponding exit callback will be cancelled. 98 100 99 101 @fp 100 102 This is the address of `fprobe` data structure related to this handler. ··· 114 112 in the entry_handler. If you need traced instruction pointer, you need 115 113 to use @entry_ip. On the other hand, in the exit_handler, the instruction 116 114 pointer of @regs is set to the currect return address. 115 + 116 + @entry_data 117 + This is a local storage to share the data between entry and exit handlers. 118 + This storage is NULL by default. If the user specify `exit_handler` field 119 + and `entry_data_size` field when registering the fprobe, the storage is 120 + allocated and passed to both `entry_handler` and `exit_handler`. 117 121 118 122 Share the callbacks with kprobes 119 123 ================================