* [gustavoars:for-next/cast-function 1/3] ftrace.c:undefined reference to `ftrace_ops_list_func'
@ 2021-10-14 2:58 kernel test robot
2021-10-14 17:59 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-10-14 2:58 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: kbuild-all, Gustavo A. R. Silva, LKML, Steven Rostedt
[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/cast-function
head: eed09ebd6f47aeb92b3fe3b8d338b2a55e534928
commit: f9d45e65ef7f67bdb39c15d09bc6021f197d893e [1/3] ftrace: Fix -Wcast-function-type warnings on powerpc64
config: sh-randconfig-r026-20211013 (attached as .config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=f9d45e65ef7f67bdb39c15d09bc6021f197d893e
git remote add gustavoars https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git fetch --no-tags gustavoars for-next/cast-function
git checkout f9d45e65ef7f67bdb39c15d09bc6021f197d893e
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
sh4-linux-ld: kernel/trace/ftrace.o: in function `update_ftrace_function':
>> ftrace.c:(.text+0x158): undefined reference to `ftrace_ops_list_func'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33006 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gustavoars:for-next/cast-function 1/3] ftrace.c:undefined reference to `ftrace_ops_list_func'
2021-10-14 2:58 [gustavoars:for-next/cast-function 1/3] ftrace.c:undefined reference to `ftrace_ops_list_func' kernel test robot
@ 2021-10-14 17:59 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-10-14 17:59 UTC (permalink / raw)
To: kernel test robot
Cc: Gustavo A. R. Silva, kbuild-all, Gustavo A. R. Silva, LKML
On Thu, 14 Oct 2021 10:58:55 +0800
kernel test robot <lkp@intel.com> wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/cast-function
> head: eed09ebd6f47aeb92b3fe3b8d338b2a55e534928
> commit: f9d45e65ef7f67bdb39c15d09bc6021f197d893e [1/3] ftrace: Fix -Wcast-function-type warnings on powerpc64
> config: sh-randconfig-r026-20211013 (attached as .config)
> compiler: sh4-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=f9d45e65ef7f67bdb39c15d09bc6021f197d893e
> git remote add gustavoars https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
> git fetch --no-tags gustavoars for-next/cast-function
> git checkout f9d45e65ef7f67bdb39c15d09bc6021f197d893e
> # save the attached .config to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> sh4-linux-ld: kernel/trace/ftrace.o: in function `update_ftrace_function':
> >> ftrace.c:(.text+0x158): undefined reference to `ftrace_ops_list_func'
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
This update should fix this patch (sent for the other issues as well).
-- 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 {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-14 17:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 2:58 [gustavoars:for-next/cast-function 1/3] ftrace.c:undefined reference to `ftrace_ops_list_func' kernel test robot
2021-10-14 17:59 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).