lkml.org 
[lkml]   [2012]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] trace: Fix build breakage without CONFIG_PERF_EVENTS
On Tue, Feb 28, 2012 at 03:57:44PM +0100, Jiri Olsa wrote:
> On Tue, Feb 28, 2012 at 11:10:23AM +0000, Mark Brown wrote:
> > Today's -next fails to build for me:
> >
> > CC kernel/trace/trace_export.o
> > In file included from kernel/trace/trace_export.c:197: kernel/trace/trace_entries.h:58: error: 'perf_ftrace_event_register' undeclared here (not in a function)
> > make[2]: *** [kernel/trace/trace_export.o] Error 1
> > make[1]: *** [kernel/trace] Error 2
> > make: *** [kernel] Error 2
> >
> > because as of ced390 (ftrace, perf: Add support to use function
> > tracepoint in perf) perf_trace_event_register() is declared in trace.h
> > only if CONFIG_PERF_EVENTS is enabled but I don't have that set.
> >
> > Ensure that we always have a definition of perf_trace_event_register()
> > by providing a definition if CONFIG_PERF_EVENTS is disabled.
> >
> > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > ---
> >
> > This one had the build test run all the way...
> >
> > kernel/trace/trace.h | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> > index 54faec7..2aef24e 100644
> > --- a/kernel/trace/trace.h
> > +++ b/kernel/trace/trace.h
> > @@ -842,6 +842,8 @@ int perf_ftrace_event_register(struct ftrace_event_call *call,
> > #else
> > #define perf_ftrace_event_register NULL
> > #endif /* CONFIG_FUNCTION_TRACER */
> > +#else
> > +#define perf_ftrace_event_register NULL
> > #endif /* CONFIG_PERF_EVENTS */
> >
> > #endif /* _LINUX_KERNEL_TRACE_H */
> > --
> > 1.7.9.1
> >
>
> ook, this one fixies that for me as well ;) I got your replies mixed in
> mailbox and thought this one was not actually working..
>
> I also added this bit to get rid of the switch warnings,
> feel free to use it.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>

>
> thanks,
> jirka
> ---
> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index dd478fc..5f3f3be 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -144,12 +144,14 @@ struct event_filter;
> enum trace_reg {
> TRACE_REG_REGISTER,
> TRACE_REG_UNREGISTER,
> +#ifdef CONFIG_PERF_EVENTS
> TRACE_REG_PERF_REGISTER,
> TRACE_REG_PERF_UNREGISTER,
> TRACE_REG_PERF_OPEN,
> TRACE_REG_PERF_CLOSE,
> TRACE_REG_PERF_ADD,
> TRACE_REG_PERF_DEL,
> +#endif
> };
>
> struct ftrace_event_call;


\
 
 \ /
  Last update: 2012-03-14 00:05    [W:0.067 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site