linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [mark:arm64/ftrace/per-callsite-ops 1/6] kernel/trace/fgraph.c:37:12: warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller'
@ 2022-04-29 23:56 kernel test robot
  2022-04-30  6:12 ` [External] " Chengming Zhou
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-04-29 23:56 UTC (permalink / raw)
  To: Chengming Zhou; +Cc: kbuild-all, linux-kernel, Mark Rutland

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/ftrace/per-callsite-ops
head:   2aaba224d039a36f7eca5ad68c77686d3546e4fa
commit: 718b0fd1ccf6f04340cb3ad48b667ca05bb7a31c [1/6] ftrace: cleanup ftrace_graph_caller enable and disable
config: sh-buildonly-randconfig-r002-20220428 (https://download.01.org/0day-ci/archive/20220430/202204300758.ces9aD6G-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.3.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/mark/linux.git/commit/?id=718b0fd1ccf6f04340cb3ad48b667ca05bb7a31c
        git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
        git fetch --no-tags mark arm64/ftrace/per-callsite-ops
        git checkout 718b0fd1ccf6f04340cb3ad48b667ca05bb7a31c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash kernel/trace/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> kernel/trace/fgraph.c:37:12: warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Wmissing-prototypes]
      37 | int __weak ftrace_enable_ftrace_graph_caller(void)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/trace/fgraph.c:46:12: warning: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Wmissing-prototypes]
      46 | int __weak ftrace_disable_ftrace_graph_caller(void)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/fgraph.c:241:15: warning: no previous prototype for 'ftrace_return_to_handler' [-Wmissing-prototypes]
     241 | unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
         |               ^~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/fgraph.c:356:6: warning: no previous prototype for 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes]
     356 | void ftrace_graph_sleep_time_control(bool enable)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/ftrace_enable_ftrace_graph_caller +37 kernel/trace/fgraph.c

    32	
    33	/*
    34	 * archs can override this function if they must do something
    35	 * to enable hook for graph tracer.
    36	 */
  > 37	int __weak ftrace_enable_ftrace_graph_caller(void)
    38	{
    39		return 0;
    40	}
    41	
    42	/*
    43	 * archs can override this function if they must do something
    44	 * to disable hook for graph tracer.
    45	 */
  > 46	int __weak ftrace_disable_ftrace_graph_caller(void)
    47	{
    48		return 0;
    49	}
    50	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [External] [mark:arm64/ftrace/per-callsite-ops 1/6] kernel/trace/fgraph.c:37:12: warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller'
  2022-04-29 23:56 [mark:arm64/ftrace/per-callsite-ops 1/6] kernel/trace/fgraph.c:37:12: warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' kernel test robot
@ 2022-04-30  6:12 ` Chengming Zhou
  0 siblings, 0 replies; 2+ messages in thread
From: Chengming Zhou @ 2022-04-30  6:12 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel, Mark Rutland

On 2022/4/30 07:56, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/ftrace/per-callsite-ops
> head:   2aaba224d039a36f7eca5ad68c77686d3546e4fa
> commit: 718b0fd1ccf6f04340cb3ad48b667ca05bb7a31c [1/6] ftrace: cleanup ftrace_graph_caller enable and disable
> config: sh-buildonly-randconfig-r002-20220428 (https://download.01.org/0day-ci/archive/20220430/202204300758.ces9aD6G-lkp@intel.com/config)
> compiler: sh4-linux-gcc (GCC) 11.3.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/mark/linux.git/commit/?id=718b0fd1ccf6f04340cb3ad48b667ca05bb7a31c
>         git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
>         git fetch --no-tags mark arm64/ftrace/per-callsite-ops
>         git checkout 718b0fd1ccf6f04340cb3ad48b667ca05bb7a31c
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash kernel/trace/
> 

Thanks for the report.

BTW, there are so many "-Wmissing-prototypes" warnings if build kernel with "W=1"...

I can't reproduce this warning on x86_64 because the declarations in <linux/ftrace.h>

#ifdef CONFIG_DYNAMIC_FTRACE
...
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
extern void ftrace_graph_caller(void);
extern int ftrace_enable_ftrace_graph_caller(void);
extern int ftrace_disable_ftrace_graph_caller(void);
#else
static inline int ftrace_enable_ftrace_graph_caller(void) { return 0; }
static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; }
#endif
...
#endif

Since x86_64 select HAVE_FUNCTION_GRAPH_TRACER only when DYNAMIC_FTRACE,
so these declarations can be seen by fgraph.c

But on ARCH=sh, HAVE_FUNCTION_GRAPH_TRACER can be selected when !DYNAMIC_FTRACE,
so these declarations can't be seen by fgraph.c. But in this case, these
functions are not used anywhere. So there are no real problems exist.

Maybe it's better to put ftrace_[enable,disable]_ftrace_graph_caller definitions
in "#ifdef CONFIG_DYNAMIC_FTRACE" in fgraph.c, to suppress this warning.

Thanks.

> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>>> kernel/trace/fgraph.c:37:12: warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Wmissing-prototypes]
>       37 | int __weak ftrace_enable_ftrace_graph_caller(void)
>          |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> kernel/trace/fgraph.c:46:12: warning: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Wmissing-prototypes]
>       46 | int __weak ftrace_disable_ftrace_graph_caller(void)
>          |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    kernel/trace/fgraph.c:241:15: warning: no previous prototype for 'ftrace_return_to_handler' [-Wmissing-prototypes]
>      241 | unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
>          |               ^~~~~~~~~~~~~~~~~~~~~~~~
>    kernel/trace/fgraph.c:356:6: warning: no previous prototype for 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes]
>      356 | void ftrace_graph_sleep_time_control(bool enable)
>          |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> vim +/ftrace_enable_ftrace_graph_caller +37 kernel/trace/fgraph.c
> 
>     32	
>     33	/*
>     34	 * archs can override this function if they must do something
>     35	 * to enable hook for graph tracer.
>     36	 */
>   > 37	int __weak ftrace_enable_ftrace_graph_caller(void)
>     38	{
>     39		return 0;
>     40	}
>     41	
>     42	/*
>     43	 * archs can override this function if they must do something
>     44	 * to disable hook for graph tracer.
>     45	 */
>   > 46	int __weak ftrace_disable_ftrace_graph_caller(void)
>     47	{
>     48		return 0;
>     49	}
>     50	
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-30  6:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 23:56 [mark:arm64/ftrace/per-callsite-ops 1/6] kernel/trace/fgraph.c:37:12: warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' kernel test robot
2022-04-30  6:12 ` [External] " Chengming Zhou

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).