public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32
@ 2009-08-28 20:37 Steven Rostedt
  2009-08-28 20:37 ` [PATCH 1/2] tracing: remove legacy select of MARKERS by context switch tracing Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-08-28 20:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Frederic Weisbecker,
	Arnaldo Carvalho de Melo


Ingo,

Please pull the latest tip/tracing/core tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/core


Steven Rostedt (2):
      tracing: remove legacy select of MARKERS by context switch tracing
      tracing: only show tracing_max_latency when latency tracer configured

----
 kernel/trace/Kconfig |    1 -
 kernel/trace/trace.c |   92 +++++++++++++++++++++++++++-----------------------
 kernel/trace/trace.h |    2 +
 3 files changed, 52 insertions(+), 43 deletions(-)
-- 

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

* [PATCH 1/2] tracing: remove legacy select of MARKERS by context switch tracing
  2009-08-28 20:37 [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Steven Rostedt
@ 2009-08-28 20:37 ` Steven Rostedt
  2009-08-28 20:37 ` [PATCH 2/2] tracing: only show tracing_max_latency when latency tracer configured Steven Rostedt
  2009-08-29 11:06 ` [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-08-28 20:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Frederic Weisbecker,
	Arnaldo Carvalho de Melo

[-- Attachment #1: 0001-tracing-remove-legacy-select-of-MARKERS-by-context-s.patch --]
[-- Type: text/plain, Size: 738 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The context switch tracer was made before tracepoints were mature, and
the original version used markers. This is no longer true and this
patch removes the select.

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/Kconfig |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 06be85a..163fbfc 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -60,7 +60,6 @@ config EVENT_TRACING
 	bool
 
 config CONTEXT_SWITCH_TRACER
-	select MARKERS
 	bool
 
 # All tracer options should select GENERIC_TRACER. For those options that are
-- 
1.6.3.3

-- 

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

* [PATCH 2/2] tracing: only show tracing_max_latency when latency tracer configured
  2009-08-28 20:37 [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Steven Rostedt
  2009-08-28 20:37 ` [PATCH 1/2] tracing: remove legacy select of MARKERS by context switch tracing Steven Rostedt
@ 2009-08-28 20:37 ` Steven Rostedt
  2009-08-29 11:06 ` [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-08-28 20:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Frederic Weisbecker,
	Arnaldo Carvalho de Melo

[-- Attachment #1: 0002-tracing-only-show-tracing_max_latency-when-latency-t.patch --]
[-- Type: text/plain, Size: 5570 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The tracing_max_latency file should only be present when one of the
latency tracers ({preempt|irqs}off, wakeup*) are enabled.

This patch also removes tracing_thresh when latency tracers are not
enabled, as well as compiles out code that is only used for latency
tracers.

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |   92 +++++++++++++++++++++++++++-----------------------
 kernel/trace/trace.h |    2 +
 2 files changed, 52 insertions(+), 42 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 63dbc7f..0f08816 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -43,9 +43,6 @@
 
 #define TRACE_BUFFER_FLAGS	(RB_FL_OVERWRITE)
 
-unsigned long __read_mostly	tracing_max_latency;
-unsigned long __read_mostly	tracing_thresh;
-
 /*
  * On boot up, the ring buffer is set to the minimum size, so that
  * we do not waste memory on systems that are not using tracing.
@@ -338,45 +335,6 @@ static struct {
 
 int trace_clock_id;
 
-/*
- * ftrace_max_lock is used to protect the swapping of buffers
- * when taking a max snapshot. The buffers themselves are
- * protected by per_cpu spinlocks. But the action of the swap
- * needs its own lock.
- *
- * This is defined as a raw_spinlock_t in order to help
- * with performance when lockdep debugging is enabled.
- */
-static raw_spinlock_t ftrace_max_lock =
-	(raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
-
-/*
- * Copy the new maximum trace into the separate maximum-trace
- * structure. (this way the maximum trace is permanently saved,
- * for later retrieval via /sys/kernel/debug/tracing/latency_trace)
- */
-static void
-__update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
-{
-	struct trace_array_cpu *data = tr->data[cpu];
-
-	max_tr.cpu = cpu;
-	max_tr.time_start = data->preempt_timestamp;
-
-	data = max_tr.data[cpu];
-	data->saved_latency = tracing_max_latency;
-
-	memcpy(data->comm, tsk->comm, TASK_COMM_LEN);
-	data->pid = tsk->pid;
-	data->uid = task_uid(tsk);
-	data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
-	data->policy = tsk->policy;
-	data->rt_priority = tsk->rt_priority;
-
-	/* record this tasks comm */
-	tracing_record_cmdline(tsk);
-}
-
 ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
 {
 	int len;
@@ -420,6 +378,53 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
 	return cnt;
 }
 
+/*
+ * ftrace_max_lock is used to protect the swapping of buffers
+ * when taking a max snapshot. The buffers themselves are
+ * protected by per_cpu spinlocks. But the action of the swap
+ * needs its own lock.
+ *
+ * This is defined as a raw_spinlock_t in order to help
+ * with performance when lockdep debugging is enabled.
+ *
+ * It is also used in other places outside the update_max_tr
+ * so it needs to be defined outside of the
+ * CONFIG_TRACER_MAX_TRACE.
+ */
+static raw_spinlock_t ftrace_max_lock =
+	(raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
+
+#ifdef CONFIG_TRACER_MAX_TRACE
+unsigned long __read_mostly	tracing_max_latency;
+unsigned long __read_mostly	tracing_thresh;
+
+/*
+ * Copy the new maximum trace into the separate maximum-trace
+ * structure. (this way the maximum trace is permanently saved,
+ * for later retrieval via /sys/kernel/debug/tracing/latency_trace)
+ */
+static void
+__update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
+{
+	struct trace_array_cpu *data = tr->data[cpu];
+
+	max_tr.cpu = cpu;
+	max_tr.time_start = data->preempt_timestamp;
+
+	data = max_tr.data[cpu];
+	data->saved_latency = tracing_max_latency;
+
+	memcpy(data->comm, tsk->comm, TASK_COMM_LEN);
+	data->pid = tsk->pid;
+	data->uid = task_uid(tsk);
+	data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
+	data->policy = tsk->policy;
+	data->rt_priority = tsk->rt_priority;
+
+	/* record this tasks comm */
+	tracing_record_cmdline(tsk);
+}
+
 /**
  * update_max_tr - snapshot all trace buffers from global_trace to max_tr
  * @tr: tracer
@@ -476,6 +481,7 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu)
 	__update_max_tr(tr, tsk, cpu);
 	__raw_spin_unlock(&ftrace_max_lock);
 }
+#endif /* CONFIG_TRACER_MAX_TRACE */
 
 /**
  * register_tracer - register a tracer with the ftrace system.
@@ -3952,11 +3958,13 @@ static __init int tracer_init_debugfs(void)
 	trace_create_file("current_tracer", 0644, d_tracer,
 			&global_trace, &set_tracer_fops);
 
+#ifdef CONFIG_TRACER_MAX_TRACE
 	trace_create_file("tracing_max_latency", 0644, d_tracer,
 			&tracing_max_latency, &tracing_max_lat_fops);
 
 	trace_create_file("tracing_thresh", 0644, d_tracer,
 			&tracing_thresh, &tracing_max_lat_fops);
+#endif
 
 	trace_create_file("README", 0444, d_tracer,
 			NULL, &tracing_readme_fops);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 654fd65..e2c06b2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -473,12 +473,14 @@ void unregister_tracer(struct tracer *type);
 
 extern unsigned long nsecs_to_usecs(unsigned long nsecs);
 
+#ifdef CONFIG_TRACER_MAX_TRACE
 extern unsigned long tracing_max_latency;
 extern unsigned long tracing_thresh;
 
 void update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu);
 void update_max_tr_single(struct trace_array *tr,
 			  struct task_struct *tsk, int cpu);
+#endif /* CONFIG_TRACER_MAX_TRACE */
 
 #ifdef CONFIG_STACKTRACE
 void ftrace_trace_stack(struct trace_array *tr, unsigned long flags,
-- 
1.6.3.3

-- 

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

* Re: [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32
  2009-08-28 20:37 [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Steven Rostedt
  2009-08-28 20:37 ` [PATCH 1/2] tracing: remove legacy select of MARKERS by context switch tracing Steven Rostedt
  2009-08-28 20:37 ` [PATCH 2/2] tracing: only show tracing_max_latency when latency tracer configured Steven Rostedt
@ 2009-08-29 11:06 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-08-29 11:06 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Frederic Weisbecker,
	Arnaldo Carvalho de Melo


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> Ingo,
> 
> Please pull the latest tip/tracing/core tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/tracing/core
> 
> 
> Steven Rostedt (2):
>       tracing: remove legacy select of MARKERS by context switch tracing
>       tracing: only show tracing_max_latency when latency tracer configured
> 
> ----
>  kernel/trace/Kconfig |    1 -
>  kernel/trace/trace.c |   92 +++++++++++++++++++++++++++-----------------------
>  kernel/trace/trace.h |    2 +
>  3 files changed, 52 insertions(+), 43 deletions(-)

Pulled, thanks a lot Steve!

Note, tracing/core is not in tip:master right now, due to the lockup 
i found during testing - see this thread on lkml:

Subject: Re: [GIT PULL] tracing/syscalls: The next bunch

	Ingo

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

end of thread, other threads:[~2009-08-29 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-28 20:37 [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Steven Rostedt
2009-08-28 20:37 ` [PATCH 1/2] tracing: remove legacy select of MARKERS by context switch tracing Steven Rostedt
2009-08-28 20:37 ` [PATCH 2/2] tracing: only show tracing_max_latency when latency tracer configured Steven Rostedt
2009-08-29 11:06 ` [PATCH 0/2] [GIT PULL] tracing: minor updates for 2.6.32 Ingo Molnar

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