2022-04-16 04:32:09

by kernel test robot

[permalink] [raw]
Subject: [mcgrof:sysctl-testing 21/24] kernel/trace/ftrace.c:7884:9: error: 'saved_ftrace_func' undeclared

tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git sysctl-testing
head: f219482651c5469dd3a6fab22c7be9fb763c26ef
commit: ae3e836e7177c547d2ae3f51d20208462e623c57 [21/24] ftrace: fix building with SYSCTL=n but DYNAMIC_FTRACE=y
config: xtensa-allyesconfig (https://download.01.org/0day-ci/archive/20220416/[email protected]/config)
compiler: xtensa-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/mcgrof/linux.git/commit/?id=ae3e836e7177c547d2ae3f51d20208462e623c57
git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
git fetch --no-tags mcgrof sysctl-testing
git checkout ae3e836e7177c547d2ae3f51d20208462e623c57
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=xtensa SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

kernel/trace/ftrace.c: In function 'ftrace_startup_sysctl':
>> kernel/trace/ftrace.c:7884:9: error: 'saved_ftrace_func' undeclared (first use in this function)
7884 | saved_ftrace_func = NULL;
| ^~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:7884:9: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/trace/ftrace.c:7886:13: error: 'ftrace_start_up' undeclared (first use in this function); did you mean 'ftrace_startup'?
7886 | if (ftrace_start_up) {
| ^~~~~~~~~~~~~~~
| ftrace_startup
>> kernel/trace/ftrace.c:7887:27: error: 'FTRACE_UPDATE_CALLS' undeclared (first use in this function)
7887 | command = FTRACE_UPDATE_CALLS;
| ^~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:7889:36: error: 'FTRACE_START_FUNC_RET' undeclared (first use in this function)
7889 | command |= FTRACE_START_FUNC_RET;
| ^~~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:7890:17: error: implicit declaration of function 'ftrace_startup_enable'; did you mean 'ftrace_startup_all'? [-Werror=implicit-function-declaration]
7890 | ftrace_startup_enable(command);
| ^~~~~~~~~~~~~~~~~~~~~
| ftrace_startup_all
kernel/trace/ftrace.c: In function 'ftrace_shutdown_sysctl':
kernel/trace/ftrace.c:7902:13: error: 'ftrace_start_up' undeclared (first use in this function); did you mean 'ftrace_startup'?
7902 | if (ftrace_start_up) {
| ^~~~~~~~~~~~~~~
| ftrace_startup
>> kernel/trace/ftrace.c:7903:27: error: 'FTRACE_DISABLE_CALLS' undeclared (first use in this function)
7903 | command = FTRACE_DISABLE_CALLS;
| ^~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:7905:36: error: 'FTRACE_STOP_FUNC_RET' undeclared (first use in this function)
7905 | command |= FTRACE_STOP_FUNC_RET;
| ^~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:7906:17: error: implicit declaration of function 'ftrace_run_update_code' [-Werror=implicit-function-declaration]
7906 | ftrace_run_update_code(command);
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/saved_ftrace_func +7884 kernel/trace/ftrace.c

7874
7875 #ifdef CONFIG_SYSCTL
7876 static void ftrace_startup_sysctl(void)
7877 {
7878 int command;
7879
7880 if (unlikely(ftrace_disabled))
7881 return;
7882
7883 /* Force update next time */
> 7884 saved_ftrace_func = NULL;
7885 /* ftrace_start_up is true if we want ftrace running */
> 7886 if (ftrace_start_up) {
> 7887 command = FTRACE_UPDATE_CALLS;
7888 if (ftrace_graph_active)
> 7889 command |= FTRACE_START_FUNC_RET;
> 7890 ftrace_startup_enable(command);
7891 }
7892 }
7893
7894 static void ftrace_shutdown_sysctl(void)
7895 {
7896 int command;
7897
7898 if (unlikely(ftrace_disabled))
7899 return;
7900
7901 /* ftrace_start_up is true if ftrace is running */
> 7902 if (ftrace_start_up) {
> 7903 command = FTRACE_DISABLE_CALLS;
7904 if (ftrace_graph_active)
> 7905 command |= FTRACE_STOP_FUNC_RET;
> 7906 ftrace_run_update_code(command);
7907 }
7908 }
7909

--
0-DAY CI Kernel Test Service
https://01.org/lkp


2022-04-22 20:23:10

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [mcgrof:sysctl-testing 21/24] kernel/trace/ftrace.c:7884:9: error: 'saved_ftrace_func' undeclared

On Sat, Apr 16, 2022 at 12:30:45PM +0800, kernel test robot wrote:

OK I've fixed thist thanks.

Luis