ftrace: Fix building warning with !CONFIG_FUNCTION_TRACER
PATCH 1/1 ftrace: Fix building warning with !CONFIG_FUNCTION_TRACER
Commit 43dd61c(ftrace: Fix regression of :mod:module function enabling) causes below warning because ‘struct ftrace_hash’ is not declared with !CONFIG_FUNCTION_TRACER.
In file included from /linux-2.6/include/linux/perf_event.h:508:0,
from /linux-2.6/include/linux/ftrace_event.h:8,
from /linux-2.6/include/trace/syscall.h:6,
from /linux-2.6/include/linux/syscalls.h:77,
from /linux-2.6/arch/x86/ia32/ipc32.c:4:/linux-2.6/include/linux/ftrace.h:128:6: warning: ‘struct ftrace_hash’ declared inside parameter list [enabled by default] /linux-2.6/include/linux/ftrace.h:128:6: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
Fixed it by declaring "struct ftrace_hash" outside of #ifdef CONFIG_FUNCTION_TRACER
--- include/linux/ftrace.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/ftrace.h +2 -2
@@ -19,6 +19,8 @@#include <asm/ftrace.h> +struct ftrace_hash ; +#ifdef CONFIG_FUNCTION_TRACER extern int ftrace_enabled;
@@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,typedef void (*ftrace_func_t )(unsigned long ip,unsigned long parent_ip); -struct ftrace_hash ; -enum {FTRACE_OPS_FL_ENABLED =1 <<0 ,FTRACE_OPS_FL_GLOBAL =1 <<1 ,
Quoted 3 lines · Lin Ming
Commit 43dd61c(ftrace: Fix regression of :mod:module function enabling) causes below warning because ‘struct ftrace_hash’ is not declared with !CONFIG_FUNCTION_TRACER.
It is fixed,
https://lkml.org/lkml/2011/7/14/390
Quoted 7 lines · Américo Wang
Quoted 3 lines · Lin Ming
Commit 43dd61c(ftrace: Fix regression of :mod:module function enabling) causes below warning because ‘struct ftrace_hash’ is not declared with !CONFIG_FUNCTION_TRACER.
It is fixed,
https://lkml.org/lkml/2011/7/14/390
OK.
It's not in -tip yet, so I still see the warnings.
Thanks.
Steven Rostedt
maintainerQuoted 6 lines · Lin Ming
Quoted 5 lines · Américo Wang
Quoted 3 lines · Lin Ming
Commit 43dd61c(ftrace: Fix regression of :mod:module function enabling) causes below warning because ‘struct ftrace_hash’ is not declared with !CONFIG_FUNCTION_TRACER.
Quoted 6 lines
Quoted 2 lines
It is fixed,
https://lkml.org/lkml/2011/7/14/390OK.
It's not in -tip yet, so I still see the warnings.
Yeah, Ingo was the one to report it to me first, and I posted the fix the next day. I also resent it last night as well.
-- Steve