From patchwork Wed Aug 23 15:17:09 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: 136733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp807366vqm; Wed, 23 Aug 2023 17:40:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6jPgA5Y9lJbwOclz4W0EhfTwP6W/5Yu2+VEHyavMoNASPr6I3zTqDVKcZMOzjQ+2ST+ON X-Received: by 2002:a17:906:1da1:b0:99b:d580:546c with SMTP id u1-20020a1709061da100b0099bd580546cmr11694796ejh.23.1692837657638; Wed, 23 Aug 2023 17:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692837657; cv=none; d=google.com; s=arc-20160816; b=S2VH/D0Eq3cLSQ7a9jc7GYB/6JgtjaWV+qZe3+R8Vg1vHErdT8JQnbHCdeN+KN4SGA ZfBzJMBQ4mdkPldSmk4IZU33ntEq26XS9nQQtVQI7dKb834VUA7HiIgUTL0eScMkP90n BJExF+fzDwwL+Z0BIkeJiirfWNfxhS1yin310fSADKNVmAjnPIqcO7hhdB8pIvPhGBlF XYCOVc86NQLhQPBXyZET+Os9JgXdCdl7pNo7DD+zpI4MvQ50ktPZ3W+iR6sIKrzNcRT7 un2Bm7+RIvFJsdZ/XZb3YWkb5ecUCjABJBq7RTL3zEESfJRv78AmGl84V/B1WoZknj8C 1lHQ== 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=vwSY2ST/Vlfp0gGE2bdFHasZePse9yy6k+DQqsdpTGE=; fh=nNLeqPmm07c4DrdDej5z+HdJpmx5SqFFnpeka2nrMVM=; b=j7lwOLqvg1xbrDSY8WzsJ5fKnH08azV/dHOp6gLJQI5nAk36yKzamQUqok4LbbU7IF A+HrT5II0vIXVzRa6XAQHPjuQPNA5Um8O2byEdL7ywjnUE5sVLtNFS63m0lkAjVjYlkx Kz7SXorqMWcscY+z6NhwpdqK6x/Cwml8sKvSye2C1H8zuU7TI+dy9ms3j5YMM6OMQGlN JrjEPG6sMuy0MmDQP2bUsogB0cpVJYh99H15OHGqsxDFIMNqkRsKyxXCGHZOlvwtaXq3 KYocZirAGGAvUYxx5H0gDT3PCa+yj9LoEFb1lWvKTNRYRvJMWqa9zfaGuP2GyPCrIva9 DyYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QdaCZTMe; 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 j25-20020a17090686d900b009a1be9c8347si2946223ejy.496.2023.08.23.17.40.32; Wed, 23 Aug 2023 17:40:57 -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=QdaCZTMe; 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 S237020AbjHWPRz (ORCPT + 99 others); Wed, 23 Aug 2023 11:17:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237022AbjHWPRt (ORCPT ); Wed, 23 Aug 2023 11:17:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C921F10FB; Wed, 23 Aug 2023 08:17:24 -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 649D86101C; Wed, 23 Aug 2023 15:17:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B611C433C8; Wed, 23 Aug 2023 15:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692803834; bh=Ylc3TSXa5ifgz7bjH+Ib7u/kImYYyrGh5B2vMyFRLTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdaCZTMe1fTvB5F//p9urTbKVisS0r5vyJbMOt8UfyK47Y0TDyRf9fUAOtEaO07Hj IABla5AdXYBqAIbwFWhkJB3zElvQhMeeBgT5Dzus6a5rawSTD0NEAZZQEogg96sMue TCuw+1eTlKcrOruAulr9uXJJ9RVoVlBB2WyIMCDblgQ3COklM2O2PCfa6EFOM+1DAl +OFL09Q04N3zSTOeFdbI31vipmVr7r3Ygz2thKSxrAzaTnmMTVRThxeFN9ls1dqDMw RWBzdlwOCycGx/6g21G2nRRDYUdyIXS6UeKUrsl8rBmoRTzFzVOtz+NIgXG/mcTlyA ooPvUYw3CIoqg== 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 v4 9/9] Documentation: tracing: Add a note about argument and retval access Date: Thu, 24 Aug 2023 00:17:09 +0900 Message-Id: <169280382895.282662.14910495061790007288.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <169280372795.282662.9784422934484459769.stgit@devnote2> References: <169280372795.282662.9784422934484459769.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: 1775068939974506252 X-GMAIL-MSGID: 1775068939974506252 From: Masami Hiramatsu (Google) Add a note about the argument and return value accecss will be best effort. Depending on the type, it will be passed via stack or a pair of the registers, but $argN and $retval only support the single register access. Suggested-by: Alexei Starovoitov Signed-off-by: Masami Hiramatsu (Google) --- Documentation/trace/fprobetrace.rst | 8 ++++++-- Documentation/trace/kprobetrace.rst | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/trace/fprobetrace.rst b/Documentation/trace/fprobetrace.rst index 8e9bebcf0a2e..e35e6b18df40 100644 --- a/Documentation/trace/fprobetrace.rst +++ b/Documentation/trace/fprobetrace.rst @@ -59,8 +59,12 @@ Synopsis of fprobe-events and bitfield are supported. (\*1) This is available only when BTF is enabled. - (\*2) only for the probe on function entry (offs == 0). - (\*3) only for return probe. + (\*2) only for the probe on function entry (offs == 0). Note, this argument access + is best effort, because depending on the argument type, it may be passed on + the stack. But this only support the arguments via registers. + (\*3) only for return probe. Note that this is also best effort. Depending on the + return value type, it might be passed via a pair of registers. But this only + accesses one register. (\*4) this is useful for fetching a field of data structures. (\*5) "u" means user-space dereference. diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst index 8a2dfee38145..bf9cecb69fc9 100644 --- a/Documentation/trace/kprobetrace.rst +++ b/Documentation/trace/kprobetrace.rst @@ -61,8 +61,12 @@ Synopsis of kprobe_events (x8/x16/x32/x64), "char", "string", "ustring", "symbol", "symstr" and bitfield are supported. - (\*1) only for the probe on function entry (offs == 0). - (\*2) only for return probe. + (\*1) only for the probe on function entry (offs == 0). Note, this argument access + is best effort, because depending on the argument type, it may be passed on + the stack. But this only support the arguments via registers. + (\*2) only for return probe. Note that this is also best effort. Depending on the + return value type, it might be passed via a pair of registers. But this only + accesses one register. (\*3) this is useful for fetching a field of data structures. (\*4) "u" means user-space dereference. See :ref:`user_mem_access`.