From patchwork Sat Aug 12 05:36:47 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: 134816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp1536803vqi; Fri, 11 Aug 2023 22:47:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGe3RZVzRo1JBu1V+7Irpqvfqc7KW6oHqpc16uOEg2hw/PvWWFOSxQq7ID11TiLJIW/hkq9 X-Received: by 2002:a17:907:b1a:b0:99c:e38d:a824 with SMTP id h26-20020a1709070b1a00b0099ce38da824mr3082723ejl.37.1691819256570; Fri, 11 Aug 2023 22:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691819256; cv=none; d=google.com; s=arc-20160816; b=flaeTXug7uqS4AESto/zoBRRsIEMEZIoVri1IOtxUxO3Q4NRJaz7ZMpIB/97V3/lym cyeGlx90Qbbj1zpI6/JXDa/L32I9A5v7hQjSTTOmBJcEd0IO1RyfmnyaKaIrYCRRylJC wWSuzAdDlKoAa7rHcILc6Y8cQ6iQ1+U1VFVNukjJAuccoMyw2XoU6N9AGIrFwxHHoLN1 7jZXSjSorXBpgk2ugmnIwx3/vgP1WgYgwvbk7dSn6D0pcisoYIj1q11BU+jXJZpsrD86 +hur94lCbLe6liYGBur/eEj0O6H4JcQZW8PIg2wjjitVkW15LzsbcsWYQ8beagiPQy3J Ujqg== 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=wUhRWi46TgpGHrD08iF4tDbJawrcCfYsFt4z2PuaRXY=; fh=nNLeqPmm07c4DrdDej5z+HdJpmx5SqFFnpeka2nrMVM=; b=PUwvmqO3RjEsvrOgks9rFQIBEwldEwWU72pPkiIlc8/lrmEqhM4AZ2uW8tY5iXtemg iUOniTWElmhLnxr/lyTtbmrWENbPYOGvhAMXq1U0hu5Aez+B9TplHlAEnKH/gwYZyEb1 DW1Dytv9mW/4SffOShmzFFplNQGLANdfKKC/yTxcs+gV9hCpk6Lqm8kxTT4QNECGAtHa LJuY5swajVra3V+clLFQYhsC5RjhKUCvo8p0qnkWU7GL62le27SodRC+7YoZVtW0bKwh 4q+gcgfP5AHtm0eOMUdwFTbuD2LLgCUnt+RS3vNEZeDY3ovzU82R/Yya2BGk3imgzhRf UjNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GrCcvdTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa1-20020a170907b9c100b009930e13beb8si4773848ejc.952.2023.08.11.22.47.12; Fri, 11 Aug 2023 22:47:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GrCcvdTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235898AbjHLFg7 (ORCPT + 99 others); Sat, 12 Aug 2023 01:36:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235893AbjHLFg4 (ORCPT ); Sat, 12 Aug 2023 01:36:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C111E30C1; Fri, 11 Aug 2023 22:36:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 544AC63FC8; Sat, 12 Aug 2023 05:36:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 337D9C433C8; Sat, 12 Aug 2023 05:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691818613; bh=blEGHkYpfxZ/1E7WBPNHsUXM+7p3REUp7I8zSsGXqWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GrCcvdTy2YsEo6/vYNC3BwLrflolqioYyx+EYQOJp/1Pz/a5YY3sXMpalYrFs0R0j JUIQSw6pgmUv7Tfe9wyv74ePTOsgjbJ3zwxZV2V0HsR2T0KIDU+TKt4kyMg3cTp+X5 sgQY9Q3NR8p/0zQgnqUQ2qwfpMYUr4xvNEMNKfoliizh9wDQVmxeP/xLrtDBOiwR8v C8h96HzSoorF4DAxA+c4aPR2TZCDrAJ++rqFMe+xEY2Sb4pKSIXPsm1i1atzc2+VcK ie96vOscAPAGsPQPlipmD8M4ucicOAATf3OSw7n6GFcAI1LuilADu3ZHxycQ/at05l HJLuWZRu2LpQA== 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 Subject: [PATCH v3 1/8] Documentation: probes: Add a new ret_ip callback parameter Date: Sat, 12 Aug 2023 14:36:47 +0900 Message-Id: <169181860742.505132.14215380532909911090.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <169181859570.505132.10136520092011157898.stgit@devnote2> References: <169181859570.505132.10136520092011157898.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774001069016413374 X-GMAIL-MSGID: 1774001069016413374 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) --- 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 40dd2fbce861..a6d682478147 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 of the traced function. 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