All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
To: linux-trace-kernel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	mhiramat@kernel.org, Florent Revest <revest@chromium.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>
Subject: [RFC PATCH 7/9] docs: tracing: Update fprobe documentation
Date: Wed,  9 Nov 2022 00:50:16 +0900	[thread overview]
Message-ID: <166792261641.919356.4627265153244048545.stgit@devnote3> (raw)
In-Reply-To: <166792255429.919356.14116090269057513181.stgit@devnote3>

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

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

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 Documentation/trace/fprobe.rst |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/Documentation/trace/fprobe.rst b/Documentation/trace/fprobe.rst
index b64bec1ce144..40dd2fbce861 100644
--- a/Documentation/trace/fprobe.rst
+++ b/Documentation/trace/fprobe.rst
@@ -87,14 +87,16 @@ returns as same as unregister_ftrace_function().
 The fprobe entry/exit handler
 =============================
 
-The prototype of the entry/exit callback function is as follows:
+The prototype of the entry/exit callback function are as follows:
 
 .. code-block:: c
 
- void callback_func(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs);
+ int entry_callback(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs, void *entry_data);
 
-Note that both entry and exit callbacks have same ptototype. The @entry_ip is
-saved at function entry and passed to exit handler.
+ void exit_callback(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs, void *entry_data);
+
+Note that the @entry_ip is saved at function entry and passed to exit handler.
+If the entry callback function returns !0, the corresponding exit callback will be cancelled.
 
 @fp
         This is the address of `fprobe` data structure related to this handler.
@@ -113,6 +115,12 @@ saved at function entry and passed to exit handler.
         to use @entry_ip. On the other hand, in the exit_handler, the instruction
         pointer of @regs is set to the currect return address.
 
+@entry_data
+        This is a local storage to share the data between entry and exit handlers.
+        This storage is NULL by default. If the user specify `exit_handler` field
+        and `entry_data_size` field when registering the fprobe, the storage is
+        allocated and passed to both `entry_handler` and `exit_handler`.
+
 Share the callbacks with kprobes
 ================================
 


  parent reply	other threads:[~2022-11-08 15:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 15:49 [RFC PATCH 0/9] tracing: Add fprobe events Masami Hiramatsu (Google)
2022-11-08 15:49 ` [RFC PATCH 1/9] fprobe: Pass entry_data to handlers Masami Hiramatsu (Google)
2023-01-18  1:43   ` Steven Rostedt
2023-01-20  3:48     ` Masami Hiramatsu
2022-11-08 15:49 ` [RFC PATCH 2/9] lib/test_fprobe: Add private entry_data testcases Masami Hiramatsu (Google)
2022-11-08 15:49 ` [RFC PATCH 3/9] fprobe: Add nr_maxactive to specify rethook_node pool size Masami Hiramatsu (Google)
2022-11-08 15:49 ` [RFC PATCH 4/9] lib/test_fprobe: Add a test case for nr_maxactive Masami Hiramatsu (Google)
2022-11-08 15:49 ` [RFC PATCH 5/9] fprobe: Skip exit_handler if entry_handler returns !0 Masami Hiramatsu (Google)
2022-11-08 15:50 ` [RFC PATCH 6/9] lib/test_fprobe: Add a testcase for skipping exit_handler Masami Hiramatsu (Google)
2022-11-08 15:50 ` Masami Hiramatsu (Google) [this message]
2022-11-08 15:50 ` [RFC PATCH 8/9] fprobe: Pass return address to the handlers Masami Hiramatsu (Google)
2022-11-08 15:50 ` [RFC PATCH 9/9] tracing/probes: Add fprobe-events Masami Hiramatsu (Google)
2023-01-18 22:43   ` Steven Rostedt
2023-01-20 11:55     ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=166792261641.919356.4627265153244048545.stgit@devnote3 \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=revest@chromium.org \
    --cc=rostedt@goodmis.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.