public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip FIXED] ftrace: add nop tracer
@ 2008-09-19 10:06 Steven Noonan
  2008-09-19 10:43 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Steven Noonan @ 2008-09-19 10:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, Steven Noonan

A no-op tracer which can serve two purposes:
 1. A template for development of a new tracer.
 2. A convenient way to see ftrace_printk() calls without
    an irrelevant trace making the output messy.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
 kernel/trace/Kconfig          |   10 ++++++
 kernel/trace/Makefile         |    1 +
 kernel/trace/trace.h          |    4 ++
 kernel/trace/trace_nop.c      |   65 +++++++++++++++++++++++++++++++++++++++++
 kernel/trace/trace_selftest.c |    9 ++++++
 5 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 kernel/trace/trace_nop.c

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 16e5bb5..d7b2de7 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -101,6 +101,16 @@ config SCHED_TRACER
 	  This tracer tracks the latency of the highest priority task
 	  to be scheduled in, starting from the point it has woken up.
 
+config NOP_TRACER
+	bool "NOP Tracer"
+	depends on HAVE_FTRACE
+	depends on DEBUG_KERNEL
+	select TRACING
+	help
+	  This tracer does nothing. The primary purpose for it is to
+	  politely print the output of ftrace_printk() calls without
+	  the overhead of an irrelevant trace taking place.
+
 config CONTEXT_SWITCH_TRACER
 	bool "Trace process context switches"
 	depends on HAVE_FTRACE
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 58ec61c..73ba13f 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_FTRACE) += trace_functions.o
 obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
 obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
 obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
+obj-$(CONFIG_NOP_TRACER) += trace_nop.o
 obj-$(CONFIG_STACK_TRACER) += trace_stack.o
 obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
 
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 42f65d0..447d4b9 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -339,6 +339,10 @@ extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
 extern int trace_selftest_startup_wakeup(struct tracer *trace,
 					 struct trace_array *tr);
 #endif
+#ifdef CONFIG_NOP_TRACER
+extern int trace_selftest_startup_nop(struct tracer *trace,
+					 struct trace_array *tr);
+#endif
 #ifdef CONFIG_CONTEXT_SWITCH_TRACER
 extern int trace_selftest_startup_sched_switch(struct tracer *trace,
 					       struct trace_array *tr);
diff --git a/kernel/trace/trace_nop.c b/kernel/trace/trace_nop.c
new file mode 100644
index 0000000..dafaefb
--- /dev/null
+++ b/kernel/trace/trace_nop.c
@@ -0,0 +1,65 @@
+/*
+ * nop tracer
+ *
+ * Copyright (C) 2008 Steven Noonan <steven@uplinklabs.net>
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/debugfs.h>
+#include <linux/ftrace.h>
+
+#include "trace.h"
+
+static struct trace_array	*ctx_trace;
+
+static void start_nop_trace(struct trace_array *tr)
+{
+	/* Nothing to do! */
+}
+
+static void stop_nop_trace(struct trace_array *tr)
+{
+	/* Nothing to do! */
+}
+
+static void nop_trace_init(struct trace_array *tr)
+{
+	ctx_trace = tr;
+
+	if (tr->ctrl)
+		start_nop_trace(tr);
+}
+
+static void nop_trace_reset(struct trace_array *tr)
+{
+	if (tr->ctrl)
+		stop_nop_trace(tr);
+}
+
+static void nop_trace_ctrl_update(struct trace_array *tr)
+{
+	/* When starting a new trace, reset the buffers */
+	if (tr->ctrl)
+		start_nop_trace(tr);
+	else
+		stop_nop_trace(tr);
+}
+
+static struct tracer nop_trace __read_mostly =
+{
+	.name		= "nop",
+	.init		= nop_trace_init,
+	.reset		= nop_trace_reset,
+	.ctrl_update	= nop_trace_ctrl_update,
+#ifdef CONFIG_FTRACE_SELFTEST
+	.selftest	= trace_selftest_startup_nop,
+#endif
+};
+
+__init static int init_nop_trace(void)
+{
+	return register_tracer(&nop_trace);
+}
+device_initcall(init_nop_trace);
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 630715b..82db910 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -418,6 +418,15 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
 }
 #endif /* CONFIG_IRQSOFF_TRACER && CONFIG_PREEMPT_TRACER */
 
+#ifdef CONFIG_NOP_TRACER
+int
+trace_selftest_startup_nop(struct tracer *trace, struct trace_array *tr)
+{
+	/* What could possibly go wrong? */
+	return 0;
+}
+#endif
+
 #ifdef CONFIG_SCHED_TRACER
 static int trace_wakeup_test_thread(void *data)
 {
-- 
1.6.0.2


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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 10:06 [PATCH -tip FIXED] ftrace: add nop tracer Steven Noonan
@ 2008-09-19 10:43 ` Ingo Molnar
  2008-09-19 10:48 ` Frédéric Weisbecker
  2008-09-19 21:23 ` Andrew Morton
  2 siblings, 0 replies; 18+ messages in thread
From: Ingo Molnar @ 2008-09-19 10:43 UTC (permalink / raw)
  To: Steven Noonan; +Cc: linux-kernel, Steven Rostedt


* Steven Noonan <steven@uplinklabs.net> wrote:

> A no-op tracer which can serve two purposes:
>  1. A template for development of a new tracer.
>  2. A convenient way to see ftrace_printk() calls without
>     an irrelevant trace making the output messy.
> 
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>

that was quick :) Applied to tip/tracing/ftrace, thanks Steven!

	Ingo

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 10:06 [PATCH -tip FIXED] ftrace: add nop tracer Steven Noonan
  2008-09-19 10:43 ` Ingo Molnar
@ 2008-09-19 10:48 ` Frédéric Weisbecker
  2008-09-19 11:04   ` Ingo Molnar
  2008-09-19 21:23 ` Andrew Morton
  2 siblings, 1 reply; 18+ messages in thread
From: Frédéric Weisbecker @ 2008-09-19 10:48 UTC (permalink / raw)
  To: Steven Noonan; +Cc: linux-kernel, mingo

2008/9/19 Steven Noonan <steven@uplinklabs.net>:
> A no-op tracer which can serve two purposes:
>  1. A template for development of a new tracer.
>  2. A convenient way to see ftrace_printk() calls without
>    an irrelevant trace making the output messy.
>
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>
> ---
>  kernel/trace/Kconfig          |   10 ++++++
>  kernel/trace/Makefile         |    1 +
>  kernel/trace/trace.h          |    4 ++
>  kernel/trace/trace_nop.c      |   65 +++++++++++++++++++++++++++++++++++++++++
>  kernel/trace/trace_selftest.c |    9 ++++++
>  5 files changed, 89 insertions(+), 0 deletions(-)
>  create mode 100644 kernel/trace/trace_nop.c
>
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index 16e5bb5..d7b2de7 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -101,6 +101,16 @@ config SCHED_TRACER
>          This tracer tracks the latency of the highest priority task
>          to be scheduled in, starting from the point it has woken up.
>
> +config NOP_TRACER
> +       bool "NOP Tracer"
> +       depends on HAVE_FTRACE
> +       depends on DEBUG_KERNEL
> +       select TRACING
> +       help
> +         This tracer does nothing. The primary purpose for it is to
> +         politely print the output of ftrace_printk() calls without
> +         the overhead of an irrelevant trace taking place.
> +
>  config CONTEXT_SWITCH_TRACER
>        bool "Trace process context switches"
>        depends on HAVE_FTRACE
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index 58ec61c..73ba13f 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -19,6 +19,7 @@ obj-$(CONFIG_FTRACE) += trace_functions.o
>  obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
>  obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
>  obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
> +obj-$(CONFIG_NOP_TRACER) += trace_nop.o
>  obj-$(CONFIG_STACK_TRACER) += trace_stack.o
>  obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
>
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 42f65d0..447d4b9 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -339,6 +339,10 @@ extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
>  extern int trace_selftest_startup_wakeup(struct tracer *trace,
>                                         struct trace_array *tr);
>  #endif
> +#ifdef CONFIG_NOP_TRACER
> +extern int trace_selftest_startup_nop(struct tracer *trace,
> +                                        struct trace_array *tr);
> +#endif
>  #ifdef CONFIG_CONTEXT_SWITCH_TRACER
>  extern int trace_selftest_startup_sched_switch(struct tracer *trace,
>                                               struct trace_array *tr);
> diff --git a/kernel/trace/trace_nop.c b/kernel/trace/trace_nop.c
> new file mode 100644
> index 0000000..dafaefb
> --- /dev/null
> +++ b/kernel/trace/trace_nop.c
> @@ -0,0 +1,65 @@
> +/*
> + * nop tracer
> + *
> + * Copyright (C) 2008 Steven Noonan <steven@uplinklabs.net>
> + *
> + */
> +
> +#include <linux/module.h>
> +#include <linux/fs.h>
> +#include <linux/debugfs.h>
> +#include <linux/ftrace.h>
> +
> +#include "trace.h"
> +
> +static struct trace_array      *ctx_trace;
> +
> +static void start_nop_trace(struct trace_array *tr)
> +{
> +       /* Nothing to do! */
> +}
> +
> +static void stop_nop_trace(struct trace_array *tr)
> +{
> +       /* Nothing to do! */
> +}
> +
> +static void nop_trace_init(struct trace_array *tr)
> +{
> +       ctx_trace = tr;
> +
> +       if (tr->ctrl)
> +               start_nop_trace(tr);
> +}
> +
> +static void nop_trace_reset(struct trace_array *tr)
> +{
> +       if (tr->ctrl)
> +               stop_nop_trace(tr);
> +}
> +
> +static void nop_trace_ctrl_update(struct trace_array *tr)
> +{
> +       /* When starting a new trace, reset the buffers */
> +       if (tr->ctrl)
> +               start_nop_trace(tr);
> +       else
> +               stop_nop_trace(tr);
> +}
> +
> +static struct tracer nop_trace __read_mostly =
> +{
> +       .name           = "nop",
> +       .init           = nop_trace_init,
> +       .reset          = nop_trace_reset,
> +       .ctrl_update    = nop_trace_ctrl_update,
> +#ifdef CONFIG_FTRACE_SELFTEST
> +       .selftest       = trace_selftest_startup_nop,
> +#endif
> +};
> +
> +__init static int init_nop_trace(void)
> +{
> +       return register_tracer(&nop_trace);
> +}
> +device_initcall(init_nop_trace);
> diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
> index 630715b..82db910 100644
> --- a/kernel/trace/trace_selftest.c
> +++ b/kernel/trace/trace_selftest.c
> @@ -418,6 +418,15 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
>  }
>  #endif /* CONFIG_IRQSOFF_TRACER && CONFIG_PREEMPT_TRACER */
>
> +#ifdef CONFIG_NOP_TRACER
> +int
> +trace_selftest_startup_nop(struct tracer *trace, struct trace_array *tr)
> +{
> +       /* What could possibly go wrong? */
> +       return 0;
> +}
> +#endif
> +
>  #ifdef CONFIG_SCHED_TRACER
>  static int trace_wakeup_test_thread(void *data)
>  {
> --
> 1.6.0.2
>

Hi Steven and Ingo!

It seems we have two "none" tracers now.
Why not seeing this nop tracer as an improvment of the current "none tracer" ?

As a result the none tracer contained in trace.c could be replaced by
this new one as the default tracer. And that's said, that will enable
trace_printk by default even when no tracer is selected by the user.

What do you think about it?

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 10:48 ` Frédéric Weisbecker
@ 2008-09-19 11:04   ` Ingo Molnar
  2008-09-19 11:30     ` Frédéric Weisbecker
  0 siblings, 1 reply; 18+ messages in thread
From: Ingo Molnar @ 2008-09-19 11:04 UTC (permalink / raw)
  To: Frédéric Weisbecker; +Cc: Steven Noonan, linux-kernel


* Frédéric Weisbecker <fweisbec@gmail.com> wrote:

> It seems we have two "none" tracers now. Why not seeing this nop 
> tracer as an improvment of the current "none tracer" ?
> 
> As a result the none tracer contained in trace.c could be replaced by 
> this new one as the default tracer. And that's said, that will enable 
> trace_printk by default even when no tracer is selected by the user.
> 
> What do you think about it?

hmm ... good idea. There are some special properties of the none tracer 
(it inhibits trace output for example), and those should be discontinued 
i guess.

	Ingo

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 11:04   ` Ingo Molnar
@ 2008-09-19 11:30     ` Frédéric Weisbecker
  0 siblings, 0 replies; 18+ messages in thread
From: Frédéric Weisbecker @ 2008-09-19 11:30 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Steven Noonan, linux-kernel

2008/9/19 Ingo Molnar <mingo@elte.hu>:
>
> * Frédéric Weisbecker <fweisbec@gmail.com> wrote:
>
>> It seems we have two "none" tracers now. Why not seeing this nop
>> tracer as an improvment of the current "none tracer" ?
>>
>> As a result the none tracer contained in trace.c could be replaced by
>> this new one as the default tracer. And that's said, that will enable
>> trace_printk by default even when no tracer is selected by the user.
>>
>> What do you think about it?
>
> hmm ... good idea. There are some special properties of the none tracer
> (it inhibits trace output for example), and those should be discontinued
> i guess.
>
>        Ingo
>

Ok. I will prepare a patch to submit this idea.

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 10:06 [PATCH -tip FIXED] ftrace: add nop tracer Steven Noonan
  2008-09-19 10:43 ` Ingo Molnar
  2008-09-19 10:48 ` Frédéric Weisbecker
@ 2008-09-19 21:23 ` Andrew Morton
  2008-09-19 23:35   ` Steven Noonan
  2 siblings, 1 reply; 18+ messages in thread
From: Andrew Morton @ 2008-09-19 21:23 UTC (permalink / raw)
  To: Steven Noonan; +Cc: linux-kernel, mingo, steven

On Fri, 19 Sep 2008 03:06:43 -0700
Steven Noonan <steven@uplinklabs.net> wrote:

> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -339,6 +339,10 @@ extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
>  extern int trace_selftest_startup_wakeup(struct tracer *trace,
>  					 struct trace_array *tr);
>  #endif
> +#ifdef CONFIG_NOP_TRACER
> +extern int trace_selftest_startup_nop(struct tracer *trace,
> +					 struct trace_array *tr);
> +#endif
>  #ifdef CONFIG_CONTEXT_SWITCH_TRACER
>  extern int trace_selftest_startup_sched_switch(struct tracer *trace,
>  					       struct trace_array *tr);

Consider omitting the ifdefs around the declarations.

pro: the code looks nicer and is less likely to suffer build errors
with weird config combinations.

con: build errors are reported at link-time rather than at compile-time.

Personally, I think pro>con here.

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 21:23 ` Andrew Morton
@ 2008-09-19 23:35   ` Steven Noonan
  2008-09-20  6:16     ` Ingo Molnar
  0 siblings, 1 reply; 18+ messages in thread
From: Steven Noonan @ 2008-09-19 23:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, mingo

On Fri, Sep 19, 2008 at 2:23 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Fri, 19 Sep 2008 03:06:43 -0700
> Steven Noonan <steven@uplinklabs.net> wrote:
>
>> --- a/kernel/trace/trace.h
>> +++ b/kernel/trace/trace.h
>> @@ -339,6 +339,10 @@ extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
>>  extern int trace_selftest_startup_wakeup(struct tracer *trace,
>>                                        struct trace_array *tr);
>>  #endif
>> +#ifdef CONFIG_NOP_TRACER
>> +extern int trace_selftest_startup_nop(struct tracer *trace,
>> +                                      struct trace_array *tr);
>> +#endif
>>  #ifdef CONFIG_CONTEXT_SWITCH_TRACER
>>  extern int trace_selftest_startup_sched_switch(struct tracer *trace,
>>                                              struct trace_array *tr);
>
> Consider omitting the ifdefs around the declarations.
>
> pro: the code looks nicer and is less likely to suffer build errors
> with weird config combinations.
>
> con: build errors are reported at link-time rather than at compile-time.
>
> Personally, I think pro>con here.
>

I merely based this on one of the other tracers, so the ifdefs are
basically copied and renamed.

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-19 23:35   ` Steven Noonan
@ 2008-09-20  6:16     ` Ingo Molnar
  2008-09-20  7:33       ` Steven Noonan
  2008-09-20  8:00       ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
  0 siblings, 2 replies; 18+ messages in thread
From: Ingo Molnar @ 2008-09-20  6:16 UTC (permalink / raw)
  To: Steven Noonan; +Cc: Andrew Morton, linux-kernel


* Steven Noonan <steven@uplinklabs.net> wrote:

> On Fri, Sep 19, 2008 at 2:23 PM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Fri, 19 Sep 2008 03:06:43 -0700
> > Steven Noonan <steven@uplinklabs.net> wrote:
> >
> >> --- a/kernel/trace/trace.h
> >> +++ b/kernel/trace/trace.h
> >> @@ -339,6 +339,10 @@ extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
> >>  extern int trace_selftest_startup_wakeup(struct tracer *trace,
> >>                                        struct trace_array *tr);
> >>  #endif
> >> +#ifdef CONFIG_NOP_TRACER
> >> +extern int trace_selftest_startup_nop(struct tracer *trace,
> >> +                                      struct trace_array *tr);
> >> +#endif
> >>  #ifdef CONFIG_CONTEXT_SWITCH_TRACER
> >>  extern int trace_selftest_startup_sched_switch(struct tracer *trace,
> >>                                              struct trace_array *tr);
> >
> > Consider omitting the ifdefs around the declarations.
> >
> > pro: the code looks nicer and is less likely to suffer build errors
> > with weird config combinations.
> >
> > con: build errors are reported at link-time rather than at compile-time.
> >
> > Personally, I think pro>con here.
> >
> 
> I merely based this on one of the other tracers, so the ifdefs are
> basically copied and renamed.

yeah. Feel free to send a separate patch that implements Andrew's 
clean-up suggestion. I agree that pro>con.

	Ingo

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-20  6:16     ` Ingo Molnar
@ 2008-09-20  7:33       ` Steven Noonan
  2008-09-20  7:47         ` Andrew Morton
  2008-09-20 11:31         ` Ingo Molnar
  2008-09-20  8:00       ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
  1 sibling, 2 replies; 18+ messages in thread
From: Steven Noonan @ 2008-09-20  7:33 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, linux-kernel

On Fri, Sep 19, 2008 at 11:16 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Steven Noonan <steven@uplinklabs.net> wrote:
>
>> On Fri, Sep 19, 2008 at 2:23 PM, Andrew Morton
>> <akpm@linux-foundation.org> wrote:
>> > On Fri, 19 Sep 2008 03:06:43 -0700
>> > Steven Noonan <steven@uplinklabs.net> wrote:
>> >
>> >> --- a/kernel/trace/trace.h
>> >> +++ b/kernel/trace/trace.h
>> >> @@ -339,6 +339,10 @@ extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
>> >>  extern int trace_selftest_startup_wakeup(struct tracer *trace,
>> >>                                        struct trace_array *tr);
>> >>  #endif
>> >> +#ifdef CONFIG_NOP_TRACER
>> >> +extern int trace_selftest_startup_nop(struct tracer *trace,
>> >> +                                      struct trace_array *tr);
>> >> +#endif
>> >>  #ifdef CONFIG_CONTEXT_SWITCH_TRACER
>> >>  extern int trace_selftest_startup_sched_switch(struct tracer *trace,
>> >>                                              struct trace_array *tr);
>> >
>> > Consider omitting the ifdefs around the declarations.
>> >
>> > pro: the code looks nicer and is less likely to suffer build errors
>> > with weird config combinations.
>> >
>> > con: build errors are reported at link-time rather than at compile-time.
>> >
>> > Personally, I think pro>con here.
>> >
>>
>> I merely based this on one of the other tracers, so the ifdefs are
>> basically copied and renamed.
>
> yeah. Feel free to send a separate patch that implements Andrew's
> clean-up suggestion. I agree that pro>con.
>

How about this patch gets applied to -tip and I submit one that drops
the ifdefs on this and the other tracers?

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-20  7:33       ` Steven Noonan
@ 2008-09-20  7:47         ` Andrew Morton
  2008-09-20 11:31         ` Ingo Molnar
  1 sibling, 0 replies; 18+ messages in thread
From: Andrew Morton @ 2008-09-20  7:47 UTC (permalink / raw)
  To: Steven Noonan; +Cc: Ingo Molnar, linux-kernel

On Sat, 20 Sep 2008 00:33:56 -0700 "Steven Noonan" <steven@uplinklabs.net> wrote:

> > yeah. Feel free to send a separate patch that implements Andrew's
> > clean-up suggestion. I agree that pro>con.
> >
> 
> How about this patch gets applied to -tip and I submit one that drops
> the ifdefs on this and the other tracers?

yup.  That's in fact the preferred way of separating patches.  "one
concept per patch" is the old mantra.

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

* [PATCH] ftrace: mcount_addr defined but not used
  2008-09-20  6:16     ` Ingo Molnar
  2008-09-20  7:33       ` Steven Noonan
@ 2008-09-20  8:00       ` Steven Noonan
  2008-09-20  8:00         ` [PATCH] trace: remove pointless ifdefs Steven Noonan
                           ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: Steven Noonan @ 2008-09-20  8:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, mingo, Steven Noonan

When CONFIG_DYNAMIC_FTRACE isn't used, neither is mcount_addr. This
patch eliminates that warning.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
 kernel/trace/ftrace.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 89ed43b..f484909 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -37,14 +37,6 @@ int ftrace_enabled __read_mostly;
 static int last_ftrace_enabled;
 
 /*
- * Since MCOUNT_ADDR may point to mcount itself, we do not want
- * to get it confused by reading a reference in the code as we
- * are parsing on objcopy output of text. Use a variable for
- * it instead.
- */
-static unsigned long mcount_addr = MCOUNT_ADDR;
-
-/*
  * ftrace_disabled is set when an anomaly is discovered.
  * ftrace_disabled is much stronger than ftrace_enabled.
  */
@@ -178,6 +170,14 @@ static DEFINE_SPINLOCK(ftrace_hash_lock);
 #define ftrace_hash_unlock(flags) do { } while(0)
 #endif
 
+/*
+ * Since MCOUNT_ADDR may point to mcount itself, we do not want
+ * to get it confused by reading a reference in the code as we
+ * are parsing on objcopy output of text. Use a variable for
+ * it instead.
+ */
+static unsigned long mcount_addr = MCOUNT_ADDR;
+
 static struct task_struct *ftraced_task;
 
 enum {
-- 
1.6.0.2


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

* [PATCH] trace: remove pointless ifdefs
  2008-09-20  8:00       ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
@ 2008-09-20  8:00         ` Steven Noonan
  2008-09-20 11:33           ` Ingo Molnar
  2008-09-20  8:31         ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
  2008-09-20 11:33         ` Ingo Molnar
  2 siblings, 1 reply; 18+ messages in thread
From: Steven Noonan @ 2008-09-20  8:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, mingo, Steven Noonan

The functions are already 'extern' anyway, so there's no problem
with linkage. Removing these ifdefs also helps find any potential
compiler errors.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
 kernel/trace/trace.h |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 447d4b9..c8c6870 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -319,38 +319,22 @@ extern int DYN_FTRACE_TEST_NAME(void);
 #endif
 
 #ifdef CONFIG_FTRACE_STARTUP_TEST
-#ifdef CONFIG_FTRACE
 extern int trace_selftest_startup_function(struct tracer *trace,
 					   struct trace_array *tr);
-#endif
-#ifdef CONFIG_IRQSOFF_TRACER
 extern int trace_selftest_startup_irqsoff(struct tracer *trace,
 					  struct trace_array *tr);
-#endif
-#ifdef CONFIG_PREEMPT_TRACER
 extern int trace_selftest_startup_preemptoff(struct tracer *trace,
 					     struct trace_array *tr);
-#endif
-#if defined(CONFIG_IRQSOFF_TRACER) && defined(CONFIG_PREEMPT_TRACER)
 extern int trace_selftest_startup_preemptirqsoff(struct tracer *trace,
 						 struct trace_array *tr);
-#endif
-#ifdef CONFIG_SCHED_TRACER
 extern int trace_selftest_startup_wakeup(struct tracer *trace,
 					 struct trace_array *tr);
-#endif
-#ifdef CONFIG_NOP_TRACER
 extern int trace_selftest_startup_nop(struct tracer *trace,
 					 struct trace_array *tr);
-#endif
-#ifdef CONFIG_CONTEXT_SWITCH_TRACER
 extern int trace_selftest_startup_sched_switch(struct tracer *trace,
 					       struct trace_array *tr);
-#endif
-#ifdef CONFIG_SYSPROF_TRACER
 extern int trace_selftest_startup_sysprof(struct tracer *trace,
 					       struct trace_array *tr);
-#endif
 #endif /* CONFIG_FTRACE_STARTUP_TEST */
 
 extern void *head_page(struct trace_array_cpu *data);
-- 
1.6.0.2


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

* Re: [PATCH] ftrace: mcount_addr defined but not used
  2008-09-20  8:00       ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
  2008-09-20  8:00         ` [PATCH] trace: remove pointless ifdefs Steven Noonan
@ 2008-09-20  8:31         ` Steven Noonan
  2008-09-20  8:33           ` Steven Noonan
  2008-09-20 11:33         ` Ingo Molnar
  2 siblings, 1 reply; 18+ messages in thread
From: Steven Noonan @ 2008-09-20  8:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, mingo, Steven Noonan

On Sat, Sep 20, 2008 at 1:00 AM, Steven Noonan <steven@uplinklabs.net> wrote:
>
>  /*
> - * Since MCOUNT_ADDR may point to mcount itself, we do not want
> - * to get it confused by reading a reference in the code as we
> - * are parsing on objcopy output of text. Use a variable for
> - * it instead.
> - */
> -static unsigned long mcount_addr = MCOUNT_ADDR;
> -
> -/*

This line looks like a typo. I think I screwed up a comment block
there. I'll re-submit a patch in a moment.

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

* Re: [PATCH] ftrace: mcount_addr defined but not used
  2008-09-20  8:31         ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
@ 2008-09-20  8:33           ` Steven Noonan
  0 siblings, 0 replies; 18+ messages in thread
From: Steven Noonan @ 2008-09-20  8:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, mingo, Steven Noonan

On Sat, Sep 20, 2008 at 1:31 AM, Steven Noonan <steven@uplinklabs.net> wrote:
> On Sat, Sep 20, 2008 at 1:00 AM, Steven Noonan <steven@uplinklabs.net> wrote:
>>
>>  /*
>> - * Since MCOUNT_ADDR may point to mcount itself, we do not want
>> - * to get it confused by reading a reference in the code as we
>> - * are parsing on objcopy output of text. Use a variable for
>> - * it instead.
>> - */
>> -static unsigned long mcount_addr = MCOUNT_ADDR;
>> -
>> -/*
>
> This line looks like a typo. I think I screwed up a comment block
> there. I'll re-submit a patch in a moment.
>
Nevermind, I read it wrong. diff is messing with my head.

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-20  7:33       ` Steven Noonan
  2008-09-20  7:47         ` Andrew Morton
@ 2008-09-20 11:31         ` Ingo Molnar
  2008-09-20 15:04           ` Steven Noonan
  1 sibling, 1 reply; 18+ messages in thread
From: Ingo Molnar @ 2008-09-20 11:31 UTC (permalink / raw)
  To: Steven Noonan; +Cc: Andrew Morton, linux-kernel


* Steven Noonan <steven@uplinklabs.net> wrote:

> > yeah. Feel free to send a separate patch that implements Andrew's 
> > clean-up suggestion. I agree that pro>con.
> 
> How about this patch gets applied to -tip and I submit one that drops 
> the ifdefs on this and the other tracers?

yeah - it's been part of tip/master since yesterday.

	Ingo

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

* Re: [PATCH] ftrace: mcount_addr defined but not used
  2008-09-20  8:00       ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
  2008-09-20  8:00         ` [PATCH] trace: remove pointless ifdefs Steven Noonan
  2008-09-20  8:31         ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
@ 2008-09-20 11:33         ` Ingo Molnar
  2 siblings, 0 replies; 18+ messages in thread
From: Ingo Molnar @ 2008-09-20 11:33 UTC (permalink / raw)
  To: Steven Noonan; +Cc: linux-kernel, akpm, Steven Rostedt


* Steven Noonan <steven@uplinklabs.net> wrote:

> When CONFIG_DYNAMIC_FTRACE isn't used, neither is mcount_addr. This
> patch eliminates that warning.
> 
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>

applied to tip/tracing/ftrace, thanks Steven!

	Ingo

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

* Re: [PATCH] trace: remove pointless ifdefs
  2008-09-20  8:00         ` [PATCH] trace: remove pointless ifdefs Steven Noonan
@ 2008-09-20 11:33           ` Ingo Molnar
  0 siblings, 0 replies; 18+ messages in thread
From: Ingo Molnar @ 2008-09-20 11:33 UTC (permalink / raw)
  To: Steven Noonan; +Cc: linux-kernel, akpm, Steven Rostedt


* Steven Noonan <steven@uplinklabs.net> wrote:

> The functions are already 'extern' anyway, so there's no problem with 
> linkage. Removing these ifdefs also helps find any potential compiler 
> errors.
> 
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>

applied to tip/tracing/ftrace, thanks Steven,

	Ingo

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

* Re: [PATCH -tip FIXED] ftrace: add nop tracer
  2008-09-20 11:31         ` Ingo Molnar
@ 2008-09-20 15:04           ` Steven Noonan
  0 siblings, 0 replies; 18+ messages in thread
From: Steven Noonan @ 2008-09-20 15:04 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, linux-kernel

On Sat, Sep 20, 2008 at 4:31 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Steven Noonan <steven@uplinklabs.net> wrote:
>
>> > yeah. Feel free to send a separate patch that implements Andrew's
>> > clean-up suggestion. I agree that pro>con.
>>
>> How about this patch gets applied to -tip and I submit one that drops
>> the ifdefs on this and the other tracers?
>
> yeah - it's been part of tip/master since yesterday.
>

I saw it was applied about a minute after sending that. I should've
checked first. ;)

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

end of thread, other threads:[~2008-09-20 15:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-19 10:06 [PATCH -tip FIXED] ftrace: add nop tracer Steven Noonan
2008-09-19 10:43 ` Ingo Molnar
2008-09-19 10:48 ` Frédéric Weisbecker
2008-09-19 11:04   ` Ingo Molnar
2008-09-19 11:30     ` Frédéric Weisbecker
2008-09-19 21:23 ` Andrew Morton
2008-09-19 23:35   ` Steven Noonan
2008-09-20  6:16     ` Ingo Molnar
2008-09-20  7:33       ` Steven Noonan
2008-09-20  7:47         ` Andrew Morton
2008-09-20 11:31         ` Ingo Molnar
2008-09-20 15:04           ` Steven Noonan
2008-09-20  8:00       ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
2008-09-20  8:00         ` [PATCH] trace: remove pointless ifdefs Steven Noonan
2008-09-20 11:33           ` Ingo Molnar
2008-09-20  8:31         ` [PATCH] ftrace: mcount_addr defined but not used Steven Noonan
2008-09-20  8:33           ` Steven Noonan
2008-09-20 11:33         ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox