Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp662161rdh; Sun, 24 Sep 2023 06:37:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7avBkbRleENhJD6jHuWQfdtwJnqJQoyaCi1qI8bMsuQfgXLmUS6v83rdcfKgOBcc0gSLf X-Received: by 2002:a05:6808:992:b0:3ab:83fe:e18f with SMTP id a18-20020a056808099200b003ab83fee18fmr4291684oic.35.1695562647178; Sun, 24 Sep 2023 06:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695562647; cv=none; d=google.com; s=arc-20160816; b=h3YNErA7CyWigG551ZLMjfoPTcSVA3q3HK0KuiOTgoAkKLZD1Gn2wyH3cQ1g2i6Zs1 LxTJu7ErCNpx98xS2SXD50QJDYtfLa/fLVZWspGA4nXgezP8pD5Cb8yIVF+G6qcGxeu1 ClsuknZj3IrM8fE9FaLetBbzDuZoW/+DHMT+4JKiIstX+YdmfsXX/7L+hYKUmg5DqJRD csb9erGVlPNotk8PKJA3zbit5coPSnVGBOLzRHp/DG+qSu+81ux5AhaPwAFrrcgKwxak Z+jK5fUCcL4rBEwSlFQHg7v0NMpDkjrTOWDlp0p29GDcBmgeo5oQgePFwDxg2cmlQXDa PiMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wokmZOHmg7bNlKeqKWMyYA8YtfNcuv7/ZzTJJcuKqeE=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=Tu4EMGuwXt3Zj8RBH9hryXQpmFuOtNOHEthCzwaxEadiN8f1oA4sDzenpuEdkR0ezd cVuGhm3Hr6yIWuIKncyzVph9HB54YIHLk50Wdw3dzpWeQ5EWD2tAkTUccUGm0eRkVOts BgpCbpLWPu0e4zvlhvrBIr5Va8CYiwpswZr6MP+9W7a203lP/fz6VUQWRqAxcdbBMJNt ZovYu0xoXo2Lm8zvKhJXVH+fxGiT4nVmhfy5PLs7cgi9wsvre4lNlqd9KeUaofC42kVa kKjFBzHwTct+OVmgFPktl4wlpiNx1brCjg3Ptjc/lN9lUFxD3YIuX2RhKQJb3hzFQErF tA5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LmvhuVJM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cn1-20020a056a020a8100b00563de199314si7743804pgb.896.2023.09.24.06.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 06:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LmvhuVJM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 00AB9830D345; Sun, 24 Sep 2023 06:37:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbjIXNh0 (ORCPT + 99 others); Sun, 24 Sep 2023 09:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbjIXNhK (ORCPT ); Sun, 24 Sep 2023 09:37:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A42FCC2 for ; Sun, 24 Sep 2023 06:36:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48650C433C8; Sun, 24 Sep 2023 13:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695562578; bh=+UQOaXyf7wYEVeoHCkzfXpWdvixzMC9xY2Nvd7e4ziM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LmvhuVJMBb4WW8ut2rEFn6UqOgvJDGGewzA/jDlUL48jPr1c/bNobdkx2NKnlo7Jh lB9eKDPuxclzehBqTqfcTwjLmnEf9wRDc2SmVrkIecey2MC6t/4LCd1sjEkTRPeNBX bwHYgiQagiGiYzkqeV1iTB8DaunYCY6ephxg16OGbHls7bo9Ng0r5CcWbHScWgp0eW h/0EMkw1VNjh7Gsh4nlyJglbvbbtB0QKLVHb/B5iX9tGvJ+nnEodkvqM6AKs1B3S0y 0/FECAJYwyA9GXlPDxNsMBaHSxvg0rhn12xppztVkaGfeU70D8ksb+2iRyocUnNab6 VbbnhtgTPd/Eg== From: "Masami Hiramatsu (Google)" To: Alexei Starovoitov , Steven Rostedt , Florent Revest Cc: linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: [PATCH v5 02/12] Documentation: probes: Add a new ret_ip callback parameter Date: Sun, 24 Sep 2023 22:36:11 +0900 Message-Id: <169556257133.146934.13560704846459957726.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <169556254640.146934.5654329452696494756.stgit@devnote2> References: <169556254640.146934.5654329452696494756.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 24 Sep 2023 06:37:26 -0700 (PDT) From: Masami Hiramatsu (Google) Add a new ret_ip callback parameter description. Fixes: cb16330d1274 ("fprobe: Pass return address to the handlers") Signed-off-by: Masami Hiramatsu (Google) Acked-by: Florent Revest --- Changes in v4: - Update ret_ip description (Thanks Florent!) --- Documentation/trace/fprobe.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/trace/fprobe.rst b/Documentation/trace/fprobe.rst index 7a895514b537..196f52386aaa 100644 --- a/Documentation/trace/fprobe.rst +++ b/Documentation/trace/fprobe.rst @@ -91,9 +91,9 @@ The prototype of the entry/exit callback function are as follows: .. code-block:: c - int entry_callback(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs, void *entry_data); + int entry_callback(struct fprobe *fp, unsigned long entry_ip, unsigned long ret_ip, struct pt_regs *regs, void *entry_data); - void exit_callback(struct fprobe *fp, unsigned long entry_ip, struct pt_regs *regs, void *entry_data); + void exit_callback(struct fprobe *fp, unsigned long entry_ip, unsigned long ret_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. @@ -108,6 +108,10 @@ If the entry callback function returns !0, the corresponding exit callback will Note that this may not be the actual entry address of the function but the address where the ftrace is instrumented. +@ret_ip + This is the return address that the traced function will return to, + somewhere in the caller. This can be used at both entry and exit. + @regs This is the `pt_regs` data structure at the entry and exit. Note that the instruction pointer of @regs may be different from the @entry_ip