Message ID | 170290510399.220107.17645951919819438730.stgit@devnote2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-3704-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1233904dyi; Mon, 18 Dec 2023 05:21:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjo2V/hvcp/DbJYM1cP5U1bCRJvIK8xqYS6rk3iSbaDKr+kcCvyoYx8zC6CoX3UHKgD7gK X-Received: by 2002:a05:6a21:3284:b0:18f:fe5a:8bb7 with SMTP id yt4-20020a056a21328400b0018ffe5a8bb7mr20278126pzb.24.1702905660858; Mon, 18 Dec 2023 05:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702905660; cv=none; d=google.com; s=arc-20160816; b=JNheI1C/vNY/WZZC222jL9LDOS5tPjqVhT5Pc/cJmTa2MGrBpxAIB8RND3Mv7MQA9g HDy7+5tJZC/bxxfNl1tpn0feFTZr5BgmByJ0ZdUuRKMMhEb+YQpzdyNE64grwkQ/A6Q5 wH1mzsNc0Cn2Ah0hV/JpPqvUgB0UE0sWuz1cKhvxvE1KTtamTvNzjg80gxMSqkc3VsJ0 NkO/MmEGoBOiE05jTK04sdAa9cEvwQKqw+cxxlxCe8mCNhcfQXgGUTX67Plxgoj0Kw8Z 1C827PSA9YIYfgJEobEfdpX9cibQM2S7I1IrrGjhwC+tZHSZN4uyhJzZIe/RCkDyzoCD q/xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=u/kik4VLGZC2GW07eIANh56Vc+hGBXm7uOb3XXHxgl4=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=Gu/XP4KB0cKgkGeSBCHD3pIX/Lx/pxmpEHdcI16Udug1RaO0VsxBic9n2MIawl6MfR n8In9+hzLjjGqncg71pyM454++CxJ+dbKaaK1IDtKuPJfE+UcxjwS28oWXH6PCJ63chw cdTF/Ui5AnNvBEfCue+bKogual0Z11VJUYAUvFedi+I0NJOXudE50gQIsw5dU75hytHP upz9/J1remQ3JtglqT09Mv20rnJ75bRCihhtH2IzxQ9hMoKgv2nnnXKw1m/m/qrZIzCI vhEefqzEaauUDbssxuSiIFsP6eS1UOAyjL765K9JIAZ33NB2u/bY5zGqTRc/+IH+gWB6 Mtsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urBgMfpG; spf=pass (google.com: domain of linux-kernel+bounces-3704-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3704-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 23-20020a630017000000b005c668dc2426si17995072pga.176.2023.12.18.05.21.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:21:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3704-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urBgMfpG; spf=pass (google.com: domain of linux-kernel+bounces-3704-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3704-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4189B28737E for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 13:15:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9FC142387; Mon, 18 Dec 2023 13:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="urBgMfpG" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7676A3D55B; Mon, 18 Dec 2023 13:11:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC6EFC433C8; Mon, 18 Dec 2023 13:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702905110; bh=HAB8fcsYhkztOqkqxJN8HQ+Use/Y/czjonQXwZoidcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urBgMfpGrY+s01wqgzm2l/QZu9CJ/ZPp3rxkCXKTVFd52xXIG7+i62qvW14PT3XBP lXEstftk0hjItrksB+PXkx9ba+4nDAnPSM7UwLo1Z5SAigtoDZHzAu5VNvzd+w8xcw ikR7Kt3yJZw6rYBnM6W8Pz12Bi4dzXUoJhmBh8czKkDN40JBcq3gBg4uKsrEuQ1GPh DYeIS14AGUoQL9j6H5yBiG6Aj5fJyhZXQwo5PauZBA3tHoO5FztHJWGdwGfB34Qjsc r07GnAxtejzHAtnH8WwF1rAiKxPtvKU6SMmlm7Rn07psCDqr/ao6OeSIAzsms3XXfa t8cnDEc4I+bKg== From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> To: Alexei Starovoitov <alexei.starovoitov@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Florent Revest <revest@chromium.org> Cc: linux-trace-kernel@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, bpf <bpf@vger.kernel.org>, Sven Schnelle <svens@linux.ibm.com>, Alexei Starovoitov <ast@kernel.org>, Jiri Olsa <jolsa@kernel.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Alan Maguire <alan.maguire@oracle.com>, Mark Rutland <mark.rutland@arm.com>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Guo Ren <guoren@kernel.org> Subject: [PATCH v5 01/34] tracing: Add a comment about ftrace_regs definition Date: Mon, 18 Dec 2023 22:11:44 +0900 Message-Id: <170290510399.220107.17645951919819438730.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170290509018.220107.1347127510564358608.stgit@devnote2> References: <170290509018.220107.1347127510564358608.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785626006238338519 X-GMAIL-MSGID: 1785626006238338519 |
Series |
tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph
|
|
Commit Message
Masami Hiramatsu (Google)
Dec. 18, 2023, 1:11 p.m. UTC
From: Masami Hiramatsu (Google) <mhiramat@kernel.org> To clarify what will be expected on ftrace_regs, add a comment to the architecture independent definition of the ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> --- Changes in v3: - Add instruction pointer Changes in v2: - newly added. --- include/linux/ftrace.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
Comments
On Mon, Dec 18, 2023 at 10:11:44PM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) <mhiramat@kernel.org> > > To clarify what will be expected on ftrace_regs, add a comment to the > architecture independent definition of the ftrace_regs. > > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Mark. > --- > Changes in v3: > - Add instruction pointer > Changes in v2: > - newly added. > --- > include/linux/ftrace.h | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index e8921871ef9a..8b48fc621ea0 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -118,6 +118,32 @@ extern int ftrace_enabled; > > #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > > +/** > + * ftrace_regs - ftrace partial/optimal register set > + * > + * ftrace_regs represents a group of registers which is used at the > + * function entry and exit. There are three types of registers. > + * > + * - Registers for passing the parameters to callee, including the stack > + * pointer. (e.g. rcx, rdx, rdi, rsi, r8, r9 and rsp on x86_64) > + * - Registers for passing the return values to caller. > + * (e.g. rax and rdx on x86_64) > + * - Registers for hooking the function call and return including the > + * frame pointer (the frame pointer is architecture/config dependent) > + * (e.g. rip, rbp and rsp for x86_64) > + * > + * Also, architecture dependent fields can be used for internal process. > + * (e.g. orig_ax on x86_64) > + * > + * On the function entry, those registers will be restored except for > + * the stack pointer, so that user can change the function parameters > + * and instruction pointer (e.g. live patching.) > + * On the function exit, only registers which is used for return values > + * are restored. > + * > + * NOTE: user *must not* access regs directly, only do it via APIs, because > + * the member can be changed according to the architecture. > + */ > struct ftrace_regs { > struct pt_regs regs; > }; >
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index e8921871ef9a..8b48fc621ea0 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -118,6 +118,32 @@ extern int ftrace_enabled; #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS +/** + * ftrace_regs - ftrace partial/optimal register set + * + * ftrace_regs represents a group of registers which is used at the + * function entry and exit. There are three types of registers. + * + * - Registers for passing the parameters to callee, including the stack + * pointer. (e.g. rcx, rdx, rdi, rsi, r8, r9 and rsp on x86_64) + * - Registers for passing the return values to caller. + * (e.g. rax and rdx on x86_64) + * - Registers for hooking the function call and return including the + * frame pointer (the frame pointer is architecture/config dependent) + * (e.g. rip, rbp and rsp for x86_64) + * + * Also, architecture dependent fields can be used for internal process. + * (e.g. orig_ax on x86_64) + * + * On the function entry, those registers will be restored except for + * the stack pointer, so that user can change the function parameters + * and instruction pointer (e.g. live patching.) + * On the function exit, only registers which is used for return values + * are restored. + * + * NOTE: user *must not* access regs directly, only do it via APIs, because + * the member can be changed according to the architecture. + */ struct ftrace_regs { struct pt_regs regs; };