From patchwork Wed Jun 5 20:26:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13687436 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 C593D15099F; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619225; cv=none; b=qwS8byGIdfVGjiJRWL+MsyLiPUHSP7/gsQGTg28tHr6zncoYyhKHSYI46KqfOT51xDUlh9cfKfTeHNs9mB8nKgngJ8gPig0OsDBzpwuXLD9CJxiTwjhDRr/JZLju6MrO4ixmOd4aINRWJfeh1uzC7MS48MivGjy9MZoliHWwqOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619225; c=relaxed/simple; bh=syTGjDVnQ+cdUU7BaGwOwiOKne/SDex7bNLLogAsKak=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=MAYyPQn/WfUB69FMJt9tfAIhCiuY0VOB+FCVIpBUONsiWtgxSjzdt848KnK/jsb8Y9vM852jO+r6qa44TOa9XWGnzgdTRT4TJXf4uyT1qX+o+wTW+CFc0nxKHt+LW8yScN5fWKzpn/VVIO6AZdi/da4pQm4406H1vPjiHmMvWeM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 668DDC32782; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sExDw-00000000i6v-1npP; Wed, 05 Jun 2024 16:27:08 -0400 Message-ID: <20240605202708.289105647@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 16:26:45 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [PATCH 1/6] ftrace: Declare function_trace_op in header to quiet sparse warning References: <20240605202644.293295925@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" Sparse complains that function_trace_op is not static but is not declared in a header file. It is used only in assembly code. But add it to a header so that sparse no longer complains: kernel/trace/ftrace.c:99:19: warning: symbol 'function_trace_op' was not declared. Should it be static? Signed-off-by: Steven Rostedt (Google) --- include/linux/ftrace.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 9f61556a9491..4135dc171447 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -1131,6 +1131,9 @@ extern void ftrace_graph_init_task(struct task_struct *t); extern void ftrace_graph_exit_task(struct task_struct *t); extern void ftrace_graph_init_idle_task(struct task_struct *t, int cpu); +/* Used by assembly, but to quiet sparse warnings */ +extern struct ftrace_ops *function_trace_op; + static inline void pause_graph_tracing(void) { atomic_inc(¤t->tracing_graph_pause); From patchwork Wed Jun 5 20:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13687437 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 E5BFF15ECCB; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619225; cv=none; b=gLg3bT4IrpJihB1/YlbeFpkeEdfbkp41HONSy6MnKO3CAYntN5LkBX8Gu4I9TPyh/Q7dkEazsHDR+ROTdI8xCoZuythZ/WOFhlJ9tOSO1nF0QryFWMNPHq0TLbJ7mAwLy3n9iLFcECbp/2fAIyZjvIiqVMUIgpS3603uK8u8AIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619225; c=relaxed/simple; bh=j7IAs0iqnm589HLRMIPJ8FP0EVvPqQDV6iAvK8Vv5HI=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=eb4ya+3IplsWxLIEpPscCk31UowZpcPnVQDlMUVLnodBHIH91vvqH1wDBvJXCD1ZwKmb+mymJCZmueFJo+yqS/FGmK9eII03CzUHFqle1OizIoUzQ/ClMMm5pOiLTQlBN8EinYbW4mHOBW3jt42fkmK8+3qdMs7fwYPCBIYBXWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F6FDC4AF09; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sExDw-00000000i7Q-2U08; Wed, 05 Jun 2024 16:27:08 -0400 Message-ID: <20240605202708.450784356@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 16:26:46 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [PATCH 2/6] ftrace: Assign ftrace_list_end to ftrace_ops_list type cast to RCU References: <20240605202644.293295925@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" Use a type cast to convert ftrace_list_end to RCU when assigning ftrace_ops_list. This will quiet the sparse warning: kernel/trace/ftrace.c:125:59: warning: incorrect type in initializer (different address spaces) kernel/trace/ftrace.c:125:59: expected struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list kernel/trace/ftrace.c:125:59: got struct ftrace_ops * Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index da7e6abf48b4..3af0b1feb873 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -122,7 +122,7 @@ static int ftrace_disabled __read_mostly; DEFINE_MUTEX(ftrace_lock); -struct ftrace_ops __rcu *ftrace_ops_list __read_mostly = &ftrace_list_end; +struct ftrace_ops __rcu *ftrace_ops_list __read_mostly = (struct ftrace_ops __rcu *)&ftrace_list_end; ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub; struct ftrace_ops global_ops; From patchwork Wed Jun 5 20:26:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13687438 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 EC1EF15ECCD; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; cv=none; b=AhOpfdDWj8nEPMwwQDB52UiWrU4RBvV477b6MNorzBMmv8q8/iZ/7UmKIzGm3WL+tYONXp1UhGXS8GSdYb+D8OY+T/LgsDRropWPMSGTnhuUZlRMv3kHY+yuzciSYjSK3H2mEWWTkQ9vf9j903dFPII/90Kaa/s/ZTupYZW6hcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; c=relaxed/simple; bh=jnHREzsc8tpTaQNkMJMt6pd9c2rlI6DKzyKGBlZBgRM=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rUAJA+XzHHNLkPvVSTtT4FX7MFnNZQ7n4I8WS1Xnd8jaNpLQYpMG6t+pxGb4NBZUeb9DXbUkXeywfIxDQHwBcukkmKrki1Oy7kw3Hj82GBAuvqzCoYHonFiEU6EjZx1dDCp8uYUumu2YL03AeYZ8xjRdNSEd+f9q7Ww3tJHv3Z8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B290AC4AF0A; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sExDw-00000000i7u-39u8; Wed, 05 Jun 2024 16:27:08 -0400 Message-ID: <20240605202708.613471310@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 16:26:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [PATCH 3/6] ftrace: Assign RCU list variable with rcu_assign_ptr() References: <20240605202644.293295925@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" Use rcu_assign_ptr() to assign the list pointer as it is marked as RCU, and this quiets the sparse warning: kernel/trace/ftrace.c:313:23: warning: incorrect type in assignment (different address spaces) kernel/trace/ftrace.c:313:23: expected struct ftrace_ops [noderef] __rcu * kernel/trace/ftrace.c:313:23: got struct ftrace_ops * Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 3af0b1feb873..a39842a53444 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -310,7 +310,7 @@ static int remove_ftrace_ops(struct ftrace_ops __rcu **list, lockdep_is_held(&ftrace_lock)) == ops && rcu_dereference_protected(ops->next, lockdep_is_held(&ftrace_lock)) == &ftrace_list_end) { - *list = &ftrace_list_end; + rcu_assign_pointer(*list, &ftrace_list_end); return 0; } From patchwork Wed Jun 5 20:26:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13687440 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 580F815ECF4; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; cv=none; b=GmCMhRBkZevzJzEftse6jeS560yxg+YR4T7JbNVhROjHWR1HfmfR/s3ap4NQ9a+1EKy8OGsGzd8O6LzAw6RmtOwqsKuZ6SK4kMmWgyIj/2O2gmyzds5YP3RlQ2JnJbrLsoGh43TUfV+QgW+rQrOk0L2CLeOEAtxADJxbgq7TS24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; c=relaxed/simple; bh=Lo+KTDar5Td+LgUarTq7UKV7H+gNQWMb5yhOymYhrw4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=jfoc2BZyM/ZbGNu19JDqZQzduHT7gunnpaougO6sEfHbC0cuqHJ5amQw5+WSSwL4bDntZqvom7lSc8CQMy4a2IkucGREYSM+8BDGdtUJo5pQAZwfFKsa2mkUaFU5SBP29TfaS/Xozz7roC4ExyK1YJfIbgdN+qJvL72jNbIXgmc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D70C5C32781; Wed, 5 Jun 2024 20:27:05 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sExDw-00000000i8O-3qFn; Wed, 05 Jun 2024 16:27:08 -0400 Message-ID: <20240605202708.773583114@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 16:26:48 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , kernel test robot Subject: [PATCH 4/6] ftrace: Fix prototypes for ftrace_startup/shutdown_subops() References: <20240605202644.293295925@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" The ftrace_startup_subops() was in the wrong header, and both functions were not defined on !CONFIG_DYNAMIC_FTRACE. Fixes: 5fccc7552ccbc ("ftrace: Add subops logic to allow one ops to manage many") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406051524.a12JqLqx-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace_internal.h | 9 +++++++++ kernel/trace/trace.h | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/trace/ftrace_internal.h b/kernel/trace/ftrace_internal.h index bfba10c2fcf1..4bb1e881154a 100644 --- a/kernel/trace/ftrace_internal.h +++ b/kernel/trace/ftrace_internal.h @@ -15,6 +15,7 @@ extern struct ftrace_ops global_ops; int ftrace_startup(struct ftrace_ops *ops, int command); int ftrace_shutdown(struct ftrace_ops *ops, int command); int ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs); +int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command); int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command); #else /* !CONFIG_DYNAMIC_FTRACE */ @@ -39,6 +40,14 @@ ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs) { return 1; } +static inline int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command) +{ + return -EINVAL; +} +static inline int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command) +{ + return -EINVAL; +} #endif /* CONFIG_DYNAMIC_FTRACE */ #ifdef CONFIG_FUNCTION_GRAPH_TRACER diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index b37402e3f0c9..8783bebd0562 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1186,7 +1186,6 @@ extern int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, int len, int reset); extern int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, int len, int reset); -extern int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int command); #else struct ftrace_func_command; From patchwork Wed Jun 5 20:26:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13687441 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 8A09815EFAA; Wed, 5 Jun 2024 20:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; cv=none; b=tJu41+91y4eSrPCA3wSyt9Y6CnYxOS5+s5XnfEACgsIJpmRy2TsGfNMs2Dm2w/N3dNJc/ZWrwSwGYRubkiPStJ9f8C6puTqp3BJOJYhsiW19EY6eeRQrA6KqCBZb/oRUGB6Zywq70DzdPhMhWxDNYmYBb9GyuPvdOeVJ46w4ROc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; c=relaxed/simple; bh=f7mhAHQ6UAt9EOXxpYEDswe/vbF9g8NMK/HEN3liMwc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=mI4XHqniUmUd55hBSuYPqfpIqnF0DMkRaTu6UeGxAoZNY+I7uvMe90vHm0diOZqnF/aasZXthnbNPkHtWRKUIJofUq9RnQQunJ+d0sfH63cWRKWnGxetfBmWrwSUoGxdlvfjATtj+6CpPOT/6iRgBxxxCsIqDOGXccTsIWHCaeE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02763C32786; Wed, 5 Jun 2024 20:27:06 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sExDx-00000000i8s-0Jhv; Wed, 05 Jun 2024 16:27:09 -0400 Message-ID: <20240605202708.936515302@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 16:26:49 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , kernel test robot Subject: [PATCH 5/6] function_graph: Make fgraph_do_direct static key static References: <20240605202644.293295925@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" The static branch key "fgraph_do_direct" was not declared static but is only used in one file. Change it to a static variable. Fixes: cc60ee813b503 ("function_graph: Use static_call and branch to optimize entry function") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406051711.dS1sQZ9n-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) --- kernel/trace/fgraph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 4bf91eebbb08..63d828054c79 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -515,7 +515,7 @@ static struct fgraph_ops fgraph_stub = { static struct fgraph_ops *fgraph_direct_gops = &fgraph_stub; DEFINE_STATIC_CALL(fgraph_func, ftrace_graph_entry_stub); DEFINE_STATIC_CALL(fgraph_retfunc, ftrace_graph_ret_stub); -DEFINE_STATIC_KEY_TRUE(fgraph_do_direct); +static DEFINE_STATIC_KEY_TRUE(fgraph_do_direct); /** * ftrace_graph_stop - set to permanently disable function graph tracing From patchwork Wed Jun 5 20:26:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13687439 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 5712215ECF3; Wed, 5 Jun 2024 20:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; cv=none; b=ka6xQRBCZHP9Cap7n2Vp54VYo9g0Ay3cPKLTb3EcGKWuv6YJnLJEdEFOIoCJ6gNhh0dBgwUJwrm/D5p7fG86Fa5jlRAupsRJ9lcp4sYPDXX5VrkORt/I/kUqHHOXv2Mw+De4Sd1TopYvvJGEusYS2hhb/X4C3e04o+Q3m9uV0s0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717619226; c=relaxed/simple; bh=4Q9p3K5GndKyfNAahJjpQzFGmcIsZnywwComrYPdA8Y=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=uqL2V0YDiyFVdn64x71E4JtiJ3tX0oF2P3fyMKkOR/R4pHQtvymTwa/14sDvhiGsBZjN2KQwvTX6cwYkCpTbV3o2CarBLtRns3NrIKSoBi/chtyDFPp4F/Oc95yE1jaXRozB3HwGkW5CYJmVgNaIqn1XNdg1kQnbXSMx8L6hiXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A85AC4AF0A; Wed, 5 Jun 2024 20:27:06 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sExDx-00000000i9M-0zcE; Wed, 05 Jun 2024 16:27:09 -0400 Message-ID: <20240605202709.096020676@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 16:26:50 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , kernel test robot Subject: [PATCH 6/6] function_graph: Do not update pid func if CONFIG_DYNAMIC_FTRACE not enabled References: <20240605202644.293295925@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" The ftrace subops is only defined if CONFIG_DYNAMIC_FTRACE is enabled. If it is not, function tracing is extremely limited, and the subops in the ftrace_ops structure is not defined (and will fail to compile). If DYNAMIC_FTRACE is not enabled, then function graph filtering will not work (as it shouldn't). Fixes: df3ec5da6a1e7 ("function_graph: Add pid tracing back to function graph tracer") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406051855.9VIYXbTB-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) --- kernel/trace/fgraph.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 63d828054c79..c0e428c87ea5 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -1177,6 +1177,7 @@ void fgraph_update_pid_func(void) if (!(graph_ops.flags & FTRACE_OPS_FL_INITIALIZED)) return; +#ifdef CONFIG_DYNAMIC_FTRACE list_for_each_entry(op, &graph_ops.subop_list, list) { if (op->flags & FTRACE_OPS_FL_PID) { gops = container_of(op, struct fgraph_ops, ops); @@ -1186,6 +1187,7 @@ void fgraph_update_pid_func(void) static_call_update(fgraph_func, gops->entryfunc); } } +#endif } /* Allocate a return stack for each task */