From patchwork Sun Sep 24 13:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 144078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp668238vqu; Sun, 24 Sep 2023 06:37:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwbmSQ+O/fHU4OBo1DoISkZhrkLyOm4qz4wGjS8va332ToXiufFGqM+yoZj6DAxJO1QXf1 X-Received: by 2002:a05:6358:912:b0:143:8ea6:483 with SMTP id r18-20020a056358091200b001438ea60483mr4825588rwi.0.1695562650348; Sun, 24 Sep 2023 06:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695562650; cv=none; d=google.com; s=arc-20160816; b=EZaPCyjC78pOxCREVODb/z4Sa8Lqo7UryOmH3b7/G3GFzo5Dy4WcGpa8qWhZvWwobK +25jy1k84hyrx49jS7cv1crl28K+HXVSdEnXXWyetCd78iPVWz/+5fEWqBhWooqih59Z 5Bx5EEqf8Yqv+CjkHrEYqCJQWDobGW64ZZ+yr16RzcMkgGbON8gha1tq0XByZRBYstxC PPqIlJnn5YaD5GPVrHEfxFOIH4EaICVkyvgEyvvOeN+up/mzY4M2FwKmz8/XrJpQqu7V 0jZEaoc649pO4V/Scv21f022NQL6aoKBNBf/QssYb7tpZDTDziWHZ+BGEeXAlehKeLgT vacQ== 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 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b00582f2161cb4si290289pgb.300.2023.09.24.06.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 06:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; 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 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 4DDB9807C74C; Sun, 24 Sep 2023 06:37:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbjIXNh0 (ORCPT + 30 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 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Sun, 24 Sep 2023 06:37:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777926301708284511 X-GMAIL-MSGID: 1777926301708284511 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