public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] power_trace: move power_trace to kernel/power/
@ 2011-01-26  9:19 Lai Jiangshan
  2011-01-26 11:03 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2011-01-26  9:19 UTC (permalink / raw)
  To: Steven Rostedt, Mathieu Desnoyers, Arjan van de Ven, Ingo Molnar
  Cc: Len Brown, Pavel Machek, Rafael J. Wysocki, Frederic Weisbecker,
	H. Peter Anvin, Yinghai Lu, Andrew Morton, Tejun Heo,
	linux-kernel


I think kernel/trace/ is the place for the tracing implementation files,
it is not a good place for tracepoint creation. Any subsystem should
creates tracepoints at its owner location, see also all other CREATE_TRACE_POINTS.
For example: net-traces.c is in the net/core/ directory.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/Makefile b/kernel/Makefile
index 353d3fe..25c3767 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_PM) += power/
 obj-$(CONFIG_FREEZER) += power/
+obj-$(CONFIG_TRACEPOINTS) += power/
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
@@ -100,7 +101,6 @@ obj-$(CONFIG_FUNCTION_TRACER) += trace/
 obj-$(CONFIG_TRACING) += trace/
 obj-$(CONFIG_X86_DS) += trace/
 obj-$(CONFIG_RING_BUFFER) += trace/
-obj-$(CONFIG_TRACEPOINTS) += trace/
 obj-$(CONFIG_SMP) += sched_cpupri.o
 obj-$(CONFIG_IRQ_WORK) += irq_work.o
 obj-$(CONFIG_PERF_EVENTS) += perf_event.o
diff --git a/kernel/power/Makefile b/kernel/power/Makefile
index c350e18..b5a74f5 100644
--- a/kernel/power/Makefile
+++ b/kernel/power/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_HIBERNATION)	+= hibernate.o snapshot.o swap.o user.o \
 				   block_io.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)	+= poweroff.o
+obj-$(CONFIG_TRACEPOINTS)	+= power-traces.o
diff --git a/kernel/power/power-traces.c b/kernel/power/power-traces.c
new file mode 100644
index 0000000..f55fcf6
--- /dev/null
+++ b/kernel/power/power-traces.c
@@ -0,0 +1,20 @@
+/*
+ * Power trace points
+ *
+ * Copyright (C) 2009 Arjan van de Ven <arjan@linux.intel.com>
+ */
+
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+#include <linux/sched.h>
+#include <linux/module.h>
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/power.h>
+
+#ifdef EVENT_POWER_TRACING_DEPRECATED
+EXPORT_TRACEPOINT_SYMBOL_GPL(power_start);
+#endif
+EXPORT_TRACEPOINT_SYMBOL_GPL(cpu_idle);
+
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 761c510..8ad9849 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -52,7 +52,6 @@ obj-$(CONFIG_EVENT_TRACING) += trace_event_perf.o
 endif
 obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
 obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
-obj-$(CONFIG_TRACEPOINTS) += power-traces.o
 ifeq ($(CONFIG_TRACING),y)
 obj-$(CONFIG_KGDB_KDB) += trace_kdb.o
 endif
diff --git a/kernel/trace/power-traces.c b/kernel/trace/power-traces.c
deleted file mode 100644
index f55fcf6..0000000
--- a/kernel/trace/power-traces.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Power trace points
- *
- * Copyright (C) 2009 Arjan van de Ven <arjan@linux.intel.com>
- */
-
-#include <linux/string.h>
-#include <linux/types.h>
-#include <linux/workqueue.h>
-#include <linux/sched.h>
-#include <linux/module.h>
-
-#define CREATE_TRACE_POINTS
-#include <trace/events/power.h>
-
-#ifdef EVENT_POWER_TRACING_DEPRECATED
-EXPORT_TRACEPOINT_SYMBOL_GPL(power_start);
-#endif
-EXPORT_TRACEPOINT_SYMBOL_GPL(cpu_idle);
-

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

* Re: [RFC PATCH] power_trace: move power_trace to kernel/power/
  2011-01-26  9:19 [RFC PATCH] power_trace: move power_trace to kernel/power/ Lai Jiangshan
@ 2011-01-26 11:03 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2011-01-26 11:03 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: Steven Rostedt, Mathieu Desnoyers, Arjan van de Ven, Ingo Molnar,
	Len Brown, Pavel Machek, Rafael J. Wysocki, Frederic Weisbecker,
	H. Peter Anvin, Yinghai Lu, Andrew Morton, Tejun Heo,
	linux-kernel


* Lai Jiangshan <laijs@cn.fujitsu.com> wrote:

> 
> I think kernel/trace/ is the place for the tracing implementation files,
> it is not a good place for tracepoint creation. Any subsystem should
> creates tracepoints at its owner location, see also all other CREATE_TRACE_POINTS.
> For example: net-traces.c is in the net/core/ directory.
> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/Makefile b/kernel/Makefile
> index 353d3fe..25c3767 100644
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -55,6 +55,7 @@ obj-$(CONFIG_MODULES) += module.o
>  obj-$(CONFIG_KALLSYMS) += kallsyms.o
>  obj-$(CONFIG_PM) += power/
>  obj-$(CONFIG_FREEZER) += power/
> +obj-$(CONFIG_TRACEPOINTS) += power/
>  obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
>  obj-$(CONFIG_KEXEC) += kexec.o
>  obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
> @@ -100,7 +101,6 @@ obj-$(CONFIG_FUNCTION_TRACER) += trace/
>  obj-$(CONFIG_TRACING) += trace/
>  obj-$(CONFIG_X86_DS) += trace/
>  obj-$(CONFIG_RING_BUFFER) += trace/
> -obj-$(CONFIG_TRACEPOINTS) += trace/
>  obj-$(CONFIG_SMP) += sched_cpupri.o
>  obj-$(CONFIG_IRQ_WORK) += irq_work.o
>  obj-$(CONFIG_PERF_EVENTS) += perf_event.o
> diff --git a/kernel/power/Makefile b/kernel/power/Makefile
> index c350e18..b5a74f5 100644
> --- a/kernel/power/Makefile
> +++ b/kernel/power/Makefile
> @@ -9,3 +9,4 @@ obj-$(CONFIG_HIBERNATION)	+= hibernate.o snapshot.o swap.o user.o \
>  				   block_io.o
>  
>  obj-$(CONFIG_MAGIC_SYSRQ)	+= poweroff.o
> +obj-$(CONFIG_TRACEPOINTS)	+= power-traces.o

What is 'power-traces'? Please name it power-events.c/power-events.o.

Thanks,

	Ingo

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

end of thread, other threads:[~2011-01-26 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-26  9:19 [RFC PATCH] power_trace: move power_trace to kernel/power/ Lai Jiangshan
2011-01-26 11:03 ` Ingo Molnar

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