From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 37B5D2C80 for ; Thu, 14 Oct 2021 18:10:32 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 66EAA60EBB; Thu, 14 Oct 2021 18:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634235031; bh=GoTaq77Ra/lW0Ecx7yxYe7pPMdG+lFF4HE2gFnyEeMc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZMCpyWmHkicQylbP61RL8UffOSyiJx+u1WY0OQsLNl4mtBK7xUfVe2d7hcZ1vTotu Q6+g2U9MrRWO8lMmEk+ccDatRkJs2OkcAL2Wvjy3og5dDRD1xllaOwgYRcj5R3G7dI O6PFOSJJFbbj3hyURtXrWvSpsdZMJ/7ZU6StmcJeX9V3pkZ1rawH2wdz8nhkv2un7o 863qScNdM47BZt+sykdxXT69Q/gHBljFJQquDx5tYg0q840AXRekI7v4RkH6AXrfX0 ZMtg9V34FNgWHqvBoWXsyabAaPzikE4+pTnhntCFBfKID3yWDXDYzuhPJmsJsL5+GF gn2ilxm/nUB7g== Date: Thu, 14 Oct 2021 13:14:56 -0500 From: "Gustavo A. R. Silva" To: Steven Rostedt Cc: kernel test robot , llvm@lists.linux.dev, kbuild-all@lists.01.org, "Gustavo A. R. Silva" , LKML Subject: Re: [gustavoars:for-next/cast-function 1/3] kernel/trace/ftrace.c:7029:6: error: no previous prototype for function 'arch_ftrace_ops_list_func' Message-ID: <20211014181456.GA1146469@embeddedor> References: <202110140709.ogqbzDcq-lkp@intel.com> <20211014135317.0755987f@gandalf.local.home> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211014135317.0755987f@gandalf.local.home> On Thu, Oct 14, 2021 at 01:53:17PM -0400, Steven Rostedt wrote: > This should fix this issue as well as some of the other ones reported on > this commit. > > [ I'll be adding this update to my own version in my tree ] Great. I'll apply it to my tree. Thanks! :) -- Gustavo > > -- Steve > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index b86f52683b6f..8771c435f34b 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -178,7 +178,8 @@ > ftrace_ops_list_func = arch_ftrace_ops_list_func; > #else > # ifdef CONFIG_FUNCTION_TRACER > -# define MCOUNT_REC() ftrace_stub_graph = ftrace_stub; > +# define MCOUNT_REC() ftrace_stub_graph = ftrace_stub; \ > + ftrace_ops_list_func = arch_ftrace_ops_list_func; > # else > # define MCOUNT_REC() > # endif > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index 832e65f06754..871b51bec170 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -30,16 +30,25 @@ > #define ARCH_SUPPORTS_FTRACE_OPS 0 > #endif > > +#ifdef CONFIG_FUNCTION_TRACER > +struct ftrace_ops; > /* > * If the arch's mcount caller does not support all of ftrace's > * features, then it must call an indirect function that > * does. Or at least does enough to prevent any unwelcome side effects. > + * > + * Also define the function prototype that these architectures use > + * to call the ftrace_ops_list_func(). > */ > #if !ARCH_SUPPORTS_FTRACE_OPS > # define FTRACE_FORCE_LIST_FUNC 1 > +void arch_ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip); > #else > # define FTRACE_FORCE_LIST_FUNC 0 > +void arch_ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, > + struct ftrace_ops *op, struct ftrace_regs *fregs); > #endif > +#endif /* CONFIG_FUNCTION_TRACER */ > > /* Main tracing buffer and events set up */ > #ifdef CONFIG_TRACING > @@ -88,8 +97,6 @@ extern int > ftrace_enable_sysctl(struct ctl_table *table, int write, > void *buffer, size_t *lenp, loff_t *ppos); > > -struct ftrace_ops; > - > #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > > struct ftrace_regs { From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8183785474406476701==" MIME-Version: 1.0 From: Gustavo A. R. Silva To: kbuild-all@lists.01.org Subject: Re: [gustavoars:for-next/cast-function 1/3] kernel/trace/ftrace.c:7029:6: error: no previous prototype for function 'arch_ftrace_ops_list_func' Date: Thu, 14 Oct 2021 13:14:56 -0500 Message-ID: <20211014181456.GA1146469@embeddedor> In-Reply-To: <20211014135317.0755987f@gandalf.local.home> List-Id: --===============8183785474406476701== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, Oct 14, 2021 at 01:53:17PM -0400, Steven Rostedt wrote: > This should fix this issue as well as some of the other ones reported on > this commit. > = > [ I'll be adding this update to my own version in my tree ] Great. I'll apply it to my tree. Thanks! :) -- Gustavo > = > -- Steve > = > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmli= nux.lds.h > index b86f52683b6f..8771c435f34b 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -178,7 +178,8 @@ > ftrace_ops_list_func =3D arch_ftrace_ops_list_func; > #else > # ifdef CONFIG_FUNCTION_TRACER > -# define MCOUNT_REC() ftrace_stub_graph =3D ftrace_stub; > +# define MCOUNT_REC() ftrace_stub_graph =3D ftrace_stub; \ > + ftrace_ops_list_func =3D arch_ftrace_ops_list_func; > # else > # define MCOUNT_REC() > # endif > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index 832e65f06754..871b51bec170 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -30,16 +30,25 @@ > #define ARCH_SUPPORTS_FTRACE_OPS 0 > #endif > = > +#ifdef CONFIG_FUNCTION_TRACER > +struct ftrace_ops; > /* > * If the arch's mcount caller does not support all of ftrace's > * features, then it must call an indirect function that > * does. Or at least does enough to prevent any unwelcome side effects. > + * > + * Also define the function prototype that these architectures use > + * to call the ftrace_ops_list_func(). > */ > #if !ARCH_SUPPORTS_FTRACE_OPS > # define FTRACE_FORCE_LIST_FUNC 1 > +void arch_ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip= ); > #else > # define FTRACE_FORCE_LIST_FUNC 0 > +void arch_ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, > + struct ftrace_ops *op, struct ftrace_regs *fregs); > #endif > +#endif /* CONFIG_FUNCTION_TRACER */ > = > /* Main tracing buffer and events set up */ > #ifdef CONFIG_TRACING > @@ -88,8 +97,6 @@ extern int > ftrace_enable_sysctl(struct ctl_table *table, int write, > void *buffer, size_t *lenp, loff_t *ppos); > = > -struct ftrace_ops; > - > #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > = > struct ftrace_regs { --===============8183785474406476701==--